Skip to content

Commit

Permalink
merged PR from aleichter
Browse files Browse the repository at this point in the history
  • Loading branch information
varkenvarken committed Dec 30, 2023
1 parent ae1b08b commit b320ed5
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions facemap_select.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

bl_info = {
"name": "FacemapSelect",
"author": "Michel Anders (varkenvarken)",
"version": (0, 0, 20231014152157),
"author": "Michel Anders (varkenvarken) with contribution from Andrew Leichter (aleichter)",
"version": (0, 0, 20231230140402),
"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 All @@ -39,10 +39,13 @@

import bpy


class FacemapSelect(bpy.types.Operator):
bl_idname = "mesh.facemap_select"
bl_label = "FacemapSelect"
bl_description = "Select faces based on active facemap"
bl_description = (
"Select faces based on active facemap (+ Shift add to current selection)"
)
bl_options = {"REGISTER", "UNDO"}

@classmethod
Expand All @@ -64,18 +67,23 @@ def execute(self, context):
context.active_object.data.polygons,
context.active_object.data.attributes[attribute_name].data,
):
polygon.select = facemap_attribute.value
polygon.select |= (
facemap_attribute.value
) # keeps polygons selected that already were
bpy.ops.object.editmode_toggle()
return {"FINISHED"}

def invoke(self, context, event):
self.__shift = event.shift
return self.execute(context)


class FacemapCreate(bpy.types.Operator):
bl_idname = "mesh.facemap_create"
bl_label = "FacemapCreate"
bl_description = "Create a new boolean face map and set value according to current selection"
bl_description = (
"Create a new boolean face map and set value according to current selection"
)
bl_options = {"REGISTER", "UNDO"}

@classmethod
Expand Down

0 comments on commit b320ed5

Please sign in to comment.