[question] rigging

I use this figure called Genesis 2 by Daz Studio

the 2 figures I use to craft my character are nice, but something seems off to me, but I’m not sure

the feet/toes only have 1 bone each

There is 1 bone that controls the bend of all 5 toes at once, and another bone that controls the bend of the toes individually, but there isn’t a 2nd bone to control the bend of the joiny in the toes?

Is this a common rig setup for realistic human figures?

The character rig is pretty nice ive brought some of those daz/poser models in UE4 in the past but theyre pretty bulky… Remove any joints u dont need and do a reskin. Ive built a small script you can use to rename the joints to standard motion builder naming convention for sinple retargeting ill find shortly. To fix all the issues with multiple texture maps that may exist on your model, bring the model into zbrush and convert texture to polypaint, then adjust the uv maps on the mesh and then apply the polypaint back to texture, just a tip.

no doubt it’s better than their Gen5 figure Genesis 1 (that figure did not have a long market life span), but it just seems weird to me that the toe joint isn’t rigged

Here is the simple renaming script, adjust as needed. Yeah I noticed that the foot bones are strange you can probably just rebuild that section and reimport the skinweights.



//----------------------------------------------------------------------------------------------
// Renaming Poser file to a naming convention that can be retargeted
//----------------------------------------------------------------------------------------------
DoRenamePoserFile();

global proc DoRenamePoserFile(){
    //Base
    RenameMesh("Genesis2Female", "Character1_Reference");
    RenameMesh("hip", "Hips");
    
    //Legs
    RenameMesh("lThigh", "LeftUpLeg");
    RenameMesh("lShin", "LeftLeg");
    RenameMesh("lFoot", "LeftFoot");
    RenameMesh("lToe", "LeftToeBase");

    RenameMesh("rThigh", "RightUpLeg");
    RenameMesh("rShin", "RightLeg");
    RenameMesh("rFoot", "RightFoot");
    RenameMesh("rToe", "RightToeBase");
    
    //Chest
    RenameMesh("abdomen", "Spine");
    RenameMesh("abdomen2", "Spine1");
    RenameMesh("chest", "Spine2");
    
    //Arms
    RenameMesh("rCollar", "RightShoulder");
    RenameMesh("rShldr", "RightArm");
    RenameMesh("rForeArm", "RightForeArm");
    RenameMesh("rHand", "RightHand");
    
    RenameMesh("lCollar", "LeftShoulder");
    RenameMesh("lShldr", "LeftArm");
    RenameMesh("lForeArm", "LeftForeArm");
    RenameMesh("lHand", "LeftHand");
    
    //Hands
    RenameMesh("rThumb1", "RightHandThumb1");
    RenameMesh("rThumb2", "RightHandThumb2");
    RenameMesh("rThumb3", "RightHandThumb3");
    
    RenameMesh("rIndex1", "RightHandIndex1");
    RenameMesh("rIndex2", "RightHandIndex2");
    RenameMesh("rIndex3", "RightHandIndex3");
    
    RenameMesh("rMid1", "RightHandMiddle1");
    RenameMesh("rMid2", "RightHandMiddle2");
    RenameMesh("rMid3", "RightHandMiddle3");
    
    RenameMesh("rRing1", "RightHandRing1");
    RenameMesh("rRing2", "RightHandRing2");
    RenameMesh("rRing3", "RightHandRing3");
    
    RenameMesh("rPinky1", "RightHandPinky1");
    RenameMesh("rPinky2", "RightHandPinky2");
    RenameMesh("rPinky3", "RightHandPinky3");
    
    //------------------------------------------
    
    RenameMesh("lThumb1", "LeftHandThumb1");
    RenameMesh("lThumb2", "LeftHandThumb2");
    RenameMesh("lThumb3", "LeftHandThumb3");
    
    RenameMesh("lIndex1", "LeftHandIndex1");
    RenameMesh("lIndex2", "LeftHandIndex2");
    RenameMesh("lIndex3", "LeftHandIndex3");
    
    RenameMesh("lMid1", "LeftHandMiddle1");
    RenameMesh("lMid2", "LeftHandMiddle2");
    RenameMesh("lMid3", "LeftandMiddle3");
    
    RenameMesh("lRing1", "LeftHandRing1");
    RenameMesh("lRing2", "LeftHandRing2");
    RenameMesh("lRing3", "LeftHandRing3");
    
    RenameMesh("lPinky1", "LeftHandPinky1");
    RenameMesh("lPinky2", "LeftHandPinky2");
    RenameMesh("lPinky3", "LeftHandPinky3");
    
    
    //Feet
    RenameMesh("lBigToe", "LeftFootThumb1");
    RenameMesh("lSmallToe1", "LeftFootIndex1");
    RenameMesh("lSmallToe2", "LeftFootMiddle1");
    RenameMesh("lSmallToe3", "LeftFootRing1");
    RenameMesh("lSmallToe4", "LeftFootPinky1");
    
    RenameMesh("rBigToe", "RightFootThumb1");
    RenameMesh("rSmallToe1", "RightFootIndex1");
    RenameMesh("rSmallToe2", "RightFootMiddle1");
    RenameMesh("rSmallToe3", "RightFootRing1");
    RenameMesh("rSmallToe4", "RightFootPinky1");
}

global proc RenameMesh(string $objName, string $renameTo){
    if( `objExists $objName` ) {
        select -r $objName;
        rename $renameTo;
    } 
}




not sure I can…well, I could, but I’m not sure if I can just update the current model or if it would render the morphs built for the figure to become useless

I’ll build a script for that then, all that would need to get done is automatically go through each blendshape one by one and set their max value to 1, then duplicate the base mesh each time to create all the blendshapes. After all the blendshape meshes are created you will be able to reapply them after you reskin the model. Also you probably won’t be able to reskin the model correctly in it’s current state with overlapping UV’s which is why taking the mesh into zbrush to project the texture onto polypaint and adjust the uvs so they are non overlapping is a good idea. Of course this too is not so simple being that you need to break up your mesh into uv sets like so How to import multi uv texture to Zbrush - YouTube . After all the meshes have been broken down into uv sets with their appropriate textures applied, you can project the texture onto the base mesh with the corrected UV maps with the correct seams that you like. After this is done you can reapply the blendshapes and you’ll have a single texture, single mesh that you can unskin and reskin as many times as you need. I’m currently finishing something up but I’ll make the script soon.

Here is the script I made hope it’s useful for you. I’ll test it on the genesis 2 model tomorrow also. Run ExtractAllBlendshapes() when the model is selected that you want to extract the blendshapes from.




global proc ExtractAllBlendshapes()
{
    string $SelectedObjects] = `ls -sl`;

    //Loop through every selected object
    for ($curObject in $SelectedObjects)
    {

        print ("Selected Object: " + $curObject + "
");
                                                                  
        //Get the shape node as it's the one with the blend shape attached
        string $Shapes] = `listRelatives -children -shapes $curObject`;

        //Loop through every shape
        for ($curShape in $Shapes)
        {
            print ("CurShape: " + $curShape + "
");

            // Get the blend shape deformer attached to the mesh
            string $AllBlendshapes] =` listConnections -type "blendShape" $curShape`;


            for($blendShape in  $AllBlendshapes)
            {
            
                print ("BlendShape: " + $blendShape + "
");


                //Skip any blendshapes that don't have the data we need
                if ("parallelBlender" != $blendShape)  
                {
                    //Get list of all blendshapes
                    string $BlendAttributes] = `listAttr -m ($blendShape + ".w")`;
    
    
                    //Loop through all shapes first and set their value to 0
                    for ($attr in $BlendAttributes)
                    {
                        setAttr ($blendShape + "." + $attr ) 0;
                    }
    
    
                    //Start the process of extracting meshes from the blendshape attributes
                    for ($attr in $BlendAttributes)
                    {
                        //Get the blendshape attribute
                        print ("Attribute: "+ $attr + "
");


                        //Set the attribute value to 1 and duplicate base mesh, rename mesh to attribute name
                        setAttr ($blendShape + "." + $attr ) 1;
                        CreateBlendMesh( $attr );
    
                        //Set the blendshape value back to 0
                        setAttr ($blendShape + "." + $attr ) 0;
    

                        //Reselect base mesh
                        select -r $curObject;
                    }
                }
            }
        }

    }
}




global proc CreateBlendMesh(string $blendMeshName)
{
    string $duplicatedObject] = `duplicate -rr`;
    string $newBlendShapeTemplate = `rename $blendMeshName `;

    if (!`exists CBunlockAttr`)
    {
        source channelBoxCommand;
    }

    //Unlock all the channels
    CBunlockAttr ($newBlendShapeTemplate +".tx");
    CBunlockAttr ($newBlendShapeTemplate +".ty");
    CBunlockAttr ($newBlendShapeTemplate +".tz");
    CBunlockAttr ($newBlendShapeTemplate +".rx");
    CBunlockAttr ($newBlendShapeTemplate +".ry");
    CBunlockAttr ($newBlendShapeTemplate +".rz");
    CBunlockAttr ($newBlendShapeTemplate +".sx");
    CBunlockAttr ($newBlendShapeTemplate +".sy");
    CBunlockAttr ($newBlendShapeTemplate +".sz");

    select -r $newBlendShapeTemplate;
    
    
    //Freeze Transformations
    makeIdentity -apply true -t 1 -r 1 -s 1 -n 0 -pn 1;
    
    //Delete Bad Transforms
    delete `ls -type unknown -type unknownDag -type unknownTransform`;

    ParentToAppliedBlendshapes($newBlendShapeTemplate);
}



global proc ParentToAppliedBlendshapes(string $newBlendShapeObject)
{
    if (`objExists "appliedBlendshapes"`){
        parent $newBlendShapeObject "appliedBlendshapes";
    }
    else{
        select -cl;
        group -em -name appliedBlendshapes;
        parent $newBlendShapeObject "appliedBlendshapes";

    }
}


I know you’re going to smack your head with this question, but how do I make use of the code you’re posting?

And to be clear, I was talking about updating the rig of G2 to make use of it in Daz itself, but still making sure all the morphs still work for the updated figure…I wasn’t sure if could be possible, but if it is, it might just be better to get Daz’s artist to do that

I thought about that yesterday, “What if I’m making this and he doesn’t use Maya?” That’s funny and sorry I didn’t ask. Yeah the script is for Maya, you drop it into the script editor after your model is imported and selected. Then type ExtractAllBlendshapes() to run the script. I don’t think Daz Studio has the features you need for skinning, adjusting joints, adjusting uvs or extracting blendshapes. If you don’t use Maya though and have no plans to do so then yeah you’re right that Daz’s artist would be the best. The whole value of changing the skeletal structure for use in UE4 is to utilize retargeting along with the same animation blueprint and socket location structure on each character. But still it’s not necessary to do all this work.

Here is a video of exporting the model with morph targets from Daz

I just tested this against the Genesis 2 model, seems as though extracting the morphs isn’t necessary, Daz definitely extracts each morph as a separate mesh.

thank you for all the advice

I also contacted Daz about the figure rig to see if they could update it. They told me (which of course I already knew) that the toe can’t bend in the way I want it to, but it’s possible, so I asked if it’s possible I could do it on my end

they replied

said they weren’t should if adding the extra rig in the toes would break the morphs (this would mean me dialing the morphs inside Daz, not exporting them out), but also said it couldn’t hurt to try

so, I might try to find someone that could add the extra rig for the 2 figures

No problem! I also saw this thread about a similar thing http://forums.autodesk.com/t5/programming/maya-blendshape-mel-question/td-p/5571106