@@ -41,29 +41,29 @@ public override void OnInspectorGUI ()
41
41
GUILayout . BeginHorizontal ( ) ;
42
42
EditorGUILayout . LabelField ( new GUIContent ( "Export Format" , "Export the FBX file in the standard binary format." +
43
43
" Select ASCII to export the FBX file in ASCII format." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
44
- exportSettings . exportFormat = ( ExportModelSettingsSerialize . ExportFormat ) EditorGUILayout . Popup ( ( int ) exportSettings . exportFormat , exportFormatOptions ) ;
44
+ exportSettings . exportFormat = ( ExportSettings . ExportFormat ) EditorGUILayout . Popup ( ( int ) exportSettings . exportFormat , exportFormatOptions ) ;
45
45
GUILayout . EndHorizontal ( ) ;
46
46
47
47
GUILayout . BeginHorizontal ( ) ;
48
48
EditorGUILayout . LabelField ( new GUIContent ( "Include" , "Select whether to export models, animation or both." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
49
49
EditorGUI . BeginDisabledGroup ( disableIncludeDropdown ) ;
50
- exportSettings . include = ( ExportModelSettingsSerialize . Include ) EditorGUILayout . Popup ( ( int ) exportSettings . include , includeOptions ) ;
50
+ exportSettings . include = ( ExportSettings . Include ) EditorGUILayout . Popup ( ( int ) exportSettings . include , includeOptions ) ;
51
51
EditorGUI . EndDisabledGroup ( ) ;
52
52
GUILayout . EndHorizontal ( ) ;
53
53
54
54
GUILayout . BeginHorizontal ( ) ;
55
55
EditorGUILayout . LabelField ( new GUIContent ( "LOD level" , "Select which LOD to export." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
56
56
// greyed out if animation only
57
- EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportModelSettingsSerialize . Include . Anim ) ;
58
- exportSettings . lodLevel = ( ExportModelSettingsSerialize . LODExportType ) EditorGUILayout . Popup ( ( int ) exportSettings . lodLevel , lodOptions ) ;
57
+ EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportSettings . Include . Anim ) ;
58
+ exportSettings . lodLevel = ( ExportSettings . LODExportType ) EditorGUILayout . Popup ( ( int ) exportSettings . lodLevel , lodOptions ) ;
59
59
EditorGUI . EndDisabledGroup ( ) ;
60
60
GUILayout . EndHorizontal ( ) ;
61
61
62
62
GUILayout . BeginHorizontal ( ) ;
63
63
EditorGUILayout . LabelField ( new GUIContent ( "Object(s) Position" , "Select an option for exporting object's transform." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
64
64
// greyed out if animation only
65
- EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportModelSettingsSerialize . Include . Anim ) ;
66
- exportSettings . objectPosition = ( ExportModelSettingsSerialize . ObjectPosition ) EditorGUILayout . Popup ( ( int ) exportSettings . objectPosition , objPositionOptions ) ;
65
+ EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportSettings . Include . Anim ) ;
66
+ exportSettings . objectPosition = ( ExportSettings . ObjectPosition ) EditorGUILayout . Popup ( ( int ) exportSettings . objectPosition , objPositionOptions ) ;
67
67
EditorGUI . EndDisabledGroup ( ) ;
68
68
GUILayout . EndHorizontal ( ) ;
69
69
@@ -92,61 +92,59 @@ public override void OnInspectorGUI ()
92
92
EditorGUILayout . LabelField ( new GUIContent ( "Export Unrendered:" ,
93
93
"If checked, meshes will be exported even if they don't have a Renderer component." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
94
94
// greyed out if animation only
95
- EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportModelSettingsSerialize . Include . Anim ) ;
95
+ EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportSettings . Include . Anim ) ;
96
96
exportSettings . exportUnrendered = EditorGUILayout . Toggle ( exportSettings . exportUnrendered ) ;
97
97
EditorGUI . EndDisabledGroup ( ) ;
98
98
GUILayout . EndHorizontal ( ) ;
99
99
}
100
100
}
101
101
102
102
public interface IExportOptions {
103
- ExportModelSettingsSerialize . ExportFormat GetExportFormat { get ; set ; }
104
- ExportModelSettingsSerialize . Include GetModelAnimIncludeOption { get ; set ; }
105
- ExportModelSettingsSerialize . LODExportType GetLODExportType { get ; set ; }
106
- ExportModelSettingsSerialize . ObjectPosition GetObjectPosition { get ; set ; }
103
+ ExportSettings . ExportFormat ExportFormat { get ; set ; }
104
+ ExportSettings . Include ModelAnimIncludeOption { get ; set ; }
105
+ ExportSettings . LODExportType LODExportType { get ; set ; }
106
+ ExportSettings . ObjectPosition ObjectPosition { get ; set ; }
107
107
bool AnimateSkinnedMesh { get ; set ; }
108
108
bool UseMayaCompatibleNames { get ; set ; }
109
+ bool ExportUnrendered { get ; set ; }
109
110
}
110
111
111
- public abstract class ExportOptionsSettingsBase < T > : ScriptableObject , IExportOptions where T : ExportOptionsSettingsSerializeBase
112
+ public abstract class ExportOptionsSettingsBase < T > : ScriptableObject where T : ExportOptionsSettingsSerializeBase , new ( )
112
113
{
113
114
public T info = new T ( ) ;
114
- ExportModelSettingsSerialize . ExportFormat GetExportFormat { get { return info . exportFormat ; } set { info . exportFormat = value ; } }
115
- ExportModelSettingsSerialize . Include GetModelAnimIncludeOption { get ; set ; }
116
- ExportModelSettingsSerialize . LODExportType GetLODExportType { get ; set ; }
117
- ExportModelSettingsSerialize . ObjectPosition GetObjectPosition { get ; set ; }
118
- bool AnimateSkinnedMesh { get ; set ; }
119
- bool UseMayaCompatibleNames { get ; set ; }
120
- bool ExportUnrendered { get ; set ; }
121
115
}
122
116
123
117
public class ExportModelSettings : ExportOptionsSettingsBase < ExportModelSettingsSerialize >
124
- {
125
- }
118
+ { }
126
119
127
120
[ System . Serializable ]
128
- public abstract class ExportOptionsSettingsSerializeBase
121
+ public abstract class ExportOptionsSettingsSerializeBase : IExportOptions
129
122
{
130
- public ExportModelSettingsSerialize . ExportFormat exportFormat = ExportModelSettingsSerialize . ExportFormat . ASCII ;
123
+ public ExportSettings . ExportFormat exportFormat = ExportSettings . ExportFormat . ASCII ;
131
124
public string rootMotionTransfer = "" ;
132
125
public bool animatedSkinnedMesh = true ;
133
126
public bool mayaCompatibleNaming = true ;
127
+
128
+ public ExportSettings . ExportFormat ExportFormat { get { return exportFormat ; } set { exportFormat = value ; } }
129
+ public bool AnimateSkinnedMesh { get { return animatedSkinnedMesh ; } set { animatedSkinnedMesh = value ; } }
130
+ public bool UseMayaCompatibleNames { get { return mayaCompatibleNaming ; } set { mayaCompatibleNaming = value ; } }
131
+ public abstract ExportSettings . Include ModelAnimIncludeOption { get ; set ; }
132
+ public abstract ExportSettings . LODExportType LODExportType { get ; set ; }
133
+ public abstract ExportSettings . ObjectPosition ObjectPosition { get ; set ; }
134
+ public abstract bool ExportUnrendered { get ; set ; }
134
135
}
135
136
136
137
[ System . Serializable ]
137
138
public class ExportModelSettingsSerialize : ExportOptionsSettingsSerializeBase
138
139
{
139
- public enum ExportFormat { ASCII = 0 , Binary = 1 }
140
-
141
- public enum Include { Model = 0 , Anim = 1 , ModelAndAnim = 2 }
142
-
143
- public enum ObjectPosition { LocalCentered = 0 , WorldAbsolute = 1 , Reset = 2 /* For convert to model only, no UI option*/ }
144
-
145
- public enum LODExportType { All = 0 , Highest = 1 , Lowest = 2 }
146
-
147
- public Include include = Include . ModelAndAnim ;
148
- public LODExportType lodLevel = LODExportType . All ;
149
- public ObjectPosition objectPosition = ObjectPosition . LocalCentered ;
140
+ public ExportSettings . Include include = ExportSettings . Include . ModelAndAnim ;
141
+ public ExportSettings . LODExportType lodLevel = ExportSettings . LODExportType . All ;
142
+ public ExportSettings . ObjectPosition objectPosition = ExportSettings . ObjectPosition . LocalCentered ;
150
143
public bool exportUnrendered = true ;
144
+
145
+ public override ExportSettings . Include ModelAnimIncludeOption { get { return include ; } set { include = value ; } }
146
+ public override ExportSettings . LODExportType LODExportType { get { return lodLevel ; } set { lodLevel = value ; } }
147
+ public override ExportSettings . ObjectPosition ObjectPosition { get { return objectPosition ; } set { objectPosition = value ; } }
148
+ public override bool ExportUnrendered { get { return exportUnrendered ; } set { exportUnrendered = value ; } }
151
149
}
152
150
}
0 commit comments