Skip to content

Commit 5a7b98b

Browse files
committed
disable anim only UI if include model only
- also clean up the UI for the Options
1 parent 2aed2ab commit 5a7b98b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

Assets/FbxExporters/Editor/ConvertToPrefabSettings.cs

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,7 @@ public override void OnInspectorGUI ()
5151
EditorGUI.EndDisabledGroup ();
5252
GUILayout.EndHorizontal();
5353

54-
// TODO: add implementation for these options, grey out in the meantime
55-
EditorGUI.BeginDisabledGroup (true);
56-
GUILayout.BeginHorizontal();
57-
EditorGUILayout.LabelField(new GUIContent("Transfer Root Motion To", "Select bone to transfer root motion animation to."), GUILayout.Width(LabelWidth - FieldOffset));
58-
EditorGUILayout.Popup(0, new string[]{"<None>"});
59-
GUILayout.EndHorizontal();
60-
6154
exportSettings.animatedSkinnedMesh = EditorGUILayout.Toggle ("Animated Skinned Mesh", exportSettings.animatedSkinnedMesh);
62-
EditorGUI.EndDisabledGroup ();
6355

6456
exportSettings.mayaCompatibleNaming = EditorGUILayout.Toggle (
6557
new GUIContent ("Compatible Naming:",

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,9 @@ protected override bool DisableNameSelection {
371371
}
372372
protected override bool DisableTransferAnim {
373373
get {
374-
return ToExport == null || ToExport.Length > 1 || IsPlayableDirector;
374+
// don't transfer animation if we are exporting more than one hierarchy, the timeline clips from
375+
// a playable director, or if only the model is being exported
376+
return ToExport == null || ToExport.Length > 1 || IsPlayableDirector || SettingsObject.ModelAnimIncludeOption == ExportSettings.Include.Model;
375377
}
376378
}
377379

Assets/FbxExporters/Editor/ExportModelSettings.cs

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,11 +67,17 @@ public override void OnInspectorGUI ()
6767
EditorGUI.EndDisabledGroup ();
6868
GUILayout.EndHorizontal();
6969

70-
exportSettings.animatedSkinnedMesh = EditorGUILayout.Toggle ("Animated Skinned Mesh", exportSettings.animatedSkinnedMesh);
70+
GUILayout.BeginHorizontal();
71+
EditorGUILayout.LabelField(new GUIContent("Animated Skinned Mesh",
72+
"If checked, animation on objects with skinned meshes will be exported"), GUILayout.Width(LabelWidth - FieldOffset));
73+
// greyed out if model
74+
EditorGUI.BeginDisabledGroup(exportSettings.include == ExportSettings.Include.Model);
75+
exportSettings.animatedSkinnedMesh = EditorGUILayout.Toggle(exportSettings.animatedSkinnedMesh);
7176
EditorGUI.EndDisabledGroup ();
77+
GUILayout.EndHorizontal ();
7278

7379
exportSettings.mayaCompatibleNaming = EditorGUILayout.Toggle (
74-
new GUIContent ("Compatible Naming:",
80+
new GUIContent ("Compatible Naming",
7581
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
7682
"(e.g. \"foo bar\" becomes \"fooFBXASC032bar\"). " +
7783
"On export, convert the names of GameObjects so they are Maya compatible." +
@@ -82,7 +88,7 @@ public override void OnInspectorGUI ()
8288
exportSettings.mayaCompatibleNaming);
8389

8490
GUILayout.BeginHorizontal();
85-
EditorGUILayout.LabelField(new GUIContent("Export Unrendered:",
91+
EditorGUILayout.LabelField(new GUIContent("Export Unrendered",
8692
"If checked, meshes will be exported even if they don't have a Renderer component."), GUILayout.Width(LabelWidth - FieldOffset));
8793
// greyed out if animation only
8894
EditorGUI.BeginDisabledGroup(exportSettings.include == ExportSettings.Include.Anim);
@@ -121,9 +127,9 @@ public abstract class ExportOptionsSettingsSerializeBase : IExportOptions
121127
public bool mayaCompatibleNaming = true;
122128

123129
[System.NonSerialized]
124-
public Transform animSource;
130+
protected Transform animSource;
125131
[System.NonSerialized]
126-
public Transform animDest;
132+
protected Transform animDest;
127133

128134
public ExportSettings.ExportFormat ExportFormat { get { return exportFormat; } }
129135
public void SetExportFormat(ExportSettings.ExportFormat format){ this.exportFormat = format; }

0 commit comments

Comments
 (0)