filename_ext = ".scene"
selected_only: bpy.props.BoolProperty(name="Selected objects only", description="Only export the selected objects")
- visible_collections: bpy.props.BoolProperty(name="Visible collections only", description="Only export objects in visible collections", default=True)
+ visible_only: bpy.props.BoolProperty(name="Visible only", description="Only export objects in visible collections", default=True)
resource_collection: bpy.props.BoolProperty(name="Resource collection", description="Put resources to a single collection file", default=True)
skip_existing: bpy.props.BoolProperty(name="Skip existing files", description="Skip resources that already exist as files", default=True)
def draw(self, context):
col = self.layout.column()
col.prop(self, "selected_only")
- col.prop(self, "visible_collections")
+ col.prop(self, "visible_only")
col.prop(self, "resource_collection")
if self.resource_collection:
col.prop(self, "skip_existing")
class SceneExporter:
def __init__(self):
self.selected_only = False
- self.visible_collections = True
+ self.visible_only = True
self.resource_collection = True
self.skip_existing = True
self.show_progress = True
objs = context.selected_objects
else:
objs = context.scene.objects
- if self.visible_collections:
+ if self.visible_only:
collections = [c.collection for c in context.view_layer.layer_collection.children if not (c.hide_viewport or c.collection.hide_viewport)]
objs = [o for o in objs if any((o.name in c.all_objects) for c in collections)]
objs = [o for o in objs if o.type=="MESH" and not o.lod_for_parent and o.data.vertices]