From 36954703544695bd12d8b90497fafaa1874c0fae Mon Sep 17 00:00:00 2001 From: pullusb Date: Tue, 3 Dec 2024 15:36:55 +0100 Subject: [PATCH] Fix problem in viz conflict check --- OP_file_checker.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/OP_file_checker.py b/OP_file_checker.py index c7d873b..415982d 100755 --- a/OP_file_checker.py +++ b/OP_file_checker.py @@ -600,22 +600,17 @@ class GPTB_OT_list_object_visibility_conflicts(bpy.types.Operator): bl_options = {"REGISTER"} visibility_items: CollectionProperty(type=GPTB_PG_object_visibility) # type: ignore[valid-type] - - ## options: - # check_viewlayer : BoolProperty(name="Check Viewlayer", default=False, description="Compare viewlayer (eye) visibility") - # check_viewport : BoolProperty(name="Check Viewport", default=False, description="Compare Viewport (screen icon) visibility") - # check_render : BoolProperty(name="Check Viewport", default=False, description="Compare Render visibility") def invoke(self, context, event): # Clear and rebuild both collections self.visibility_items.clear() # Store objects with conflicts - # objects_with_conflicts = [o for o in context.scene.objects if not (o.hide_get() == o.hide_viewport == o.hide_render)] - + ## TODO: Maybe better (but less detailed) to just check o.visible_get (global visiblity) against render viz ? + objects_with_conflicts = [o for o in context.scene.objects if not (o.hide_get() == o.hide_viewport == o.hide_render)] # Create visibility items in same order - for obj in context.scene.objects: # objects_with_conflicts + for obj in objects_with_conflicts: item = self.visibility_items.add() item.object_name = obj.name item["is_hidden"] = obj.hide_get() @@ -624,10 +619,6 @@ class GPTB_OT_list_object_visibility_conflicts(bpy.types.Operator): def draw(self, context): layout = self.layout - # row.prop(self, "check_viewlayer") - # row.prop(self, "check_viewport") - # row.prop(self, "check_render") - ## If filtered by prop, displayed list will resize while applying changes ! (not good) # Add sync buttons at the top row = layout.row(align=False) @@ -649,7 +640,7 @@ class GPTB_OT_list_object_visibility_conflicts(bpy.types.Operator): ## Viewlayer visibility "as prop" to allow slide toggle # hide_icon='HIDE_ON' if vis_item.is_hidden else 'HIDE_OFF' - hide_icon='HIDE_ON' if obj.hide_get() else 'HIDE_OFF' + hide_icon='HIDE_ON' if obj.hide_get() else 'HIDE_OFF' # based on object state row.prop(vis_item, "is_hidden", text="", icon=hide_icon, emboss=False) # Direct object properties