Skip to content

Commit

Permalink
2.1.0 Release for UE 5.1 only
Browse files Browse the repository at this point in the history
  • Loading branch information
pl-dsk committed Sep 26, 2022
1 parent 333f9ca commit 9e190e3
Show file tree
Hide file tree
Showing 143 changed files with 14,038 additions and 1,429 deletions.
141 changes: 108 additions & 33 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,40 @@ cmake_minimum_required(VERSION 3.0)

project(MayaLiveLink NONE) # Enable no language.

set(MAYA_VERSIONS 2020 2022 2023)
if(WIN32)
set(Platform Win64)
set(Extension .mll)
set(MayaDir WIN)
set(ScriptExtension .bat)
else()
set(Platform Linux)
set(Extension ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(MayaDir LNX)
set(ScriptExtension .sh)
endif()

set(MAYA_LOCATION $ENV{MAYA_LOCATION})
if(NOT EXISTS ${MAYA_LOCATION})
message(WARNING "MAYA_LOCATION not set properly, unitests will not be available! Current value is: ${MAYA_LOCATION} ")
endif()

set(MAYA_DEVKIT_LOCATION $ENV{MAYA_DEVKIT_LOCATION})
if(NOT EXISTS ${MAYA_DEVKIT_LOCATION})
message(FATAL_ERROR "MAYA_DEVKIT_LOCATION not set properly! Current value is: ${MAYA_DEVKIT_LOCATION} ")
endif()

# Detect Maya version from Devkit
if(EXISTS "${MAYA_DEVKIT_LOCATION}/include/maya/MTypes.h")
# Tease the MAYA_API_VERSION numbers from the lib headers
file(STRINGS ${MAYA_DEVKIT_LOCATION}/include/maya/MTypes.h TMP REGEX "#define MAYA_API_VERSION.*$")
string(REGEX MATCHALL "[0-9]+" MAYA_API_VERSION ${TMP})
string(SUBSTRING ${MAYA_API_VERSION} 0 4 MayaVersion)
else()
message(FATAL_ERROR "Unable to determine the Maya version from ${MAYA_DEVKIT_LOCATION}")
if(EXISTS ${MAYA_DEVKIT_LOCATION})
# Detect Maya version from Devkit
if(EXISTS "${MAYA_DEVKIT_LOCATION}/include/maya/MTypes.h")
# Tease the MAYA_API_VERSION numbers from the lib headers
file(STRINGS ${MAYA_DEVKIT_LOCATION}/include/maya/MTypes.h TMP REGEX "#define MAYA_API_VERSION.*$")
string(REGEX MATCHALL "[0-9]+" MAYA_API_VERSION ${TMP})
string(SUBSTRING ${MAYA_API_VERSION} 0 4 MayaVersion)
else()
message(FATAL_ERROR "Unable to determine the Maya version from ${MAYA_DEVKIT_LOCATION}")
endif()
endif()

# Detect Engine version
set(UE_ENGINE_DIR ${CMAKE_SOURCE_DIR}/../..)
set(UE_BASE_DIR ${UE_ENGINE_DIR}/..)
set(UE_VERSION_FILE ${UE_ENGINE_DIR}/Source/Runtime/Launch/Resources/Version.h)
if(EXISTS ${UE_VERSION_FILE})
file(STRINGS ${UE_VERSION_FILE} TMP REGEX "#define ENGINE_MAJOR_VERSION.*$")
Expand All @@ -35,42 +47,105 @@ else()
message(FATAL_ERROR "Unable to determine the Engine version from ${UE_VERSION_FILE}")
endif()

if(WIN32)
set(Platform Win64)
set(Extension .mll)
set(MayaDir WIN)
set(ScriptExtension .bat)
else()
set(Platform Linux)
set(Extension ${CMAKE_SHARED_LIBRARY_SUFFIX})
set(MayaDir LNX)
set(ScriptExtension .sh)
endif()

if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(BuildTarget Debug)
else()
elseif(${CMAKE_BUILD_TYPE} STREQUAL "RelWithDebInfo")
set(BuildTarget Development)
else()
set(BuildTarget Shipping)
endif()

set(MAYA_MODULE_PATH ${CMAKE_SOURCE_DIR}/Binaries/${Platform}/Maya)
set(CMAKE_BINARY_DIR ${MAYA_MODULE_PATH}/${MayaVersion})
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})

message(STATUS "Using MAYA_LOCATION = ${MAYA_LOCATION}")
message(STATUS "Using MAYA_DEVKIT_LOCATION = ${MAYA_DEVKIT_LOCATION}")
message(STATUS "Using MAYA_MODULE_PATH = ${MAYA_MODULE_PATH}")
if(NOT "${MAYA_DEVKIT_LOCATION}" STREQUAL "")
message(STATUS "Using MAYA_DEVKIT_LOCATION = ${MAYA_DEVKIT_LOCATION}")
endif()
foreach(year ${MAYA_VERSIONS})
message(STATUS "Using MAYA_${MayaDir}_DIR_${year} = $ENV{MAYA_${MayaDir}_DIR_${year}}")
if(NOT "${MAYA_DEVKIT_LOCATION}" STREQUAL "") # Set the MayaVersion only if it was not already set. (when setting MAYA_DEVKIT_LOCATION)
set(MayaVersion ${year})
endif()
endforeach()
message(STATUS "Using MayaVersion = ${MayaVersion}")
message(STATUS "Using MAYA_MODULE_PATH = ${MAYA_MODULE_PATH}")
message(STATUS "Using UEVersion = ${UEVersion}")
message(STATUS "Using BuildTarget = ${BuildTarget}")

file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR})

set(MAYA_SDK_FOUND FALSE)
foreach(year ${MAYA_VERSIONS})
if(EXISTS $ENV{MAYA_${MayaDir}_DIR_${year}})
# Build Maya Plugin
add_custom_target(
MayaPlugin${year} ALL
COMMAND "${CMAKE_SOURCE_DIR}/../../Build/BatchFiles/RunUAT${ScriptExtension}" BuildGraph -Script=Engine/Restricted/NotForLicensees/Source/Programs/MayaUnrealLiveLinkPlugin/BuildMayaUnrealLiveLinkPlugin.xml -Target=\"Stage Maya Plugin Module\" -set:MayaVersion=${MayaVersion} -set:MayaPlatform=${Platform} -set:BuildTarget=${BuildTarget} -NoXGE
COMMENT "Building Maya Plugin"
)
set(MAYA_SDK_FOUND TRUE)
endif()
endforeach()

if(NOT ${MAYA_SDK_FOUND} AND NOT "${MAYA_DEVKIT_LOCATION}" STREQUAL "")
# Build Maya Plugin
add_custom_target(
MayaPlugin${MayaVersion} ALL
COMMAND ${CMAKE_COMMAND} -E env MAYA_${MayaDir}_DIR_${MayaVersion}=${MAYA_DEVKIT_LOCATION} "${CMAKE_SOURCE_DIR}/../../Build/BatchFiles/RunUAT${ScriptExtension}" BuildGraph -Script=Engine/Restricted/NotForLicensees/Source/Programs/MayaUnrealLiveLinkPlugin/BuildMayaUnrealLiveLinkPlugin.xml -Target=\"Stage Maya Plugin Module\" -set:MayaVersion=${MayaVersion} -set:MayaPlatform=${Platform} -set:BuildTarget=${BuildTarget} -NoXGE
COMMENT "Building Maya Plugin"
)
set(MAYA_SDK_FOUND TRUE)
endif()

if(NOT ${MAYA_SDK_FOUND})
# Devkit location: https://www.autodesk.com/developer-network/platform-technologies/maya#
message(FATAL_ERROR "MAYA_DEVKIT_LOCATION or MAYA_${MayaDir}_DIR_xxxx not set properly!")
endif()

# Build Unreal Plugin
set(Package UnrealPackage)
#set(HostPlatforms "Win64+Linux") # This would be for cross compile
set(HostPlatforms "${Platform}")

add_custom_target(
MayaUnrealLiveLinkPlugin ALL
COMMAND ${CMAKE_COMMAND} -E env MAYA_${MayaDir}_DIR_${MayaVersion}=${MAYA_DEVKIT_LOCATION} "${CMAKE_SOURCE_DIR}/../../Build/BatchFiles/RunUAT${ScriptExtension}" BuildGraph -Script=Engine/Restricted/NotForLicensees/Source/Programs/MayaUnrealLiveLinkPlugin/BuildMayaUnrealLiveLinkPlugin.xml -Target=\"Stage Maya Plugin Module\" -set:MayaVersion=${MayaVersion} -set:MayaPlatform=${Platform} -set:BuildTarget=${BuildTarget} -NoXGE
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
COMMENT "Building MayaLive plugin"
)
UnrealPlugin ALL
COMMAND "${CMAKE_SOURCE_DIR}/../../Build/BatchFiles/RunUAT${ScriptExtension}" BuildPlugin -Plugin=Engine/Restricted/NotForLicensees/Plugins/Runtime/MayaLiveLink/MayaLiveLink.uplugin -Package=${Package} -HostPlatforms=${HostPlatforms} -NoTargetPlatforms -Target=UnrealEditor -NoXGE
COMMAND ${CMAKE_COMMAND} -E copy_directory ${UE_BASE_DIR}/${Package}/Binaries ${CMAKE_SOURCE_DIR}/Plugins/Runtime/MayaLiveLink/Binaries
COMMENT "Building Unreal Plugin"
)

if(EXISTS ${CMAKE_SOURCE_DIR}/Source/Programs/MayaLiveLinkUPluginInstaller/BuildMayaLiveLinkUPluginInstaller.xml)
# Build Installer
add_custom_target(
Installer ALL
COMMAND "${CMAKE_SOURCE_DIR}/../../Build/BatchFiles/RunUAT${ScriptExtension}" BuildGraph -Script=Engine/Restricted/NotForLicensees/Source/Programs/MayaLiveLinkUPluginInstaller/BuildMayaLiveLinkUPluginInstaller.xml -Target="Stage Unreal Plugin Installer" -set:InstallerPlatform=${Platform} -set:BuildTarget=Shipping -NoXGE
# DEPENDS MayaPlugin UnrealPlugin
COMMENT "Building Installer"
)

set(UNREAL_PLUGIN_FOLDER "Engine/Restricted/NotForLicensees")
file(TO_NATIVE_PATH "${UNREAL_PLUGIN_FOLDER}" UNREAL_PLUGIN_FOLDER)
set(UNREAL5_BASE_FOLDER ${UE_BASE_DIR})
file(TO_NATIVE_PATH "${UNREAL5_BASE_FOLDER}" UNREAL5_BASE_FOLDER)
set(UNREAL5LINK_PLUGIN_FOLDER "${UE_BASE_DIR}/UnrealPackage")
file(TO_NATIVE_PATH "${UNREAL5LINK_PLUGIN_FOLDER}" UNREAL5LINK_PLUGIN_FOLDER)
set(UNREAL5_ENGINE_VERSION ${UEVersion})

# InstallerSetup
add_custom_target(
InstallerSetup
COMMAND ${CMAKE_COMMAND} -E env UNREAL_PLUGIN_FOLDER=${UNREAL_PLUGIN_FOLDER}
env UNREAL5_BASE_FOLDER=${UNREAL5_BASE_FOLDER}
env UNREAL5LINK_PLUGIN_FOLDER=${UNREAL5LINK_PLUGIN_FOLDER}
env UNREAL5_ENGINE_VERSION=${UNREAL5_ENGINE_VERSION}
"${CMAKE_SOURCE_DIR}/build-scripts/InstallerSetup.bat" Installer
# DEPENDS MayaPlugin UnrealPlugin Installer
COMMENT "InstallerSetup"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
)
endif()

# Create .env file for setting environment variables for Python unit tests
file(WRITE ${CMAKE_SOURCE_DIR}/.env "UNITTEST_UNREAL_VERSION=${UEVersion}\nMAYA_VERSION=${MayaVersion}")
file(WRITE ${CMAKE_SOURCE_DIR}/.env "MAYA_VERSION=${MayaVersion}")
47 changes: 47 additions & 0 deletions Plugins/Runtime/MayaLiveLink/BuildUnrealPlugin.Bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
@REM MIT License

@REM Copyright (c) 2022 Autodesk, Inc.

@REM Permission is hereby granted, free of charge, to any person obtaining a copy
@REM of this software and associated documentation files (the "Software"), to deal
@REM in the Software without restriction, including without limitation the rights
@REM to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@REM copies of the Software, and to permit persons to whom the Software is
@REM furnished to do so, subject to the following conditions:

@REM The above copyright notice and this permission notice shall be included in all
@REM copies or substantial portions of the Software.

@REM THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
@REM IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
@REM FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@REM AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
@REM LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
@REM OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
@REM SOFTWARE.

@echo off

SET PACKAGE_FOLDER="UnrealPackage"
SET HOST_PLATFORMS="Win64+Linux"

@rem Check if a package folder exists
if "%~1" == "" (
@echo Missing Parameters
@echo BuildUnrealPlugin.bat [^<package_folder^>] [^<host_platforms^>]
@echo package_folder The folder where to package the plugin. Defaults to "UnrealPackage"
@echo host_platforms Host platforms to compile for. Defaults to "Win64+Linux"
) else (
SET PACKAGE_FOLDER=%1
)

@rem Check if the host plaforms exist
if "%~2" == "" (
@echo Missing target version
@echo Building for Win64 and Linux
) else (
SET HOST_PLATFORMS=%2
)

"%~dp0..\..\..\..\..\Build\BatchFiles\RunUAT.bat" BuildPlugin -Plugin=Engine\Restricted\NotForLicensees\Plugins\Runtime\MayaLiveLink\MayaLiveLink.uplugin -Package=%1 -HostPlatforms=%2 -NoTargetPlatforms -Target=UnrealEditor -NoXGE

8 changes: 8 additions & 0 deletions Plugins/Runtime/MayaLiveLink/Config/FilterPlugin.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[FilterPlugin]
; This section lists additional files which will be packaged along with your plugin. Paths should be listed relative to the root plugin directory, and
; may include "...", "*", and "?" wildcards to match directories, files, and individual characters respectively.
;
; Examples:
; /README.txt
; /Extras/...
; /Binaries/ThirdParty/*.dll
56 changes: 56 additions & 0 deletions Plugins/Runtime/MayaLiveLink/MayaLiveLink.uplugin
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"FileVersion": 3,
"Version": 1,
"VersionName": "2.1.999",
"FriendlyName": "Maya Live Link",
"Description": "Maya Live Link allows streaming of animated data into the Unreal Editor",
"Category": "Animation",
"CreatedBy": "Autodesk, Inc.",
"CreatedByURL": "https://www.autodesk.com",
"DocsURL": "https://help.autodesk.com/view/MAYAUL/2023/ENU/?guid=UnrealLiveLink_unreal_livelink_landing_html",
"MarketplaceURL": "",
"SupportURL": "https://forums.autodesk.com/t5/unreal-live-link-for-maya-forum/bd-p/6143",
"CanContainContent": false,
"IsBetaVersion": false,
"IsExperimentalVersion": false,
"Installed": false,
"Modules": [
{
"Name": "MayaLiveLink",
"Type": "Editor",
"LoadingPhase": "PreDefault"
},
{
"Name": "MayaLiveLinkTimelineSync",
"Type": "Editor",
"LoadingPhase": "PreDefault"
},
{
"Name": "MayaLiveLinkInterface",
"Type": "Runtime",
"LoadingPhase": "PreDefault"
}
],
"Plugins": [
{
"Name": "LiveLink",
"Enabled": true
},
{
"Name": "LiveLinkCamera",
"Enabled": true
},
{
"Name": "EditorScriptingUtilities",
"Enabled": true
},
{
"Name": "LevelSequenceEditor",
"Enabled": true
},
{
"Name": "SequencerScripting",
"Enabled": true
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// MIT License

// Copyright (c) 2022 Autodesk, Inc.

// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:

// The above copyright notice and this permission notice shall be included in all
// copies or substantial portions of the Software.

// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.

namespace UnrealBuildTool.Rules
{
public class MayaLiveLink : ModuleRules
{
public MayaLiveLink(ReadOnlyTargetRules Target) : base(Target)
{
PublicDependencyModuleNames.AddRange(
new string[]
{
"Core",
"CoreUObject",
"Engine",
"LiveLinkInterface",
});

PrivateDependencyModuleNames.AddRange(
new string[]
{
"HeadMountedDisplay",
"InputCore",
"Media",
"Projects",
"SlateCore",
"Slate",
"TimeManagement",
"EditorScriptingUtilities",
"UnrealEd",
"Persona",
"LiveLink",
"LiveLinkMessageBusFramework",
"MayaLiveLinkTimelineSync",
"MayaLiveLinkInterface"
});

if (Target.bBuildEditor)
{
PrivateDependencyModuleNames.AddRange(
new string[]
{
"MessageLog",
"UnrealEd",
});
}
}
}
}
Loading

0 comments on commit 9e190e3

Please sign in to comment.