0

I'm using Mixamo's website to auto-rig some characters.

When I import the character back to 3DSMAX, all bones are going to be imported with mixamo's naming pattern, something like:

mixamo:head
mixamo:neck
mixamo:lefthand

I must rename them to a custom pattern that I'll choose, like:

bip01_hat_attachment
bip01_neck
bip01_Lhand

Could someone provide a working 3DSMAX 2011 script to find, select and replace the name of specific bones?

Thanks in advance!

-------------------------------------------------------------------

@Rotem

I've implemented your script, but only the first bone changes it's name. I've also forgotten to mention that I'm actually using dummies, not bones (don't know if it makes any difference)

Here's my complete code (running on 3DSMAX 2011):

Sample.fbx with the named bones: http://www.mediafire.com/download/1o5ci5cj254ksrj/sample.FBX

(
local fromPrefix = "mixamorig:"
local toPrefix = "Bip01_"

local nameMap = #( \
    dataPair "Hips" "Pelvis", 
        dataPair "Spine" "Spine",
            dataPair "Spine1" "Spine1",
                dataPair "Spine2" "Spine2", 
                    dataPair "Neck" "Neck",
                        dataPair "Head" "Head",
                            dataPair "HeadTop_End" "HeadTop_End",
                        dataPair "LeftShoulder" "L_Clavicle",       
                            dataPair "LeftArm" "L_UpperArm",
                                dataPair "LeftForeArm" "L_Forearm",     
                                    dataPair "LeftHand" "L_Hand",
                                        dataPair "LeftHandThumb1" "L_Finger0",      
                                        dataPair "LeftHandThumb2" "L_Finger01",
                                        dataPair "LeftHandThumb3" "L_Finger02",     
                                        dataPair "LeftHandThumb4" "L_Finger03",
                                        dataPair "LeftHandIndex1" "L_Finger1",      
                                        dataPair "LeftHandIndex2" "L_Finger11",
                                        dataPair "LeftHandIndex3" "L_Finger12",
                                        dataPair "LeftHandIndex4" "L_Finger13",
                                        dataPair "LeftHandMiddle1" "L_Finger2",
                                        dataPair "LeftHandMiddle2" "L_Finger21",
                                        dataPair "LeftHandMiddle3" "L_Finger22",
                                        dataPair "LeftHandMiddle4" "L_Finger23",
                                        dataPair "LeftHandRing1" "L_Finger3",
                                        dataPair "LeftHandRing2" "L_Finger31",
                                        dataPair "LeftHandRing3" "L_Finger32",
                                        dataPair "LeftHandRing4" "L_Finger33",
                                        dataPair "LeftHandPinky1" "L_Finger4",
                                        dataPair "LeftHandPinky2" "L_Finger41",
                                        dataPair "LeftHandPinky3" "L_Finger42",
                                        dataPair "LeftHandPinky4" "L_Finger43",
                        dataPair "RightShoulder" "R_Clavicle",      
                            dataPair "RightArm" "R_UpperArm",
                                dataPair "RightForeArm" "R_Forearm",        
                                    dataPair "RightHand" "R_Hand",
                                        dataPair "RightHandThumb1" "R_Finger0",     
                                        dataPair "RightHandThumb2" "R_Finger01",
                                        dataPair "RightHandThumb3" "R_Finger02",        
                                        dataPair "RightHandThumb4" "R_Finger03",
                                        dataPair "RightHandIndex1" "R_Finger1",     
                                        dataPair "RightHandIndex2" "R_Finger11",
                                        dataPair "RightHandIndex3" "R_Finger12",
                                        dataPair "RightHandIndex4" "R_Finger13",
                                        dataPair "RightHandMiddle1" "R_Finger2",
                                        dataPair "RightHandMiddle2" "R_Finger21",
                                        dataPair "RightHandMiddle3" "R_Finger22",
                                        dataPair "RightHandMiddle4" "R_Finger23",
                                        dataPair "RightHandRing1" "R_Finger3",
                                        dataPair "RightHandRing2" "R_Finger31",
                                        dataPair "RightHandRing3" "R_Finger32",
                                        dataPair "RightHandRing4" "R_Finger33",
                                        dataPair "RightHandPinky1" "R_Finger4",
                                        dataPair "RightHandPinky2" "R_Finger41",
                                        dataPair "RightHandPinky3" "R_Finger42",
                                        dataPair "RightHandPinky4" "R_Finger43",
            dataPair "LeftUpLeg" "L_Thigh",
                dataPair "LeftLeg" "L_Calf",
                    dataPair "LeftFoot" "L_Foot",
                        dataPair "LeftToeBase" "L_Toe0",
                            dataPair "LeftToe_End" "L_Toe0_End",
            dataPair "RightUpLeg" "R_Thigh",
                dataPair "RightLeg" "R_Calf",
                    dataPair "RightFoot" "R_Foot",
                        dataPair "RightToeBase" "R_Toe0",
                            dataPair "RightToe_End" "R_Toe0_End"
)

for namePair in nameMap do
(
    local fromName = fromPrefix + namePair.v1
    for o in getNodebyName fromName all:on do 
    (
        o.name = toPrefix + namePair.v2
    )       
)

)

What could be the problem?

3
  • To clarify, you want to rename all objects with a name like mixamo:foo to bip01:foo?
    – Rotem
    May 17, 2016 at 6:02
  • @Rotem thanks for your reply. No, I don't want a simple prefix replacement. All bones must be renamed to a custom one. For exemple: mixamo:left_foot to bip01_Lfoot and mixamo:neck to bip01_neck_special_effects_attachment
    – Cami
    May 17, 2016 at 17:56
  • @Rotem I've also editted the question with more exemples.
    – Cami
    May 17, 2016 at 18:08

1 Answer 1

0

From your question and the comments I understand that you wish to provide a custom mapping of object names.

You can use this code to supply such a mapping. I've used the two examples from your comment.

By not including the prefixes in the mappings, you can easily change them.

(
    local fromPrefix = "mixamo:"
    local toPrefix = "bip01_"

    local nameMap = #( \
        dataPair "left_foot" "Lfoot", 
        dataPair "neck" "neck_special_effects_attachment" 
        -- add more mappings here 
    )

    for namePair in nameMap do
    (
        local fromName = fromPrefix + namePair.v1
        for o in getNodebyName fromName all:on do 
        (
            o.name = toPrefix + namePair.v2
        )       
    )
)
6
  • Please check the edit I've made on the original question. The script is only working on the first bone. Thanks!
    – Cami
    May 18, 2016 at 1:43
  • @asd Works fine for me with your sample FBX. Do you get any error in the listener?
    – Rotem
    May 18, 2016 at 6:25
  • you're right, it works fine on the sample... however it is not working on the rigged model. This time I'm uploading the same .FBX that I'm working with... mediafire.com/download/y1dlr627p8isf6c/2_Rigged.fbx
    – Cami
    May 18, 2016 at 12:32
  • @asd Also works fine for me. I'll ask again, are there any errors in the listener?
    – Rotem
    May 18, 2016 at 12:35
  • I've no idea of what happened, but I've just tried and it worked! Thanks again!
    – Cami
    May 18, 2016 at 23:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.