Skip to content

Commit 88ff7f8

Browse files
committed
add AllowSceneModification option to ExportOptions
- know when to modify scene, when not to
1 parent 6037a60 commit 88ff7f8

File tree

3 files changed

+8
-0
lines changed

3 files changed

+8
-0
lines changed

Assets/FbxExporters/Editor/ConvertToPrefabSettings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,6 @@ public class ConvertToPrefabSettingsSerialize : ExportOptionsSettingsSerializeBa
7676
public override ExportSettings.LODExportType LODExportType { get { return ExportSettings.LODExportType.All; } }
7777
public override ExportSettings.ObjectPosition ObjectPosition { get { return ExportSettings.ObjectPosition.Reset; } }
7878
public override bool ExportUnrendered { get { return true; } }
79+
public override bool AllowSceneModification { get { return true; } }
7980
}
8081
}

Assets/FbxExporters/Editor/ExportModelSettings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ public interface IExportOptions {
105105
ExportSettings.ObjectPosition ObjectPosition { get; }
106106
bool AnimateSkinnedMesh { get; }
107107
bool UseMayaCompatibleNames { get; }
108+
bool AllowSceneModification { get; }
108109
bool ExportUnrendered { get; }
109110
Transform AnimationSource { get; }
110111
Transform AnimationDest { get; }
@@ -145,6 +146,7 @@ public abstract class ExportOptionsSettingsSerializeBase : IExportOptions
145146
public abstract ExportSettings.LODExportType LODExportType { get; }
146147
public abstract ExportSettings.ObjectPosition ObjectPosition { get; }
147148
public abstract bool ExportUnrendered { get; }
149+
public abstract bool AllowSceneModification { get; }
148150
}
149151

150152
[System.Serializable]
@@ -163,5 +165,6 @@ public class ExportModelSettingsSerialize : ExportOptionsSettingsSerializeBase
163165
public void SetObjectPosition(ExportSettings.ObjectPosition objPos){ this.objectPosition = objPos; }
164166
public override bool ExportUnrendered { get { return exportUnrendered; } }
165167
public void SetExportUnredererd(bool exportUnrendered){ this.exportUnrendered = exportUnrendered; }
168+
public override bool AllowSceneModification { get { return false; } }
166169
}
167170
}

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2212,6 +2212,10 @@ protected int ExportTransformHierarchy(
22122212
string fbxName = unityGo.name;
22132213
if (ExportOptions.UseMayaCompatibleNames) {
22142214
fbxName = ConvertToMayaCompatibleName (unityGo.name);
2215+
if (ExportOptions.AllowSceneModification)
2216+
{
2217+
unityGo.name = fbxName;
2218+
}
22152219
}
22162220

22172221
// create an FbxNode and add it as a child of parent

0 commit comments

Comments
 (0)