Skip to content

Commit 7c895f6

Browse files
committed
Merge remote-tracking branch 'refs/remotes/origin/master' into merge-austin-unite-branch
2 parents 0e99523 + cd36a8f commit 7c895f6

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

Assets/FbxExporters/Editor/ConvertToModel.cs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,16 +207,13 @@ public static GameObject Convert (
207207

208208
// Create a prefab from the instantiated and componentized unityGO.
209209
var prefabFileName = Path.ChangeExtension(projectRelativePath, ".prefab");
210-
var prefab = PrefabUtility.CreatePrefab(prefabFileName, unityGO);
210+
var prefab = PrefabUtility.CreatePrefab(prefabFileName, unityGO, ReplacePrefabOptions.ConnectToPrefab);
211211
if (!prefab) {
212212
throw new System.Exception(
213213
string.Format("Failed to create prefab asset in [{0}] from fbx [{1}]",
214214
prefabFileName, fbxFullPath));
215215
}
216216

217-
// Connect to the prefab file.
218-
unityGO = PrefabUtility.ConnectGameObjectToPrefab(unityGO, prefab);
219-
220217
// Remove (now redundant) gameobject
221218
bool actuallyKeepOriginal;
222219
switch(keepOriginal) {

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,8 @@ def beforeImport(self, retCode, file, clientData):
160160
if not self.setExists(self._exportSet):
161161
# couldn't find export set so create it
162162
maya.cmds.sets(name=self._exportSet)
163+
# unlock set so we can add attributes to it
164+
maya.cmds.lockNode(self._exportSet, lock=False)
163165

164166
# reset attribute values, in case import fails
165167
self.storeAttribute(self._exportSet, self._unityFbxFilePathAttr, "")
@@ -197,6 +199,9 @@ def afterImport(self, *args, **kwargs):
197199
# add newly imported items to set
198200
if len(newItems) > 0:
199201
maya.cmds.sets(newItems, include=self._exportSet)
202+
203+
# lock set so it doesn't get deleted when empty
204+
maya.cmds.lockNode(self._exportSet, lock=True)
200205

201206
def doIt(self, args):
202207
self.loadDependencies()

0 commit comments

Comments
 (0)