Skip to content

Commit 9b74d63

Browse files
authored
Merge pull request #139 from Unity-Technologies/Uni-25624-whats-new-always
Uni-25624-whats-new-always
2 parents 5219dac + 1baed28 commit 9b74d63

File tree

1 file changed

+14
-6
lines changed
  • Assets/Integrations/Autodesk/maya/scripts/unityOneClick

1 file changed

+14
-6
lines changed

Assets/Integrations/Autodesk/maya/scripts/unityOneClick/ui.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
# User Interface
3030
# ======================================================================'
3131

32-
kMayaVersionAdded = '2017'
3332
kMenuName = 'UnityOneClick'
3433
kMenuDivider = 'UnityOneClickDivider'
3534
kMenuLabel = 'UNITY'
@@ -54,10 +53,19 @@ def unregister(pluginFn):
5453
return
5554

5655
def getParentMenu():
56+
"""
57+
Return the name of the parent menu for the Unity menu
58+
"""
5759
result = maya.mel.eval('$tempVar = $gMainFileMenu;')
5860
maya.mel.eval("buildFileMenu")
5961
return result
6062

63+
def whatsNewVersion():
64+
"""
65+
Return the name of Maya version to be considered 'new' e.g. "2018"
66+
"""
67+
return maya.cmds.about(q=True, version=True)
68+
6169
def installMenu():
6270
"""
6371
install menu into main window
@@ -70,34 +78,34 @@ def installMenu():
7078
longDivider=False,
7179
insertAfter=kMenuInsertAfter,
7280
parent=parentMenu,
73-
version=kMayaVersionAdded)
81+
version=whatsNewVersion())
7482
maya.cmds.menuItem(kMenuName,
7583
parent=parentMenu,
7684
insertAfter=kMenuDivider,
7785
image=commands.importCmd.familyIconPath(),
7886
subMenu=True,
7987
label=kMenuLabel,
8088
tearOff=True,
81-
version=kMayaVersionAdded)
89+
version=whatsNewVersion())
8290

8391
maya.cmds.menuItem(parent=kMenuName,
8492
label=commands.importCmd.kShortLabel,
8593
annotation=commands.importCmd.kLabel,
8694
command=commands.importCmd.kScriptCommand,
8795
image=commands.importCmd.iconPath(),
88-
version=kMayaVersionAdded)
96+
version=whatsNewVersion())
8997
maya.cmds.menuItem(parent=kMenuName,
9098
label=commands.reviewCmd.kShortLabel,
9199
annotation=commands.reviewCmd.kLabel,
92100
command=commands.reviewCmd.kScriptCommand,
93101
image=commands.importCmd.iconPath(),
94-
version=kMayaVersionAdded)
102+
version=whatsNewVersion())
95103
maya.cmds.menuItem(parent=kMenuName,
96104
label=commands.publishCmd.kShortLabel,
97105
annotation=commands.publishCmd.kLabel,
98106
command=commands.publishCmd.kScriptCommand,
99107
image=commands.importCmd.iconPath(),
100-
version=kMayaVersionAdded)
108+
version=whatsNewVersion())
101109

102110
def uninstallMenu():
103111
"""

0 commit comments

Comments
 (0)