Browse Source

Do not export editor debug geometry to OBJ.

Lasse Öörni 10 years ago
parent
commit
3859d6dd8c

+ 18 - 2
bin/Data/Scripts/Editor/EditorExport.as

@@ -23,7 +23,9 @@ void ExportSceneToOBJ(String fileName)
         MessageBox("No drawables to export in the scene");
         return;
     }
-        
+
+    RemoveDebugDrawables(drawables);
+
     File@ file = File(fileName, FILE_WRITE);
     if (WriteDrawablesToOBJ(drawables, file))
     {
@@ -70,7 +72,9 @@ void ExportSelectedToOBJ(String fileName)
                 drawables.Push(drawable);
         }
     }
-    
+
+    RemoveDebugDrawables(drawables);
+
     if (drawables.length > 0)
     {
         File@ file = File(fileName, FILE_WRITE);
@@ -91,4 +95,16 @@ void ExportSelectedToOBJ(String fileName)
     {
         MessageBox("No selected drawables to export to OBJ");
     }
+}
+
+void RemoveDebugDrawables(Array<Drawable@>@ drawables)
+{
+    for (uint i = 0; i < drawables.length;)
+    {
+        if (drawables[i].node !is null && (drawables[i].node.name == "EditorGizmo" || drawables[i].node.name == "DebugIconsContainer"
+            || drawables[i].node.name == "EditorGrid"))
+            drawables.Erase(i);
+        else
+            ++i;
+    }
 }

+ 1 - 0
bin/Data/Scripts/Editor/EditorGizmo.as

@@ -84,6 +84,7 @@ void CreateGizmo()
     gizmo.enabled = false;
     gizmo.viewMask = 0x80000000; // Editor raycasts use viewmask 0x7fffffff
     gizmo.occludee = false;
+    gizmoNode.name = "EditorGizmo";
 
     gizmoAxisX.lastSelected = false;
     gizmoAxisY.lastSelected = false;

+ 1 - 0
bin/Data/Scripts/Editor/EditorView.as

@@ -1016,6 +1016,7 @@ void CreateGrid()
         gridNode.Remove();
 
     gridNode = Node();
+    gridNode.name = "EditorGrid";
     grid = gridNode.CreateComponent("CustomGeometry");
     grid.numGeometries = 1;
     grid.material = cache.GetResource("Material", "Materials/VColUnlit.xml");