Select multiple mesh then change there armature

Issue #1660 invalid
bouich jules created an issue

Hi!

I don’t know if this enhancement exist or no, but it’s something super usefull, for exemple let’s have you have different multiple object and you want change there armature, instead of go manually and do it in the object and armature properties we could do it in 1 click!
just sayin'

thank you!

Comments (4)

  1. bouich jules reporter

    i asked chatgpt:

    import bpy
    
    # Specify the new name
    new_name = "Victoria 9 HD"
    armature_obj = None
    
    # Find the armature object in the scene
    for obj in bpy.data.objects:
        if obj.type == 'ARMATURE':
            armature_obj = obj
            break
    
    # Check if an armature was found
    if not armature_obj:
        print("No armature found in the scene.")
    else:
        # Rename the armature
        armature_obj.name = new_name
    
        # Change the parent of all mesh objects to the armature
        for obj in bpy.data.objects:
            if obj.type == 'MESH':
                obj.parent = armature_obj
    
                # Iterate through all modifiers of the object
                for modifier in obj.modifiers:
                    # Check if the modifier is an Armature modifier
                    if modifier.type == 'ARMATURE':
                        # Set the object of the modifier to the armature and rename the modifier
                        modifier.object = armature_obj
                        modifier.name = new_name
    

    It works perfect it change the armature to “ Victoria 9HD” for all the mesh.

    Anyway please feel free to implement, close or tag as invalid.

    thank you!

  2. Log in to comment