Add Easy_Weight
to Addons
#47
@ -1,10 +1,12 @@
|
|||||||
import bpy
|
import bpy
|
||||||
|
|
||||||
from .vertex_group_operators import (
|
from .vertex_group_operators import (
|
||||||
DeleteEmptyDeformGroups,
|
DeleteEmptyDeformGroups,
|
||||||
FocusDeformBones,
|
FocusDeformBones,
|
||||||
DeleteUnselectedDeformGroups,
|
DeleteUnselectedDeformGroups,
|
||||||
DeleteUnusedVertexGroups,
|
DeleteUnusedVertexGroups,
|
||||||
CreateMirrorGroups,
|
CreateMirrorGroups,
|
||||||
|
FocusRogueDeformingWeights
|
||||||
)
|
)
|
||||||
|
|
||||||
class MESH_MT_vertex_group_batch_delete(bpy.types.Menu):
|
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(DeleteUnusedVertexGroups.bl_idname, text="Unused Non-Deform Groups", icon='BRUSH_DATA')
|
||||||
layout.operator(DeleteUnselectedDeformGroups.bl_idname, text="Unselected Deform Groups", icon='RESTRICT_SELECT_ON')
|
layout.operator(DeleteUnselectedDeformGroups.bl_idname, text="Unselected Deform Groups", icon='RESTRICT_SELECT_ON')
|
||||||
|
|
||||||
class MESH_MT_vertex_group_mirror(bpy.types.Menu):
|
class MESH_MT_vertex_group_symmetry(bpy.types.Menu):
|
||||||
bl_label = "Mirror"
|
bl_label = "Symmetry"
|
||||||
|
|
||||||
def draw(self, context):
|
def draw(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
@ -46,6 +48,10 @@ class MESH_MT_vertex_group_mirror(bpy.types.Menu):
|
|||||||
icon='AUTOMERGE_ON'
|
icon='AUTOMERGE_ON'
|
||||||
).use_topology = True
|
).use_topology = True
|
||||||
|
|
||||||
|
layout.separator()
|
||||||
|
|
||||||
|
layout.operator(CreateMirrorGroups.bl_idname, icon='MOD_MIRROR')
|
||||||
|
|
||||||
class MESH_MT_vertex_group_sort(bpy.types.Menu):
|
class MESH_MT_vertex_group_sort(bpy.types.Menu):
|
||||||
bl_label = "Sort"
|
bl_label = "Sort"
|
||||||
|
|
||||||
@ -104,17 +110,38 @@ class MESH_MT_vertex_group_weight(bpy.types.Menu):
|
|||||||
icon='BRUSH_DATA',
|
icon='BRUSH_DATA',
|
||||||
text="Clean 0 Weights from All Groups"
|
text="Clean 0 Weights from All Groups"
|
||||||
).group_select_mode = 'ALL'
|
).group_select_mode = 'ALL'
|
||||||
|
|
||||||
layout.separator()
|
layout.separator()
|
||||||
|
|
||||||
layout.operator(
|
layout.operator(
|
||||||
"object.vertex_group_remove_from",
|
"object.vertex_group_remove_from",
|
||||||
icon='TRASH',
|
icon='TRASH',
|
||||||
text="Remove All Verts from Selected Group"
|
text="Remove All Verts from Selected Group"
|
||||||
).use_all_verts = True
|
).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):
|
def draw_misc(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.operator(FocusDeformBones.bl_idname, icon='ZOOM_IN')
|
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,
|
# TODO: Add an operator called "Smart Cleanup" that creates missing mirror groups,
|
||||||
# Cleans 0 weights,
|
# Cleans 0 weights,
|
||||||
# Deletes unused deforming groups,
|
# Deletes unused deforming groups,
|
||||||
@ -123,7 +150,7 @@ def draw_misc(self, context):
|
|||||||
def draw_vertex_group_menu(self, context):
|
def draw_vertex_group_menu(self, context):
|
||||||
layout = self.layout
|
layout = self.layout
|
||||||
layout.row().menu(menu='MESH_MT_vertex_group_batch_delete', icon='TRASH')
|
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_sort', icon='SORTALPHA')
|
||||||
layout.row().menu(menu='MESH_MT_vertex_group_copy', icon='DUPLICATE')
|
layout.row().menu(menu='MESH_MT_vertex_group_copy', icon='DUPLICATE')
|
||||||
layout.row().menu(menu='MESH_MT_vertex_group_lock', icon='LOCKED')
|
layout.row().menu(menu='MESH_MT_vertex_group_lock', icon='LOCKED')
|
||||||
@ -131,7 +158,7 @@ def draw_vertex_group_menu(self, context):
|
|||||||
|
|
||||||
classes = [
|
classes = [
|
||||||
MESH_MT_vertex_group_batch_delete,
|
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_sort,
|
||||||
MESH_MT_vertex_group_copy,
|
MESH_MT_vertex_group_copy,
|
||||||
MESH_MT_vertex_group_lock,
|
MESH_MT_vertex_group_lock,
|
||||||
|
Loading…
Reference in New Issue
Block a user