Add Easy_Weight to Addons #47

Merged
Nick Alberelli merged 48 commits from feature/easy_weights into main 2023-05-17 22:13:57 +02:00
Showing only changes of commit b16c151ac9 - Show all commits

View File

@ -73,8 +73,9 @@ class DeleteEmptyDeformGroups(Operator):
def poll(cls, context):
obj = context.object
ob_is_mesh = obj and obj.type=='MESH'
if not ob_is_mesh: return False
ob_has_arm_mod = 'ARMATURE' in (m.type for m in obj.modifiers)
return all((ob_is_mesh, obj.vertex_groups, ob_has_arm_mod))
return obj.vertex_groups and ob_has_arm_mod
def execute(self, context):
empty_groups = get_empty_deforming_vgroups(context.object)
@ -208,8 +209,9 @@ class DeleteUnusedVertexGroups(Operator):
def poll(cls, context):
obj = context.object
ob_is_mesh = obj and obj.type=='MESH'
if not ob_is_mesh: return False
ob_has_groups = len(obj.vertex_groups) > 0
return all((ob_is_mesh, ob_has_groups))
return ob_has_groups
def execute(self, context):
deleted_names = delete_unused_vgroups(context.object)
@ -228,9 +230,10 @@ class CreateMirrorGroups(Operator):
def poll(cls, context):
obj = context.object
ob_is_mesh = obj and obj.type=='MESH'
if not ob_is_mesh: return False
ob_has_arm_mod = 'ARMATURE' in (m.type for m in obj.modifiers)
ob_has_mirror_mod = 'MIRROR' in (m.type for m in obj.modifiers)
return all((ob_is_mesh, obj.vertex_groups, ob_has_arm_mod, ob_has_mirror_mod))
return obj.vertex_groups and ob_has_arm_mod and ob_has_mirror_mod
def execute(self, context):
obj = context.object