Skip to content

Commit 8813032

Browse files
authored
Merge pull request #137 from Unity-Technologies/UNI-24847-restore-selection-after-publish
Uni 24847 restore selection after publish
2 parents 0fab88e + 1d8b8c8 commit 8813032

File tree

1 file changed

+10
-0
lines changed
  • Assets/Integrations/Autodesk/maya/scripts/unityOneClick

1 file changed

+10
-0
lines changed

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

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,7 @@ def doIt(self, args):
280280

281281
# select the export set for export, if it exists,
282282
# otherwise take what is currently selected
283+
origSelection = maya.cmds.ls(sl=True)
283284
if self.setExists(self._exportSet):
284285
maya.cmds.select(self._exportSet, r=True, ne=True)
285286

@@ -311,6 +312,10 @@ def doIt(self, args):
311312
self.displayDebug('doIt({0})'.format(melCommand))
312313

313314
maya.mel.eval(melCommand)
315+
316+
if origSelection:
317+
maya.cmds.select(cl=True)
318+
maya.cmds.select(origSelection, add=True, ne=True)
314319

315320
@classmethod
316321
def invoke(cls):
@@ -360,6 +365,7 @@ def doIt(self, args):
360365

361366
# select the export set for export, if it exists,
362367
# otherwise take what is currently selected
368+
origSelection = maya.cmds.ls(sl=True)
363369
if self.setExists(self._exportSet):
364370
maya.cmds.select(self._exportSet, r=True, ne=True)
365371

@@ -373,6 +379,10 @@ def doIt(self, args):
373379
self.displayDebug('doIt {0}'.format(strCmd))
374380
maya.mel.eval(strCmd)
375381

382+
if origSelection:
383+
maya.cmds.select(cl=True)
384+
maya.cmds.select(origSelection, add=True, ne=True)
385+
376386
@classmethod
377387
def invoke(cls):
378388
"""

0 commit comments

Comments
 (0)