Skip to content

Commit 2c8fb38

Browse files
authored
Merge pull request #116 from Unity-Technologies/Uni-24236-maya-export-set-cleared
Uni-24236-maya-export-set-cleared
2 parents 8f7fe3c + 148cb06 commit 2c8fb38

File tree

1 file changed

+3
-4
lines changed
  • Assets/Integrations/Autodesk/maya2017/scripts/unityOneClick

1 file changed

+3
-4
lines changed

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -135,9 +135,6 @@ def beforeImport(self, retCode, file, clientData):
135135
if not self.setExists(self._exportSet):
136136
# couldn't find export set so create it
137137
maya.cmds.sets(name=self._exportSet)
138-
else:
139-
# remove all items from set
140-
maya.cmds.sets(clear=self._exportSet)
141138

142139
# reset attribute values, in case import fails
143140
self.storeAttribute(self._exportSet, self._unityFbxFilePathAttr, "")
@@ -155,10 +152,12 @@ def afterImport(self, *args, **kwargs):
155152
if self.setExists(self._exportSet):
156153
# figure out what has been added after import
157154
itemsInScene = maya.cmds.ls(tr=True, o=True, r=True)
155+
158156
newItems = list(set(itemsInScene) - set(self._origItemsInScene))
159157

160158
# add newly imported items to set
161-
maya.cmds.sets(newItems, add=self._exportSet)
159+
if len(newItems) > 0:
160+
maya.cmds.sets(newItems, include=self._exportSet)
162161

163162
def doIt(self, args):
164163
self.loadDependencies()

0 commit comments

Comments
 (0)