Skip to content

Commit

Permalink
Merge pull request godotengine#366 from xphlawlessx/master
Browse files Browse the repository at this point in the history
Added export option for excluding objects hidden during rendering.
  • Loading branch information
Jason0214 committed Nov 1, 2020
2 parents e6d1f49 + d7a2d5f commit 61e55f2
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 61e55f2

Please sign in to comment.