Jump to content

Detecting Bone Hierarchy


Atom

Recommended Posts

Hi All,

 

I am trying to auto-configure the joints in my FBX agent rig. By default the FBX rig has no joint configuration thus it can not participiate in a H15 ragdoll state.

 

I have manually added an Agent Configure Joints node into my agent setup network. After that node I have placed a python code node. In the python node I can get a list of all the bones via buildTransformMenu but I am not sure of their hierarchy. How would I determine what bone is the parent and what bone is the child given only a list of bone names?

# Place this Python node after Agent Configure Joints node.
import crowdstoolutils

lst = crowdstoolutils.buildTransformMenu(hou.pwd())
print lst

node = hou.pwd()
target_node = node.inputs()[0]

nl = target_node.parm('num_limits').eval()
for index in range(0,(nl-1)):
    parm_name = "enable%d" % index
    target_node.parm(parm_name).set(1)

    parm_name = "beginup_range%d" % index
    target_node.parm(parm_name).set(-180)
    parm_name = "endup_range%d" % index
    target_node.parm(parm_name).set(180)
    parm_name = "beginout_range%d" % index
    target_node.parm(parm_name).set(-180)
    parm_name = "endout_range%d" % index
    target_node.parm(parm_name).set(180)
Edited by Atom
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...