Skip to content

Commit a9b459c

Browse files
committed
move maya compatible naming to new UI
1 parent cbdd4ef commit a9b459c

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

Assets/FbxExporters/Editor/ExportModelSettings.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,17 @@ public override void OnInspectorGUI ()
4848

4949
exportSettings.animatedSkinnedMesh = EditorGUILayout.Toggle ("Animated Skinned Mesh", exportSettings.animatedSkinnedMesh);
5050
EditorGUI.EndDisabledGroup ();
51+
52+
exportSettings.mayaCompatibleNaming = EditorGUILayout.Toggle (
53+
new GUIContent ("Compatible Naming:",
54+
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
55+
"(e.g. \"foo bar\" becomes \"fooFBXASC032bar\"). " +
56+
"On export, convert the names of GameObjects so they are Maya compatible." +
57+
(exportSettings.mayaCompatibleNaming ? "" :
58+
"\n\nWARNING: Disabling this feature may result in lost material connections," +
59+
" and unexpected character replacements in Maya.")
60+
),
61+
exportSettings.mayaCompatibleNaming);
5162
}
5263
}
5364

@@ -78,5 +89,6 @@ public enum LODExportType { All = 0, Highest = 1, Lowest = 2 }
7889
public ObjectPosition objectPosition = ObjectPosition.LocalCentered;
7990
public string rootMotionTransfer = "";
8091
public bool animatedSkinnedMesh = true;
92+
public bool mayaCompatibleNaming = true;
8193
}
8294
}

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,6 @@ public override void OnInspectorGUI() {
3333
EditorGUILayout.LabelField("Export Options", EditorStyles.boldLabel);
3434
EditorGUI.indentLevel++;
3535
GUILayout.BeginVertical();
36-
exportSettings.mayaCompatibleNames = EditorGUILayout.Toggle (
37-
new GUIContent ("Compatible Naming:",
38-
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
39-
"(e.g. \"foo bar\" becomes \"fooFBXASC032bar\"). " +
40-
"On export, convert the names of GameObjects so they are Maya compatible." +
41-
(exportSettings.mayaCompatibleNames ? "" :
42-
"\n\nWARNING: Disabling this feature may result in lost material connections," +
43-
" and unexpected character replacements in Maya.")
44-
),
45-
exportSettings.mayaCompatibleNames);
46-
4736
exportSettings.autoUpdaterEnabled = EditorGUILayout.Toggle(
4837
new GUIContent("Auto-Updater:",
4938
"Automatically updates prefabs with new fbx data that was imported."),
@@ -418,7 +407,6 @@ public static string[] DCCVendorLocations
418407
}
419408

420409
// Note: default values are set in LoadDefaults().
421-
public bool mayaCompatibleNames = true;
422410
public bool autoUpdaterEnabled = true;
423411
public bool launchAfterInstallation = true;
424412
public bool HideSendToUnityMenu = true;
@@ -480,18 +468,25 @@ public static ExportModelSettingsSerialize.ObjectPosition GetObjectPosition(){
480468
return instance.exportModelSettings.info.objectPosition;
481469
}
482470

471+
public static void SetObjectPosition(ExportModelSettingsSerialize.ObjectPosition objPos){
472+
instance.exportModelSettings.info.objectPosition = objPos;
473+
}
474+
483475
public static string GetRootMotionTransferNode(){
484476
return instance.exportModelSettings.info.rootMotionTransfer;
485477
}
486478

487479
public static bool AnimateSkinnedMesh(){
488480
return instance.exportModelSettings.info.animatedSkinnedMesh;
489481
}
482+
483+
public static bool UseMayaCompatibleNames(){
484+
return instance.exportModelSettings.info.mayaCompatibleNaming;
485+
}
490486
// ---------------------------------------------------------------------------------
491487

492488
protected override void LoadDefaults()
493489
{
494-
mayaCompatibleNames = true;
495490
autoUpdaterEnabled = true;
496491
launchAfterInstallation = true;
497492
HideSendToUnityMenu = true;

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ public bool ExportMaterial (Material unityMaterial, FbxScene fbxScene, FbxNode f
616616
return true;
617617
}
618618

619-
var fbxName = ExportSettings.mayaCompatibleNames
619+
var fbxName = ExportSettings.UseMayaCompatibleNames()
620620
? ConvertToMayaCompatibleName(unityName) : unityName;
621621

622622
if (Verbose) {
@@ -1923,7 +1923,7 @@ protected int ExportTransformHierarchy(
19231923
{
19241924
int numObjectsExported = exportProgress;
19251925

1926-
if (ExportSettings.mayaCompatibleNames) {
1926+
if (ExportSettings.UseMayaCompatibleNames()) {
19271927
unityGo.name = ConvertToMayaCompatibleName (unityGo.name);
19281928
}
19291929

@@ -2184,7 +2184,7 @@ private bool ExportGameObjectAndParents(
21842184
return true;
21852185
}
21862186

2187-
if (ExportSettings.mayaCompatibleNames) {
2187+
if (ExportSettings.UseMayaCompatibleNames()) {
21882188
unityGo.name = ConvertToMayaCompatibleName (unityGo.name);
21892189
}
21902190

0 commit comments

Comments
 (0)