Does MonkeyWrench load user data for gltf/glb scenes? I am trying to use userdata to locate certain spatials of my scene, but cannot find any userdata entries.
Spatial scene = assetManager.loadModel("Models/gi-test.gltf");
rootNode.attachChild(scene);
for (Spatial s : new SceneGraphIterator(scene)) {
System.out.println(s.getName());
for (String k : s.getUserDataKeys()) {
System.out.println(" " + k);
}
if (s.getUserData("LightMesh") != null) {
meshLight = s;
break;
}
}
The console isnât printing any userdata entries for any spatial in the scene. The gltf file does contain the userdata entries.
MonkeyWrench loads user data in some cases ⌠for instance when a node has âextrasâ metadata of certain types (boolean, double, float, integer, long, string, or Vector3f).
If you provide me with a complete glTF file containing the user data youâre interested in, Iâll investigate to see whatâs going on and whether MonkeyWrench can be extended to load it. (Small files preferred over large ones.)
Strange, I am definitely not seeing any userdata on any spatials⌠oh, hold on, I see that extras loading was added in 0.6.1, but I havenât upgraded past 0.5.3. Totally my bad, very sorry about that!
MonkeyWrench currently ignores extra on materials and scenes. How do you think they should be handled?
It looks like a scene is parsed as a node, so I think it would be logical to attach the extras data to its userdata if possible.
The materials Iâm not sure about, but I imagine it could be handy if the extras were parsed as material parameters and/or render states. I donât know to what extent gltfâs material parameters overlap with PBRLightingâs, so I donât know how useful that would end up being.
Further investigation suggests Assimp ignores extras on materials, making them invisible to MonkeyWrench. I may open an issue at the Assimp repo, if there isnât one already.
EDIT: I opened Assimp issue 5960. Thereâs a backlog of 714 open issues, so I donât expect anything to happen unless I submit a PR.
Iâve added warnings when scene extras are ignored, to help clarify whatâs happening. Without an identified use-case, however, Iâm reluctant to attach the information to anything.