Skip to content

Commit 0ba2b06

Browse files
author
Mark Visser
committed
re-inserted package version in Maya Unity menu item (now queried from git tags)
1 parent 32f583c commit 0ba2b06

File tree

2 files changed

+38
-7
lines changed

2 files changed

+38
-7
lines changed

CMakeLists.txt

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,61 @@ MESSAGE(STATUS "CMAKE_INSTALL_PREFIX is: " ${CMAKE_INSTALL_PREFIX})
55

66
project (UnityFbxExporterEditorPackage NONE)
77

8+
###########################################################################
9+
# Get git tag as package version
10+
11+
find_package(Git REQUIRED)
12+
execute_process(COMMAND ${GIT_EXECUTABLE} describe --tags HEAD
13+
OUTPUT_VARIABLE COM_UNITY_FORMATS_FBX_VERSION
14+
OUTPUT_STRIP_TRAILING_WHITESPACE)
15+
816
###########################################################################
917
# Zip integrations folder
1018

11-
set(MAYA_INTEGRATION_TARGET zip_maya_integration)
19+
set(MAYA_INTEGRATION_COPY_TARGET CopyMayaIntegration)
20+
set(MAYA_INTEGRATION_ZIP_TARGET ZipMayaIntegration)
1221
set(MAYA_INTEGRATION_ZIP_NAME "UnityFbxForMaya.zip")
1322

14-
set(MAX_INTEGRATION_TARGET zip_max_integration)
23+
set(MAX_INTEGRATION_ZIP_TARGET ZipMaxIntegration)
1524
set(MAX_INTEGRATION_ZIP_NAME "UnityFbxForMax.zip")
1625

26+
configure_file("${CMAKE_SOURCE_DIR}/Integrations/Autodesk/maya/scripts/unitySetupUI.mel.in"
27+
"${CMAKE_BINARY_DIR}/Integrations/Autodesk/maya/scripts/unitySetupUI.mel"
28+
@ONLY
29+
)
30+
31+
file(GLOB_RECURSE MAYA_INTEGRATION_FILES RELATIVE "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/Integrations/Autodesk/maya/*")
32+
list(FILTER MAYA_INTEGRATION_FILES EXCLUDE REGEX ".*/unitySetupUI.mel.in$")
33+
34+
add_custom_command(OUTPUT ${MAYA_INTEGRATION_FILES}
35+
COMMAND ${CMAKE_COMMAND} -E copy_directory
36+
"${CMAKE_SOURCE_DIR}/Integrations/Autodesk/maya"
37+
"${CMAKE_BINARY_DIR}/Integrations/Autodesk/maya"
38+
COMMAND ${CMAKE_COMMAND} -E remove
39+
"${CMAKE_BINARY_DIR}/Integrations/Autodesk/maya/scripts/unitySetupUI.mel.in"
40+
COMMENT "Copying Maya Integration folder"
41+
WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
42+
)
43+
44+
add_custom_target(${MAYA_INTEGRATION_COPY_TARGET} ALL DEPENDS ${MAYA_INTEGRATION_FILES})
45+
1746
add_custom_command(OUTPUT ${MAYA_INTEGRATION_ZIP_NAME}
1847
COMMAND ${CMAKE_COMMAND} -E tar "cfv" ${CMAKE_BINARY_DIR}/${MAYA_INTEGRATION_ZIP_NAME} --format=zip
19-
"${CMAKE_SOURCE_DIR}/Integrations/Autodesk/maya"
48+
"${CMAKE_BINARY_DIR}/Integrations/Autodesk/maya"
49+
MAIN_DEPENDENCY "${CMAKE_SOURCE_DIR}/Integrations/Autodesk/maya"
2050
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
2151
COMMENT "Zipping Maya Integration folder"
2252
)
23-
add_custom_target(${MAYA_INTEGRATION_TARGET} ALL DEPENDS ${MAYA_INTEGRATION_ZIP_NAME})
53+
add_custom_target(${MAYA_INTEGRATION_ZIP_TARGET} ALL DEPENDS ${MAYA_INTEGRATION_ZIP_NAME})
54+
add_dependencies(${MAYA_INTEGRATION_ZIP_TARGET} ${MAYA_INTEGRATION_COPY_TARGET})
2455

2556
add_custom_command(OUTPUT ${MAX_INTEGRATION_ZIP_NAME}
2657
COMMAND ${CMAKE_COMMAND} -E tar "cfv" ${CMAKE_BINARY_DIR}/${MAX_INTEGRATION_ZIP_NAME} --format=zip
2758
"${CMAKE_SOURCE_DIR}/Integrations/Autodesk/max"
28-
WORKING_DIRECTORY ${CMAKE_BINARY_DIR}
59+
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
2960
COMMENT "Zipping 3DsMax Integration folder"
3061
)
31-
add_custom_target(${MAX_INTEGRATION_TARGET} ALL DEPENDS ${MAX_INTEGRATION_ZIP_NAME})
62+
add_custom_target(${MAX_INTEGRATION_ZIP_TARGET} ALL DEPENDS ${MAX_INTEGRATION_ZIP_NAME})
3263

3364
############################################################################
3465
# Install project into build folder

Integrations/Autodesk/maya/scripts/unitySetupUI.mel renamed to Integrations/Autodesk/maya/scripts/unitySetupUI.mel.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ global string $unityImportIconPath = "import.png";
77
global string $unityExportIconPath = "export.png";
88
global string $unityIconPath = "unity.png";
99

10-
global string $unityFamilyLabel = "The UnityFbxForMaya plugin allows you to reliably exchange and review your work between Maya and Unity.";
10+
global string $unityFamilyLabel = "The UnityFbxForMaya (@COM_UNITY_FORMATS_FBX_VERSION@) plugin allows you to reliably exchange and review your work between Maya and Unity.";
1111
global string $unityImportLabel = "Import an FBX file from a Unity project and auto-configure for exporting";
1212
global string $unityExportModelLabel = "Export Model to Unity";
1313
global string $unityExportAnimLabel = "Export Animation to Unity";

0 commit comments

Comments
 (0)