Skip to main content
Bumped by Community user
Bumped by Community user
grammar, formatting, tags, title
Source Link
Ray Mairlot
  • 29.4k
  • 12
  • 105
  • 126

How can I rename Scripts for bones that have certain prefixes in their names in a script?

iI have a script made for 3dsmax that renamerenames bones in batch like this:

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth, how. How can iI make the same for blender  ?_ Does anybody have something working, so iI can just change the name of the bones, and press run script :)'Run Script'?

Because as far as iI can do, it only change exact names and not part of the name, this is what iI've got ( import bpy context = bpy.context obj = context.object:

namelist = [("Bip01_", "")]

import bpy
context = bpy.context
obj = context.object

namelist = [("Bip01_", "")]

for name, newname in namelist:
    # get the pose bone with name
    pb = obj.pose.bones.get(name)
    # continue if no bone of that name
    if pb is None:
        continue
    # rename
    pb.name = newname

for name, newname in namelist: # get the pose bone with name pb = obj.pose.bones.get(name) # continue if no bone of that name if pb is None: continue # rename pb.name = newname ) What iWhat I would like that script to do is change ALL Bip01_'Bip01_' for nothing, like deleting a prefix :)

Thanks!.

rename Scripts for bones

i have a script made for 3dsmax that rename bones in batch like this

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth, how can i make the same for blender  ?_ anybody have something working, so i can just change the name of the bones, and press run script :)

Because as far as i can do, it only change exact names and not part of the name, this is what i got ( import bpy context = bpy.context obj = context.object

namelist = [("Bip01_", "")]

for name, newname in namelist: # get the pose bone with name pb = obj.pose.bones.get(name) # continue if no bone of that name if pb is None: continue # rename pb.name = newname ) What i would like that script to do is change ALL Bip01_ for nothing, like deleting a prefix :)

Thanks!

How can I rename bones that have certain prefixes in their names in a script?

I have a script made for 3dsmax that renames bones in batch like this:

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth. How can I make the same for blender? Does anybody have something working, so I can just change the name of the bones, and press 'Run Script'?

Because as far as I can do, it only change exact names and not part of the name, this is what I've got:

import bpy
context = bpy.context
obj = context.object

namelist = [("Bip01_", "")]

for name, newname in namelist:
    # get the pose bone with name
    pb = obj.pose.bones.get(name)
    # continue if no bone of that name
    if pb is None:
        continue
    # rename
    pb.name = newname

What I would like that script to do is change ALL 'Bip01_' for nothing, like deleting a prefix.

added 514 characters in body
Source Link

i have a script made for 3dsmax that rename bones in batch like this

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth, how can i make the same for blender ?_ anybody have something working, so i can just change the name of the bones, and press run script :)

Because as far as i can do, it only change exact names and not part of the name, this is what i got Thanks( import bpy context = bpy.context obj = context.object

namelist = [("Bip01_", "")]

for name, newname in namelist: # get the pose bone with name pb = obj.pose.bones.get(name) # continue if no bone of that name if pb is None: continue # rename pb.name = newname ) What i would like that script to do is change ALL Bip01_ for nothing, like deleting a prefix :)

Thanks!

i have a script made for 3dsmax that rename bones in batch like this

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth, how can i make the same for blender ?_ anybody have something working, so i can just change the name of the bones, and press run script :) Thanks!

i have a script made for 3dsmax that rename bones in batch like this

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth, how can i make the same for blender ?_ anybody have something working, so i can just change the name of the bones, and press run script :)

Because as far as i can do, it only change exact names and not part of the name, this is what i got ( import bpy context = bpy.context obj = context.object

namelist = [("Bip01_", "")]

for name, newname in namelist: # get the pose bone with name pb = obj.pose.bones.get(name) # continue if no bone of that name if pb is None: continue # rename pb.name = newname ) What i would like that script to do is change ALL Bip01_ for nothing, like deleting a prefix :)

Thanks!

Source Link

rename Scripts for bones

i have a script made for 3dsmax that rename bones in batch like this

( local nameMap = #( \

    dataPair "Bip01_" "",
    dataPair "Neck01" "Neck",
    dataPair "phy_anchor_Skirt_00" "Pelvis",

And so on and so forth, how can i make the same for blender ?_ anybody have something working, so i can just change the name of the bones, and press run script :) Thanks!