@@ -41,58 +41,58 @@ 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 = ( ExportSettings . ExportFormat ) EditorGUILayout . Popup ( ( int ) exportSettings . exportFormat , exportFormatOptions ) ;
44
+ exportSettings . SetExportFormat ( ( 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 = ( ExportSettings . Include ) EditorGUILayout . Popup ( ( int ) exportSettings . include , includeOptions ) ;
50
+ exportSettings . SetModelAnimIncludeOption ( ( ExportSettings . Include ) EditorGUILayout . Popup ( ( int ) exportSettings . ModelAnimIncludeOption , 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 == ExportSettings . Include . Anim ) ;
58
- exportSettings . lodLevel = ( ExportSettings . LODExportType ) EditorGUILayout . Popup ( ( int ) exportSettings . lodLevel , lodOptions ) ;
57
+ EditorGUI . BeginDisabledGroup ( exportSettings . ModelAnimIncludeOption == ExportSettings . Include . Anim ) ;
58
+ exportSettings . SetLODExportType ( ( ExportSettings . LODExportType ) EditorGUILayout . Popup ( ( int ) exportSettings . LODExportType , 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 == ExportSettings . Include . Anim ) ;
66
- exportSettings . objectPosition = ( ExportSettings . ObjectPosition ) EditorGUILayout . Popup ( ( int ) exportSettings . objectPosition , objPositionOptions ) ;
65
+ EditorGUI . BeginDisabledGroup ( exportSettings . ModelAnimIncludeOption == ExportSettings . Include . Anim ) ;
66
+ exportSettings . SetObjectPosition ( ( ExportSettings . ObjectPosition ) EditorGUILayout . Popup ( ( int ) exportSettings . ObjectPosition , objPositionOptions ) ) ;
67
67
EditorGUI . EndDisabledGroup ( ) ;
68
68
GUILayout . EndHorizontal ( ) ;
69
69
70
70
GUILayout . BeginHorizontal ( ) ;
71
71
EditorGUILayout . LabelField ( new GUIContent ( "Animated Skinned Mesh" ,
72
72
"If checked, animation on objects with skinned meshes will be exported" ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
73
73
// greyed out if model
74
- EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportSettings . Include . Model ) ;
75
- exportSettings . animatedSkinnedMesh = EditorGUILayout . Toggle ( exportSettings . animatedSkinnedMesh ) ;
74
+ EditorGUI . BeginDisabledGroup ( exportSettings . ModelAnimIncludeOption == ExportSettings . Include . Model ) ;
75
+ exportSettings . SetAnimatedSkinnedMesh ( EditorGUILayout . Toggle ( exportSettings . AnimateSkinnedMesh ) ) ;
76
76
EditorGUI . EndDisabledGroup ( ) ;
77
77
GUILayout . EndHorizontal ( ) ;
78
78
79
- exportSettings . mayaCompatibleNaming = EditorGUILayout . Toggle (
79
+ exportSettings . SetUseMayaCompatibleNames ( EditorGUILayout . Toggle (
80
80
new GUIContent ( "Compatible Naming" ,
81
81
"In Maya some symbols such as spaces and accents get replaced when importing an FBX " +
82
82
"(e.g. \" foo bar\" becomes \" fooFBXASC032bar\" ). " +
83
83
"On export, convert the names of GameObjects so they are Maya compatible." +
84
- ( exportSettings . mayaCompatibleNaming ? "" :
84
+ ( exportSettings . UseMayaCompatibleNames ? "" :
85
85
"\n \n WARNING: Disabling this feature may result in lost material connections," +
86
86
" and unexpected character replacements in Maya." )
87
87
) ,
88
- exportSettings . mayaCompatibleNaming ) ;
88
+ exportSettings . UseMayaCompatibleNames ) ) ;
89
89
90
90
GUILayout . BeginHorizontal ( ) ;
91
91
EditorGUILayout . LabelField ( new GUIContent ( "Export Unrendered" ,
92
92
"If checked, meshes will be exported even if they don't have a Renderer component." ) , GUILayout . Width ( LabelWidth - FieldOffset ) ) ;
93
93
// greyed out if animation only
94
- EditorGUI . BeginDisabledGroup ( exportSettings . include == ExportSettings . Include . Anim ) ;
95
- exportSettings . exportUnrendered = EditorGUILayout . Toggle ( exportSettings . exportUnrendered ) ;
94
+ EditorGUI . BeginDisabledGroup ( exportSettings . ModelAnimIncludeOption == ExportSettings . Include . Anim ) ;
95
+ exportSettings . SetExportUnredererd ( EditorGUILayout . Toggle ( exportSettings . ExportUnrendered ) ) ;
96
96
EditorGUI . EndDisabledGroup ( ) ;
97
97
GUILayout . EndHorizontal ( ) ;
98
98
}
@@ -113,7 +113,11 @@ public interface IExportOptions {
113
113
114
114
public abstract class ExportOptionsSettingsBase < T > : ScriptableObject where T : ExportOptionsSettingsSerializeBase , new ( )
115
115
{
116
- public T info = new T ( ) ;
116
+ private T m_info = new T ( ) ;
117
+ public T info {
118
+ get { return m_info ; }
119
+ set { m_info = value ; }
120
+ }
117
121
}
118
122
119
123
public class ExportModelSettings : ExportOptionsSettingsBase < ExportModelSettingsSerialize >
@@ -122,15 +126,14 @@ public class ExportModelSettings : ExportOptionsSettingsBase<ExportModelSettings
122
126
[ System . Serializable ]
123
127
public abstract class ExportOptionsSettingsSerializeBase : IExportOptions
124
128
{
125
- public ExportSettings . ExportFormat exportFormat = ExportSettings . ExportFormat . ASCII ;
126
- public string rootMotionTransfer = "" ;
127
- public bool animatedSkinnedMesh = false ;
128
- public bool mayaCompatibleNaming = true ;
129
+ private ExportSettings . ExportFormat exportFormat = ExportSettings . ExportFormat . ASCII ;
130
+ private bool animatedSkinnedMesh = false ;
131
+ private bool mayaCompatibleNaming = true ;
129
132
130
133
[ System . NonSerialized ]
131
- protected Transform animSource ;
134
+ private Transform animSource ;
132
135
[ System . NonSerialized ]
133
- protected Transform animDest ;
136
+ private Transform animDest ;
134
137
135
138
public ExportSettings . ExportFormat ExportFormat { get { return exportFormat ; } }
136
139
public void SetExportFormat ( ExportSettings . ExportFormat format ) { this . exportFormat = format ; }
@@ -152,10 +155,10 @@ public abstract class ExportOptionsSettingsSerializeBase : IExportOptions
152
155
[ System . Serializable ]
153
156
public class ExportModelSettingsSerialize : ExportOptionsSettingsSerializeBase
154
157
{
155
- public ExportSettings . Include include = ExportSettings . Include . ModelAndAnim ;
156
- public ExportSettings . LODExportType lodLevel = ExportSettings . LODExportType . All ;
157
- public ExportSettings . ObjectPosition objectPosition = ExportSettings . ObjectPosition . LocalCentered ;
158
- public bool exportUnrendered = true ;
158
+ private ExportSettings . Include include = ExportSettings . Include . ModelAndAnim ;
159
+ private ExportSettings . LODExportType lodLevel = ExportSettings . LODExportType . All ;
160
+ private ExportSettings . ObjectPosition objectPosition = ExportSettings . ObjectPosition . LocalCentered ;
161
+ private bool exportUnrendered = true ;
159
162
160
163
public override ExportSettings . Include ModelAnimIncludeOption { get { return include ; } }
161
164
public void SetModelAnimIncludeOption ( ExportSettings . Include include ) { this . include = include ; }
0 commit comments