Skip to content

Commit dc86f8f

Browse files
committed
restore Maya selection after publish
1 parent 5219dac commit dc86f8f

File tree

1 file changed

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

1 file changed

+8
-0
lines changed

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

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

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

@@ -310,6 +311,9 @@ def doIt(self, args):
310311
self.displayDebug('doIt({0})'.format(melCommand))
311312

312313
maya.mel.eval(melCommand)
314+
315+
if origSelection:
316+
maya.cmds.select(origSelection, add=True)
313317

314318
@classmethod
315319
def invoke(cls):
@@ -359,6 +363,7 @@ def doIt(self, args):
359363

360364
# select the export set for export, if it exists,
361365
# otherwise take what is currently selected
366+
origSelection = maya.cmds.ls(sl=True)
362367
if self.setExists(self._exportSet):
363368
maya.cmds.select(self._exportSet, r=True, ne=True)
364369

@@ -372,6 +377,9 @@ def doIt(self, args):
372377
self.displayDebug('doIt {0}'.format(strCmd))
373378
maya.mel.eval(strCmd)
374379

380+
if origSelection:
381+
maya.cmds.select(origSelection, add=True)
382+
375383
@classmethod
376384
def invoke(cls):
377385
"""

0 commit comments

Comments
 (0)