Page Menu
Home
Search
Configure Global Search
Log In
Files
F10303
properties_data_modifier.patch
Public
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Rasmus Petersen (yoff)
Nov 13 2013, 2:12 PM
Size
1 KB
Subscribers
None
properties_data_modifier.patch
View Options
418a419
> col.operator("mirror.mirror_vertex_groups", text="Mirror Vertex Groups")
769a771,794
> class DATA_OT_mirror_vertex_groups(bpy.types.Operator):
> '''Generates empty mirrored vertex groups'''
>
> bl_idname = "mirror.mirror_vertex_groups"
> bl_label = "Mirror vertex groups"
>
> def invoke(self, context, event):
> vgs = context.object.vertex_groups
> vg_names = vgs.keys()
> for vg_name in vg_names:
> vg_name_side = vg_name.rsplit('.', 1)
> if len(vg_name_side) > 1:
> mirror_name = vg_name_side[0]
> if vg_name_side[1] == 'R':
> mirror_name += '.L'
> if vg_name_side[1] == 'L':
> mirror_name += '.R'
> if mirror_name not in vg_names:
> bpy.ops.object.vertex_group_add()
> vgs[-1].name = mirror_name
> print('Created vertex group ' + mirror_name)
> return{'FINISHED'}
>
>
771c796,797
< DATA_PT_modifiers]
---
> DATA_PT_modifiers,
> DATA_OT_mirror_vertex_groups]
File Metadata
Details
Mime Type
text/x-python
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
7d/ec/ef7e0bb9b39275861c1212cf1772
Event Timeline
Log In to Comment