From c4e366d920834b25918c599ee20e60724eee888f Mon Sep 17 00:00:00 2001 From: varkenvarken Date: Thu, 7 Nov 2024 14:26:54 +0100 Subject: [PATCH] excluded sharp-face attr from list: is only present in object mode --- facemap_select.py | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/facemap_select.py b/facemap_select.py index 91b346a..125379b 100644 --- a/facemap_select.py +++ b/facemap_select.py @@ -27,7 +27,7 @@ bl_info = { "name": "FacemapSelect", "author": "Michel Anders (varkenvarken) with contribution from Andrew Leichter (aleichter) and Tyo79", - "version": (0, 0, 20241107140453), + "version": (0, 0, 20241107141318), "blender": (4, 0, 0), "location": "Edit mode 3d-view, Select- -> From facemap | Create facemap", "description": "Select faces based on the active boolean facemap or create a new facemap", @@ -109,10 +109,8 @@ def execute(self, context): class FacemapAssign(bpy.types.Operator): bl_idname = "mesh.facemap_assign" bl_label = "FacemapAssign" - bl_description = ( - "Assign or remove faces from the active facemap" - ) - + bl_description = "Assign or remove faces from the active facemap" + param: bpy.props.StringProperty() @classmethod @@ -144,9 +142,7 @@ def execute(self, context): class FacemapSelections(bpy.types.Operator): bl_idname = "mesh.facemap_selections" bl_label = "Facemap Selections" - bl_description = ( - "Select or deselect faces marked in the active facemap" - ) + bl_description = "Select or deselect faces marked in the active facemap" param: bpy.props.StringProperty() @classmethod @@ -203,7 +199,10 @@ def filter_items(self, context, data, propname): flt_flags = [ ( self.bitflag_filter_item - if item.domain == "FACE" and item.data_type == "BOOLEAN" + if item.domain == "FACE" + and item.data_type == "BOOLEAN" + and not item.is_internal + and item.name != "sharp_face" else 0 ) for item in items @@ -244,8 +243,6 @@ class DATA_PT_face_maps(Panel): "BLENDER_WORKBENCH_NEXT", } - # param: bpy.props.StringProperty() - @classmethod def poll(cls, context): obj = context.object @@ -258,7 +255,14 @@ def draw(self, context): mesh = context.mesh attributes = context.object.data.attributes - face_maps = [att for att in attributes if att.name.startswith("FaceMap")] + face_maps = [ + att + for att in attributes + if att.domain == "FACE" + and att.data_type == "BOOLEAN" + and not att.is_internal + and att.name != "sharp_face" + ] facemap = mesh.attributes.active rows = 2 @@ -284,7 +288,10 @@ def draw(self, context): row = layout.row() sub = row.row(align=True) - sub.operator("mesh.facemap_assign", text="Assign", ).param = "Assign" + sub.operator( + "mesh.facemap_assign", + text="Assign", + ).param = "Assign" sub.operator("mesh.facemap_assign", text="Remove").param = "Remove" sub = row.row(align=True)