[Python][Houdini] How to create joint/bone in Skeleton Node?

Hi,

Is there a way I can create a joint/bone in skeleton node using python?

I tried dragging the node in the Python Shell. It has a SOPnode type.
I tried running the dir() command under it and it doesn’t seem to have method relating to creating a joint/bone.

When searching for “skeleton”, “joint” or “bone”, in the documentation, nothing seems to pertain in skeleton node.

Is there a way around this?

From:https://vimeo.com/455156831
import hou

subnet = hou.node("/obj").createNode(“subnet”, “%s_skeleton”% “cool”)
subnet.moveToGoodPosition()

root = subnet.createNode(“null”, “%s_Root” % subnet)

bone_0 =subnet.createNode(“bone”, “%s_Bone_0” % root)

bone_0.setNextInput(root)
bone_0.moveToGoodPosition()
bone_0.parm(“rx”).set(-120)
bone_0.moveParmTransformIntoPreTransform()

He’s using Houdini, not Maya…

Got it, I updated answer. Thanks!

@yichen

Terribly sorry for the late response. Hectic holiday got in the way and I only got to personal projects at the moment after finishing the backlogs.

The code you posted is for the object based rigging. I’m looking for the geometry based rigging (i.e. Skeleton Node). So unfortunately, I can’t use it.

Will keep you posted if a solution comes up.

Thanks!

no worries, looking forward a solution for it.