From: Mikko Rasa Date: Thu, 15 Apr 2021 17:44:27 +0000 (+0300) Subject: Rename visible_collections to visible_only X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=814b21ea340f17321658c4ab41e1692bea7d5198;p=libs%2Fgl.git Rename visible_collections to visible_only It was kinda confusing when there's also collection files. --- diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index 8de91d25..13375e24 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -111,7 +111,7 @@ class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase): 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) @@ -122,7 +122,7 @@ class ExportMspGLScene(bpy.types.Operator, ExportMspGLBase): 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") diff --git a/blender/io_mspgl/export_scene.py b/blender/io_mspgl/export_scene.py index 1dea4b24..9590fc17 100644 --- a/blender/io_mspgl/export_scene.py +++ b/blender/io_mspgl/export_scene.py @@ -4,7 +4,7 @@ import os 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 @@ -14,7 +14,7 @@ class SceneExporter: 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]