Skip to content

Commit

Permalink
excluded sharp-face attr from list: is only present in object mode
Browse files Browse the repository at this point in the history
  • Loading branch information
varkenvarken committed Nov 7, 2024
1 parent e492e56 commit c4e366d
Showing 1 changed file with 20 additions and 13 deletions.
33 changes: 20 additions & 13 deletions facemap_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit c4e366d

Please sign in to comment.