Skip to content

Commit 2547fcd

Browse files
committed
add plugin version to maya tooltips
1 parent cd0309f commit 2547fcd

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

Assets/Integrations/Autodesk/maya/scripts/unitySetupUI.mel

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

10+
global string $unityPluginVersion = "{Version}";
1011
global string $unityFamilyLabel = "The UnityFbxForMaya plugin allows you to reliably exchange and review your work between Maya and Unity.";
1112
global string $unityImportLabel = "Import an FBX file from a Unity project and auto-configure for exporting";
1213
global string $unityExportLabel = "Export Model to Unity";
@@ -32,6 +33,11 @@ global proc unitySetupUI(){
3233
evalDeferred -lowestPriority "unityInstallUI";
3334
}
3435

36+
global proc unitySetLabelVersion(string $label){
37+
global string $unityPluginVersion;
38+
return `format -stringArg $label -stringArg $unityPluginVersion "^1s (v.^2s)"`;
39+
}
40+
3541
global proc unityInstallUI(){
3642
global string $unityMenuName;
3743
global string $unityMenuDivider;
@@ -42,6 +48,7 @@ global proc unityInstallUI(){
4248
global string $unityExportIconPath;
4349
global string $unityIconPath;
4450

51+
global string $unityPluginVersion;
4552
global string $unityFamilyLabel;
4653
global string $unityImportLabel;
4754
global string $unityExportLabel;
@@ -53,7 +60,12 @@ global proc unityInstallUI(){
5360
global string $unityExportCommand;
5461

5562
global string $gMainFileMenu;
56-
63+
64+
// update family label
65+
$unityFamilyLabel = unitySetLabelVersion($unityFamilyLabel);
66+
$unityImportLabel = unitySetLabelVersion($unityImportLabel);
67+
$unityExportLabel = unitySetLabelVersion($unityExportLabel);
68+
5769
buildFileMenu;
5870
$parentMenu = $gMainFileMenu;
5971
$pluginVersion = unityWhatsNewVersion();

CMakeLists.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,15 @@ add_custom_target(
9494

9595
###########################################################################
9696
# Add target to replace the unity package version number in files
97+
if(${CMAKE_SYSTEM_NAME} STREQUAL "Darwin")
98+
set(VERSION_AS_STRING "\\'${PACKAGE_VERSION}\\'")
99+
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
100+
set(VERSION_AS_STRING "'${PACKAGE_VERSION}'")
101+
elseif(${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
102+
set(VERSION_AS_STRING "\\'${PACKAGE_VERSION}\\'")
103+
endif()
104+
105+
97106
set(README_TARGET readme_replace)
98107
add_custom_target(
99108
${README_TARGET}
@@ -102,6 +111,11 @@ add_custom_target(
102111
"${CMAKE_SOURCE_DIR}/Assets/FbxExporters/README.txt"
103112
".*VERSION.*:.*"
104113
"VERSION: ${PACKAGE_VERSION}"
114+
COMMAND ${PYTHON_EXECUTABLE}
115+
"${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
116+
"${CMAKE_SOURCE_DIR}/Assets/Integrations/Autodesk/maya/scripts/unitySetupUI.mel"
117+
".*global string $unityPluginVersion.*=.*"
118+
"global string $unityPluginVersion = ${VERSION_AS_STRING};"
105119
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
106120
COMMENT "Replacing version number in files with ${PACKAGE_VERSION}"
107121
)

0 commit comments

Comments
 (0)