Эх сурвалжийг харах

Ignore empty nodes that have hide_render set.

Cameras/Lamps/Meshes are ignored in the export if hide_render is set.
The same should be true of Empty objects.

Fixes #211.
Ryan Roden-Corrent 6 жил өмнө
parent
commit
54a80c64f2

+ 1 - 1
io_scene_godot/converters/simple_nodes.py

@@ -13,7 +13,7 @@ from .animation import export_animation_data, AttributeConvertInfo
 
 def export_empty_node(escn_file, export_settings, node, parent_gd_node):
     """Converts an empty (or any unknown node) into a spatial"""
-    if "EMPTY" not in export_settings['object_types']:
+    if "EMPTY" not in export_settings['object_types'] or node.hide_render:
         return parent_gd_node
     empty_node = NodeTemplate(node.name, "Spatial", parent_gd_node)
     empty_node['transform'] = node.matrix_local

+ 9 - 0
tests/reference_exports/empties.escn

@@ -0,0 +1,9 @@
+[gd_scene load_steps=1 format=2]
+
+
+[node type="Spatial" name="Scene"]
+
+
+[node name="Empty" type="Spatial" parent="."]
+
+transform = Transform(1.0, 0.0, 0.0, 0.0, 1.0, 0.0, 0.0, 0.0, 1.0, -1.0, 0.0, 0.0)

BIN
tests/test_scenes/empties.blend