Rename all shapes from related bones name

This commit is contained in:
florentin.luce 2025-06-10 15:43:44 +02:00
parent 7d2216bc3b
commit fbdd994d67

View File

@ -60,16 +60,16 @@ class RP_OT_create_shape(Operator):
class RP_OT_name_from_bone(Operator): class RP_OT_name_from_bone(Operator):
bl_label = 'Name Shape from selected bones' bl_label = 'Name Shape from selected bones'
bl_idname = 'rigpicker.name_from_bone' bl_idname = 'rigpicker.name_from_bone'
bl_description = 'Rename all shapes from related bones name'
#bl_options = {'REGISTER', 'UNDO'} #bl_options = {'REGISTER', 'UNDO'}
def execute(self,context): def execute(self,context):
col = get_picker_collection(context.object)
rig = col.rig_picker.rig
bone = rig.data.bones.active
if bone: col = get_picker_collection(context.object)
context.object.name = bone.name
context.object.rig_picker.name = bone.name for ob in col.all_objects:
if ob.rig_picker.shape_type == 'BONE':
ob.name = ob.rig_picker.name
return {'FINISHED'} return {'FINISHED'}