@@ -127,7 +127,8 @@ def beforeImport(self, retCode, file, clientData):
127
127
# store path and filename
128
128
self ._tempPath = file .resolvedPath ()
129
129
self ._tempName = file .resolvedName ()
130
-
130
+ self .displayDebug ("about to import " + self ._tempName )
131
+
131
132
# Gather everything that is in the scene
132
133
self ._origItemsInScene = maya .cmds .ls (tr = True , o = True , r = True )
133
134
@@ -142,8 +143,12 @@ def beforeImport(self, retCode, file, clientData):
142
143
# reset attribute values, in case import fails
143
144
self .storeAttribute (self ._exportSet , self ._unityFbxFilePathAttr , "" )
144
145
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
+
146
150
def afterImport (self , * args , ** kwargs ):
151
+ self .displayDebug ("did import " + self ._tempName )
147
152
if self ._tempPath :
148
153
self .storeAttribute (self ._exportSet , self ._unityFbxFilePathAttr , self ._tempPath )
149
154
if self ._tempName :
@@ -156,7 +161,7 @@ def afterImport(self, *args, **kwargs):
156
161
157
162
# add newly imported items to set
158
163
maya .cmds .sets (newItems , add = self ._exportSet )
159
-
164
+
160
165
def doIt (self , args ):
161
166
self .loadDependencies ()
162
167
@@ -170,6 +175,7 @@ def doIt(self, args):
170
175
strCmd = 'Import'
171
176
self .displayDebug ('doIt {0}' .format (strCmd ))
172
177
maya .cmds .Import ()
178
+ self .displayDebug ('didIt {0}' .format (strCmd ))
173
179
174
180
OpenMaya .MMessage .removeCallback (callbackId )
175
181
OpenMaya .MMessage .removeCallback (callbackId2 )
0 commit comments