Bone attachment nodes

I found this method in the old SkeletonControl that looks very useful for attaching spatials to bones (attach a knife spatial to a hand bone).

SkeletonControl.getAttachmentsNode(String bonename)

Javadoc:
Access the attachments node of the named bone. If the bone doesn’t already have an attachments node, create one and attach it to the scene graph. Models and effects attached to the attachments node will follow the bone’s motions.

How do I use this method correctly (if it should be used at all)?

2 Likes

Edit:
if you want to discover new features, study the jme3-examples project; is full of very useful and very clear examples maintained by the community.

2 Likes

Skeletoncontrol is old, I believe. It prob still works otherwise I think skinning does the exact same thing, like getting weapons in the arms of unlikely heroes :sunglasses:

        SkinningControl skinningControl = model.getControl(SkinningControl.class);
        Node n = skinningControl.getAttachmentsNode("rig:RightHand");
        n.attachChild(mace);
        rootNode.attachChild(model);      
2 Likes