Transfert a bone based skinning to a null based skinning?

58 views
Skip to first unread message

David Saber

unread,
Jul 1, 2012, 8:55:58 AM7/1/12
to Softimage Mailing List
Hi !
I have a character skinned on bones and I‘d like to switch them to nulls.
Is Gator the answer to that? From the documentation, I understand Gator only transfers the skining from one mesh to another mesh, keeping the same skeleton.
Thanks,
David

Chris Covelli

unread,
Jul 1, 2012, 10:01:44 AM7/1/12
to David Saber, soft...@listproc.autodesk.com
You dont need Gator to do that.  Envelopes work based on the specific names of the objects deforming them.  Try this:
  • Select your enveloped mesh, hit Ctl+e to bring up the Weight Editor.  In the Weight Editor go to File/Save Preset and save your envelope to a file.
  • Create your null hierarchy, preferably in a separate model from your bone hierarchy, and rename all of your nulls with the same exact names as their corresponding bones.
  • Delete your envelope from the bone deformers, re-envelope the mesh to your new null deformers, select your mesh, bring up the weight editor again and go to FIle/Load Preset, and load the file you saved out in step 1.

Hope that helps!

--
Chris Covelli
http://kylevargas.net/

Eric Thivierge

unread,
Jul 1, 2012, 7:01:30 PM7/1/12
to soft...@listproc.autodesk.com
I would add,

you will not see the same exact deformation you do with bones. Bones allow for stretching along the length of the bone because the root and effectors are added to the envelope by default (they are hidden in the weight paint panel).

Just a heads up.

--------------------------------------------
Eric Thivierge
http://www.ethivierge.com

Alok

unread,
Jul 1, 2012, 7:12:22 PM7/1/12
to soft...@listproc.autodesk.com
That is why in my script you will find that I am skipping the roots and create nulls only at joints.

On 01/07/2012 7:01 PM, Eric Thivierge wrote:
heads up.


Eric Turman

unread,
Jul 1, 2012, 11:37:39 PM7/1/12
to soft...@listproc.autodesk.com
Yep..I have not enveloped to bones since 1997. Even in the days where I had to use Maya I used locators.. Bones do a better initial envelope but that is it, you can get the same deformation out of them as bones... well... other that then dual quat skinning maybe...I have not checked recently to see if it was fixed to work with nulls.

Other than that the only thing I use bones for is IK; they have too much baggage to use for casual deformations.
--




-=T=-
Alok_Signature_email_.gif

David Saber

unread,
Jul 2, 2012, 10:15:53 AM7/2/12
to soft...@listproc.autodesk.com
thanks all for the help : ]
Alok_Signature_email_.gif

Martin

unread,
Jul 2, 2012, 1:21:26 PM7/2/12
to soft...@listproc.autodesk.com
Is that script downloadable? I was writing an script like that a few months ago, and I was considering to continue it but if there is already something done I would like to take a look at it, if is possible.

M.Yara
Alok_Signature_email_.gif

Alok

unread,
Jul 2, 2012, 1:26:51 PM7/2/12
to soft...@listproc.autodesk.com
sure thing, here it is (I am not attaching it, instead copying the code, because google blocks vb scripts as attachments.)

Also please note that it is very old and was written in a hurry. If I were to rewrite this, I would write that with python with optimization wherever possible.

<code>

'-----------------------------------------------------------------------------------------
'................................................
'...............FBX Exporter.....................
'................................................
'................Alok Gandhi ....................
'................................................

'Scene Preparation for exporting to FBX Format
'Please Save your original scene before running this code as this will
'delete absolutely everything except the Geo and Export Nulls for the FBX
'-----------------------------------------------------------------------------------------



'-----------------------------------------------------------------------------------------
'Declaring Variables
'-----------------------------------------------------------------------------------------
    Dim str, oNullList, oGeo, PickedElement, ButtonPressed, ModifierPressed, oStart, oEnd
    Dim oWeights, nWeights, tempWeights, srcObj, aweights, env
    Dim env2, modelName, oDelList, nullCount


'------------------------------------------------------------------------------------------
'Initializing Variables
'------------------------------------------------------------------------------------------
    DeselectAll
    Set oRoot = ActiveProject.ActiveScene.Root
    str = "FBX_null"
    modelName = ""
    Set oNullList = GetValue("SelectionList")
    Set oDelList = GetValue("SelectionList")
    nullCount = 0



'----------------------------------------------------------------------------------------
'Getting Information from User
'----------------------------------------------------------------------------------------
    MsgBox "Please Pick the Geo of the Character"

    call PickElement( "polygon_mesh", "Select Geo", "Select Geo",_
           PickedElement, ButtonPressed, ModifierPressed)
       
            if ButtonPressed <> 0 Then
                set oGeo = PickedElement
            end if
   

   
    oStart = InputBox("Start Frame number to Plot Animation from.")
    oEnd = InputBox("End Frame number to Plot Animation up to.")




'-----------------------------------------------------------------------------------------
'Making list of Envelop existing Deformers
'-----------------------------------------------------------------------------------------
    Set env = oGeo.Envelopes(0)
    Set oSelection = env.Deformers




'-----------------------------------------------------------------------------------------
'Taking a Snapshot of Existing Weight Envelopes
'-----------------------------------------------------------------------------------------
    aWeights = env.Weights.Array
   
   

   

'----------------------------------------------------------------------------------------
'Making nulls and contraining them to Existing Deformers and Adding them to a list
'----------------------------------------------------------------------------------------
    For Each item In oSelection
               
        if item.type <> "eff" then    
            nullCount = nullcount+1
            set onull = GetPrim ("null",str & nullcount)
            SIApplyCns "Position", onull.name, item.model & "." & item.name
            SIApplyCns "Orientation", onull.name, item.model & "." & item.name
            oNullList.Add onull
                               
        end if
       
    Next
   




'---------------------------------------------------------------------------------------
'Applying new Nulls as deformers and resetting the envelope
'---------------------------------------------------------------------------------------
    FreezeObj env               

        For each nullitem  in oNullList
   
            ApplyFlexEnv oGeo.model & "." & oGeo.name &";"&nullitem.name, , 2

        Next


    set env02 = oGeo.Envelopes(0)

    env02.Weights.Array = aWeights





'----------------------------------------------------------------------------------------
'Plotting Animation on the new Nulls
'----------------------------------------------------------------------------------------
    For Each item In oNullList
        Set onullObj = item   
        PlotAndApplyAction, onullObj & "/kine.local.pos" , "plot",oStart ,_
            oEnd, , 20, 3, , , ,True , True, True
        PlotAndApplyAction, onullObj & "/kine.local.ori" , "plot",oStart ,_
            oEnd, , 20, 3, , , ,True , True, True
        DeleteObj "Mixer"
        RemoveAllCns onullObj
    Next




'---------------------------------------------------------------------------------------
'Scene Cleanup
'---------------------------------------------------------------------------------------
    modelName = oGeo.model.name
   
    If oGeo.model.name <> oRoot.name then
        CopyPaste oGeo.FullName, , "Scene_Root", 1
    end if

    oGeo.Name = "FBX_Geo"
   
    set  oDelList = oRoot.FindChildren( ,,, False)
   
    For each item in oDelList
        if item.type <> "CameraRoot" then
            if item <> oGeo then

                    for each nullobject in oNullList
                        if nullobject = item then
                            flag = True
                        end if
                    next
               
                        if flag = False then
                            DeleteObj "B:" & item
                        end if                

            end if
        end if
    Next

</code>

Martin

unread,
Jul 2, 2012, 1:35:50 PM7/2/12
to soft...@listproc.autodesk.com
Thanks Alok !

good ol' VBS code in these Python days :D

I'll give it a try !
Thanks again!

M.Yara
Alok_Signature_email_.gif
Reply all
Reply to author
Forward
0 new messages