Node getAttachmentsNode(int boneIndex, SafeArrayList<Geometry> targets) {
        targetGeometry = null;
        /*
         * Search for a geometry animated by this particular bone.
         */
        for (Geometry geometry : targets) {
            Mesh mesh = geometry.getMesh();
            if (mesh != null && mesh.isAnimatedByBone(boneIndex)) {
                targetGeometry = geometry;
                break;
            }
        }

        if (attachNode == null) {
            attachNode = new Node(name + "_attachnode");
            attachNode.setUserData("AttachedBone", this);
            //We don't want the node to have NumberOfBones set by a parent node, so we force it to null.
            attachNode.addMatParamOverride(new MatParamOverride(VarType.Int, "NumberOfBones", null));
        }

        return attachNode;
    }
Access the attachments node of this bone. If this bone doesn't already
have an attachments node, create one. Models and effects attached to the
attachments node will follow this bone's motions.

@param boneIndex this bone's index in its skeleton (&ge;0)
@param targets a list of geometries animated by this bone's skeleton (not
null, unaffected)
jme3-core/src/main/java/com/jme3/animation/Bone.java