class SceneExporter:
def __init__(self):
self.selected_only = False
- self.active_layers = True
+ self.visible_collections = True
self.resource_collection = True
self.skip_existing = True
self.show_progress = True
objs = context.selected_objects
else:
objs = context.scene.objects
- if self.active_layers:
- layers = context.scene.layers
- objs = [o for o in objs if any(a and b for a, b in zip(layers, o.layers))]
+ if self.visible_collections:
+ 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]
objs = [o for o in objs if (not o.compound or o.parent not in objs)]
objs.sort(key=lambda x:x.name)