Dieton

remove_word_from_all_bones_in_armeture.py

Aug 15th, 2026
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.58 KB | Gaming | 0 0
  1. import bpy
  2.  
  3. prefix = "Remove_This_Word_From_Bones"
  4.  
  5. # Find the armature in the scene
  6. armature = None
  7. for obj in bpy.data.objects:
  8.     if obj.type == 'ARMATURE':
  9.         armature = obj
  10.         break
  11.  
  12. if armature is None:
  13.     print("No armature found.")
  14. else:
  15.     print("=== Renaming Bones in:", armature.name, "===")
  16.  
  17.     for bone in armature.data.bones:
  18.         old = bone.name
  19.         if old.startswith(prefix):
  20.             new = old[len(prefix):]  # remove the prefix
  21.             bone.name = new
  22.             print(f"{old}  -->  {new}")
  23.  
  24.     print("=== Done ===")
  25.  
Advertisement
Add Comment
Please, Sign In to add comment