private void setupControls() {
        for (SkinData skinData : skinnedSpatials.keySet()) {
            List<Spatial> spatials = skinnedSpatials.get(skinData);
            if (spatials.isEmpty()) {
                continue;
            }
            Spatial spatial = skinData.parent;

            if (spatials.size() >= 1) {
                spatial = findCommonAncestor(spatials);
            }
//            if (spatial != skinData.parent) {
//                skinData.rootBoneTransformOffset = spatial.getWorldTransform().invert();
//                if (skinData.parent != null) {
//                    skinData.rootBoneTransformOffset.combineWithParent(skinData.parent.getWorldTransform());
//                }
//            }
            if (skinData.animComposer != null && skinData.animComposer.getSpatial() == null) {
                spatial.addControl(skinData.animComposer);
            }
            spatial.addControl(skinData.skinningControl);
            if (skinData.morphControl != null) {
                spatial.addControl(skinData.morphControl);
            }
        }

        for (int i = 0; i < nodes.size(); i++) {
            JointWrapper bw = fetchFromCache("nodes", i, JointWrapper.class);
            if (bw == null || bw.attachedSpatial == null) {
                continue;
            }
            String jointName = bw.joint.getName();
            SkinData skinData = fetchFromCache("skins", bw.skinIndex, SkinData.class);
            SkinningControl skinControl = skinData.skinningControl;
            if (skinControl.getSpatial() == null) {
                logger.log(Level.WARNING,
                        "No skinned Spatial for joint \"{0}\" -- will skin the model's root node!",
                        jointName);
                rootNode.addControl(skinControl);
            }
            skinControl.getAttachmentsNode(jointName).attachChild(bw.attachedSpatial);
        }
    }
GLTF 2.0 loader
Created by Nehon on 07/08/2017.
jme3-plugins/src/gltf/java/com/jme3/scene/plugins/gltf/GltfLoader.java