Skip to content

Commit

Permalink
Added export option for excluding objects hidden during rendering. Sh…
Browse files Browse the repository at this point in the history
…ould fix Issue godotengine#314
  • Loading branch information
xphlawlessx committed Oct 7, 2020
1 parent 564aa4f commit d7a2d5f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions io_scene_godot/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,12 @@ class ExportGodot(bpy.types.Operator, ExportHelper):
description="Export only selected objects",
default=False,
)

use_included_in_render: BoolProperty(
name="Only Rendered Objects",
description="Export only objects included in render",
default=False,
)
use_mesh_modifiers: BoolProperty(
name="Apply Modifiers",
description="Apply modifiers to mesh objects (on a copy!).",
Expand Down
3 changes: 2 additions & 1 deletion io_scene_godot/export_godot.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ def should_export_object(self, obj):
"""Checks if a node should be exported:"""
if obj.type not in self.config["object_types"]:
return False

if self.config["use_included_in_render"] and obj.hide_render:
return False
if self.config["use_visible_objects"]:
view_layer = bpy.context.view_layer
if obj.name not in view_layer.objects:
Expand Down

0 comments on commit d7a2d5f

Please sign in to comment.