+ if self.selected_only:
+ objs = context.selected_objects
+ else:
+ objs = context.scene.objects
+ 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]