private SkinningControl getSkinningControl(Spatial model) {
        SkinningControl control = model.getControl(SkinningControl.class);
        if (control != null) {
            return control;
        }

        if (model instanceof Node) {
            for (Spatial child : ((Node) model).getChildren()) {
                SkinningControl skinningControl = getSkinningControl(child);
                if (skinningControl != null) {
                    return skinningControl;
                }
            }
        }

        return null;
    }
This test case validates a shader compilation fix with a model using a PBR material in combination with a
SkinningControl. When you run this application and don't see a RenderException, the test is successful.
For a detailed explanation consult the GitHub issue: https://github.com/jMonkeyEngine/jmonkeyengine/issues/1340
-rvandoosselaer
jme3-examples/src/main/java/jme3test/light/pbr/TestIssue1340.java