Skip to content

Commit 6037a60

Browse files
committed
don't change name of objects in scene
- store name as temporary variable instead as it is unexpected that the scene would change when exporting
1 parent c0d0e55 commit 6037a60

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2209,12 +2209,13 @@ protected int ExportTransformHierarchy(
22092209
{
22102210
int numObjectsExported = exportProgress;
22112211

2212+
string fbxName = unityGo.name;
22122213
if (ExportOptions.UseMayaCompatibleNames) {
2213-
unityGo.name = ConvertToMayaCompatibleName (unityGo.name);
2214+
fbxName = ConvertToMayaCompatibleName (unityGo.name);
22142215
}
22152216

22162217
// create an FbxNode and add it as a child of parent
2217-
FbxNode fbxNode = FbxNode.Create (fbxScene, GetUniqueName (unityGo.name));
2218+
FbxNode fbxNode = FbxNode.Create (fbxScene, GetUniqueName (fbxName));
22182219
MapUnityObjectToFbxNode [unityGo] = fbxNode;
22192220

22202221
if (Verbose)
@@ -2481,12 +2482,13 @@ private bool ExportGameObjectAndParents(
24812482
return true;
24822483
}
24832484

2485+
string fbxName = unityGo.name;
24842486
if (ExportOptions.UseMayaCompatibleNames) {
2485-
unityGo.name = ConvertToMayaCompatibleName (unityGo.name);
2487+
fbxName = ConvertToMayaCompatibleName (unityGo.name);
24862488
}
24872489

24882490
// create an FbxNode and add it as a child of parent
2489-
fbxNode = FbxNode.Create (fbxScene, GetUniqueName (unityGo.name));
2491+
fbxNode = FbxNode.Create (fbxScene, GetUniqueName (fbxName));
24902492
MapUnityObjectToFbxNode [unityGo] = fbxNode;
24912493

24922494
exportProgress++;

0 commit comments

Comments
 (0)