Skip to content

Commit b47dde6

Browse files
committed
move export unrendered out of export settings singleton
1 parent c26fd32 commit b47dde6

File tree

5 files changed

+16
-42
lines changed

5 files changed

+16
-42
lines changed

Assets/FbxExporters/Editor/ConvertToPrefabSettings.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,9 @@ public bool AnimateSkinnedMesh(){
105105
public bool UseMayaCompatibleNames(){
106106
return info.mayaCompatibleNaming;
107107
}
108+
public bool ExportUnrendered(){
109+
return true;
110+
}
108111
}
109112

110113
[System.Serializable]

Assets/FbxExporters/Editor/ExportModelEditorWindow.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,7 @@ protected bool OverwriteExistingFile(string filePath){
272272

273273
public class ExportModelEditorWindow : ExportOptionsEditorWindow
274274
{
275+
protected override float MinWindowHeight { get { return 260; } }
275276
private UnityEngine.Object[] m_toExport;
276277

277278
public static void Init (IEnumerable<UnityEngine.Object> toExport, string filename = "", ModelExporter.AnimationExportType exportType = ModelExporter.AnimationExportType.all)

Assets/FbxExporters/Editor/ExportModelSettings.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,12 @@ public override void OnInspectorGUI ()
7979
" and unexpected character replacements in Maya.")
8080
),
8181
exportSettings.mayaCompatibleNaming);
82+
83+
exportSettings.exportUnrendered = EditorGUILayout.Toggle(
84+
new GUIContent("Export Unrendered:",
85+
"If checked, meshes will be exported even if they don't have a Renderer component."),
86+
exportSettings.exportUnrendered
87+
);
8288
}
8389
}
8490

@@ -90,6 +96,7 @@ public interface IExportOptions {
9096
void SetObjectPosition(ExportModelSettingsSerialize.ObjectPosition objPos);
9197
bool AnimateSkinnedMesh();
9298
bool UseMayaCompatibleNames();
99+
bool ExportUnrendered();
93100
}
94101

95102
public class ExportModelSettings : ScriptableObject, IExportOptions
@@ -125,6 +132,9 @@ public bool AnimateSkinnedMesh(){
125132
public bool UseMayaCompatibleNames(){
126133
return info.mayaCompatibleNaming;
127134
}
135+
public bool ExportUnrendered(){
136+
return info.exportUnrendered;
137+
}
128138
}
129139

130140
[System.Serializable]
@@ -145,5 +155,6 @@ public enum LODExportType { All = 0, Highest = 1, Lowest = 2 }
145155
public string rootMotionTransfer = "";
146156
public bool animatedSkinnedMesh = true;
147157
public bool mayaCompatibleNaming = true;
158+
public bool exportUnrendered = true;
148159
}
149160
}

Assets/FbxExporters/Editor/FbxExportSettings.cs

Lines changed: 0 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,6 @@ public override void OnInspectorGUI() {
3838
"Automatically updates prefabs with new fbx data that was imported."),
3939
exportSettings.autoUpdaterEnabled
4040
);
41-
42-
exportSettings.exportMeshNoRenderer = EditorGUILayout.Toggle(
43-
new GUIContent("Export Unrendered:",
44-
"If checked, meshes will be exported even if they don't have a Renderer component."),
45-
exportSettings.exportMeshNoRenderer
46-
);
4741
EditorGUILayout.Space();
4842
EditorGUILayout.Space();
4943
EditorGUI.indentLevel--;
@@ -367,7 +361,6 @@ public static string[] DCCVendorLocations
367361
public bool launchAfterInstallation = true;
368362
public bool HideSendToUnityMenu = true;
369363
public bool BakeAnimation = true;
370-
public bool exportMeshNoRenderer = false;
371364

372365
public string IntegrationSavePath;
373366

@@ -418,40 +411,6 @@ public static string[] DCCVendorLocations
418411
[SerializeField]
419412
private ConvertToPrefabSettingsSerialize convertToPrefabSettingsSerialize;
420413

421-
// ---------------- get functions for options in ExportModelSettings ----------------
422-
/*public static ExportModelSettingsSerialize.ExportFormat GetExportFormat(){
423-
return instance.exportModelSettings.info.exportFormat;
424-
}
425-
426-
public static ExportModelSettingsSerialize.Include GetModelAnimIncludeOption(){
427-
return instance.exportModelSettings.info.include;
428-
}
429-
430-
public static ExportModelSettingsSerialize.LODExportType GetLODExportType(){
431-
return instance.exportModelSettings.info.lodLevel;
432-
}
433-
434-
public static ExportModelSettingsSerialize.ObjectPosition GetObjectPosition(){
435-
return instance.exportModelSettings.info.objectPosition;
436-
}
437-
438-
public static void SetObjectPosition(ExportModelSettingsSerialize.ObjectPosition objPos){
439-
instance.exportModelSettings.info.objectPosition = objPos;
440-
}
441-
442-
public static string GetRootMotionTransferNode(){
443-
return instance.exportModelSettings.info.rootMotionTransfer;
444-
}
445-
446-
public static bool AnimateSkinnedMesh(){
447-
return instance.exportModelSettings.info.animatedSkinnedMesh;
448-
}
449-
450-
public static bool UseMayaCompatibleNames(){
451-
return instance.exportModelSettings.info.mayaCompatibleNaming;
452-
}*/
453-
// ---------------------------------------------------------------------------------
454-
455414
protected override void LoadDefaults()
456415
{
457416
autoUpdaterEnabled = true;

Assets/FbxExporters/Editor/FbxExporter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3536,7 +3536,7 @@ bool ExportMesh (GameObject gameObject, FbxNode fbxNode)
35363536

35373537
// if user doesn't want to export mesh colliders, and this gameobject doesn't have a renderer
35383538
// then don't export it.
3539-
if (!ExportSettings.instance.exportMeshNoRenderer && !gameObject.GetComponent<Renderer>()) {
3539+
if (!ExportOptions.ExportUnrendered() && !gameObject.GetComponent<Renderer>()) {
35403540
return false;
35413541
}
35423542

0 commit comments

Comments
 (0)