Skip to content

Commit f19a850

Browse files
authored
Merge pull request #225 from Unity-Technologies/UNI-31592-add-version-to-maya-tooltip
Uni 31592 add version to maya tooltip
2 parents cec5a3d + cd0cd45 commit f19a850

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

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

Lines changed: 11 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";
@@ -35,6 +36,11 @@ global proc unitySetupUI(){
3536
evalDeferred -lowestPriority "unityInstallUI";
3637
}
3738

39+
global proc string unitySetLabelVersion(string $label){
40+
global string $unityPluginVersion;
41+
return `format -stringArg $label -stringArg $unityPluginVersion "^1s (v.^2s)"`;
42+
}
43+
3844
global proc unityInstallUI(){
3945
global string $unityMenuName;
4046
global string $unityMenuDivider;
@@ -45,6 +51,7 @@ global proc unityInstallUI(){
4551
global string $unityExportIconPath;
4652
global string $unityIconPath;
4753

54+
global string $unityPluginVersion;
4855
global string $unityFamilyLabel;
4956
global string $unityImportLabel;
5057
global string $unityExportLabel;
@@ -58,7 +65,10 @@ global proc unityInstallUI(){
5865
global string $unitySendToUnityMenuName;
5966

6067
global string $gMainFileMenu;
61-
68+
69+
// update family label with version
70+
$unityFamilyLabel = unitySetLabelVersion($unityFamilyLabel);
71+
6272
buildFileMenu;
6373
$parentMenu = $gMainFileMenu;
6474
$pluginVersion = unityWhatsNewVersion();

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,11 @@ add_custom_target(
102102
"${CMAKE_SOURCE_DIR}/Assets/FbxExporters/README.txt"
103103
".*VERSION.*:.*"
104104
"VERSION: ${PACKAGE_VERSION}"
105+
COMMAND ${PYTHON_EXECUTABLE}
106+
"${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
107+
"${CMAKE_SOURCE_DIR}/Assets/Integrations/Autodesk/maya/scripts/unitySetupUI.mel"
108+
"{Version}"
109+
"${PACKAGE_VERSION}"
105110
DEPENDS "${CMAKE_SOURCE_DIR}/scripts/file-search-replace.py"
106111
COMMENT "Replacing version number in files with ${PACKAGE_VERSION}"
107112
)

0 commit comments

Comments
 (0)