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 d153ca3cf6 - Show all commits

View File

@ -1,10 +1,12 @@
import bpy
from .vertex_group_operators import (
DeleteEmptyDeformGroups,
FocusDeformBones,
DeleteUnselectedDeformGroups,
DeleteUnusedVertexGroups,
CreateMirrorGroups,
FocusRogueDeformingWeights
)
class MESH_MT_vertex_group_batch_delete(bpy.types.Menu):
@ -27,8 +29,8 @@ class MESH_MT_vertex_group_batch_delete(bpy.types.Menu):
layout.operator(DeleteUnusedVertexGroups.bl_idname, text="Unused Non-Deform Groups", icon='BRUSH_DATA')
layout.operator(DeleteUnselectedDeformGroups.bl_idname, text="Unselected Deform Groups", icon='RESTRICT_SELECT_ON')
class MESH_MT_vertex_group_mirror(bpy.types.Menu):
bl_label = "Mirror"
class MESH_MT_vertex_group_symmetry(bpy.types.Menu):
bl_label = "Symmetry"
def draw(self, context):
layout = self.layout
@ -46,6 +48,10 @@ class MESH_MT_vertex_group_mirror(bpy.types.Menu):
icon='AUTOMERGE_ON'
).use_topology = True
layout.separator()
layout.operator(CreateMirrorGroups.bl_idname, icon='MOD_MIRROR')
class MESH_MT_vertex_group_sort(bpy.types.Menu):
bl_label = "Sort"
@ -104,17 +110,38 @@ class MESH_MT_vertex_group_weight(bpy.types.Menu):
icon='BRUSH_DATA',
text="Clean 0 Weights from All Groups"
).group_select_mode = 'ALL'
layout.separator()
layout.operator(
"object.vertex_group_remove_from",
icon='TRASH',
text="Remove All Verts from Selected Group"
).use_all_verts = True
layout.separator()
layout.operator(
'paint.weight_from_bones',
text="Assign Automatic from Bones",
icon='BONE_DATA'
).type='AUTOMATIC'
op = layout.operator(
'object.vertex_group_normalize_all',
text="Normalize Deform",
icon='IPO_SINE'
)
op.group_select_mode = 'BONE_DEFORM'
op.lock_active = False
layout.separator()
layout.operator(FocusRogueDeformingWeights.bl_idname, icon='ZOOM_IN')
def draw_misc(self, context):
layout = self.layout
layout.operator(FocusDeformBones.bl_idname, icon='ZOOM_IN')
layout.operator(CreateMirrorGroups.bl_idname, icon='MOD_MIRROR')
# TODO: Add an operator called "Smart Cleanup" that creates missing mirror groups,
# Cleans 0 weights,
# Deletes unused deforming groups,
@ -123,7 +150,7 @@ def draw_misc(self, context):
def draw_vertex_group_menu(self, context):
layout = self.layout
layout.row().menu(menu='MESH_MT_vertex_group_batch_delete', icon='TRASH')
layout.row().menu(menu='MESH_MT_vertex_group_mirror', icon='ARROW_LEFTRIGHT')
layout.row().menu(menu='MESH_MT_vertex_group_symmetry', icon='ARROW_LEFTRIGHT')
layout.row().menu(menu='MESH_MT_vertex_group_sort', icon='SORTALPHA')
layout.row().menu(menu='MESH_MT_vertex_group_copy', icon='DUPLICATE')
layout.row().menu(menu='MESH_MT_vertex_group_lock', icon='LOCKED')
@ -131,7 +158,7 @@ def draw_vertex_group_menu(self, context):
classes = [
MESH_MT_vertex_group_batch_delete,
MESH_MT_vertex_group_mirror,
MESH_MT_vertex_group_symmetry,
MESH_MT_vertex_group_sort,
MESH_MT_vertex_group_copy,
MESH_MT_vertex_group_lock,