Skip to content

Commit e69d62a

Browse files
author
Benoit Hudson
committed
Fix bug on OSX that we weren't importing.
1 parent c7f3b13 commit e69d62a

File tree

1 file changed

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

1 file changed

+9
-3
lines changed

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

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,8 @@ def beforeImport(self, retCode, file, clientData):
127127
# store path and filename
128128
self._tempPath = file.resolvedPath()
129129
self._tempName = file.resolvedName()
130-
130+
self.displayDebug("about to import " + self._tempName)
131+
131132
# Gather everything that is in the scene
132133
self._origItemsInScene = maya.cmds.ls(tr=True, o=True, r=True)
133134

@@ -142,8 +143,12 @@ def beforeImport(self, retCode, file, clientData):
142143
# reset attribute values, in case import fails
143144
self.storeAttribute(self._exportSet, self._unityFbxFilePathAttr, "")
144145
self.storeAttribute(self._exportSet, self._unityFbxFileNameAttr, "")
145-
146+
147+
# Let Maya know we're OK with importing this file.
148+
OpenMaya.MScriptUtil.setBool(retCode, True)
149+
146150
def afterImport(self, *args, **kwargs):
151+
self.displayDebug("did import " + self._tempName)
147152
if self._tempPath:
148153
self.storeAttribute(self._exportSet, self._unityFbxFilePathAttr, self._tempPath)
149154
if self._tempName:
@@ -156,7 +161,7 @@ def afterImport(self, *args, **kwargs):
156161

157162
# add newly imported items to set
158163
maya.cmds.sets(newItems, add=self._exportSet)
159-
164+
160165
def doIt(self, args):
161166
self.loadDependencies()
162167

@@ -170,6 +175,7 @@ def doIt(self, args):
170175
strCmd = 'Import'
171176
self.displayDebug('doIt {0}'.format(strCmd))
172177
maya.cmds.Import()
178+
self.displayDebug('didIt {0}'.format(strCmd))
173179

174180
OpenMaya.MMessage.removeCallback(callbackId)
175181
OpenMaya.MMessage.removeCallback(callbackId2)

0 commit comments

Comments
 (0)