JME GLTF Support

Thanks! Sounds like a bug on JME’s side indeed. I’ll check your model, and give you heads up

The good news is that it works fine with master., I’ll check what’s the issue with 3.2

Ok I tested it with 3.2.1 and I can’t reproduce the issue. The model loads fine and I can play all animations.
What version of JME do you use?
Could you provide a test case where it fails?

1 Like

I tried in versions 3.2.0-stable and now I updated to 3.2.1-stable (gradle), it doesn’t work.

Uncaught exception thrown in Thread[main,5,main]
RendererException: compile error in: ShaderSource[name=Common/MatDefs/Shadow/PreShadow.vert, defines, 
type=Vertex, language=GLSL150]
0(158) : error C0000: NUM_BONES must be between 1 and 255.
0(165) : error C1043: size of dimension cannot be less than 1

at com.jme3.renderer.opengl.GLRenderer.updateShaderSourceData(GLRenderer.java:1269)
at com.jme3.renderer.opengl.GLRenderer.updateShaderData(GLRenderer.java:1296)
at com.jme3.renderer.opengl.GLRenderer.setShader(GLRenderer.java:1360)
at com.jme3.material.logic.DefaultTechniqueDefLogic.render(DefaultTechniqueDefLogic.java:94)
at com.jme3.material.Technique.render(Technique.java:166)

Test cases:
1- I used this model in game

 final Spatial human = app.getAssetManager().loadModel("models/npc/human_01/lwjgl/scene.j3o");
 human.setName("human");
 ((SceneNode)scene).attachChild(human);

2- I have tried open this model in jMonkeyBuilder (today it was updated to 3.2.1)

Could you try to load the gltf file instead of the J3o? If the j3o has been wrongly generated it won’t work.

Yes, you right, gltf works fine.
For convertation to j3o I use jmBuilder, which uses Master branch.

Ha…yeah well master branch is a lot different from 3.2.1 regarding animations, so either you’ll have to uss it for your game either you should use a JMB build based on 3.2.1. @javasabr do you have that?

oh, I have some pending changes in my branch(SSBO/ AST and etc.) which is based on your matser branch, but ok, I will prepare another build of jMB for @Konstantin_Denisov :slight_smile:

IMO you should have a “stable” build based on stable engine.

I think the same :slight_smile:

yup, it’s one of reasons why I don’t remove previos builds of jMB, but I want to support all new features of jME as far as I can do that :slight_smile: for example: your last changes with Light probes and new animation system :slight_smile:
Also, @Konstantin_Denisov uses develop version of jMB.

hm, I have tested this problem on 3.2.1-stable, so if I open the model directly, it works ok, but if I open and re-save this model as .j3o, it doesn’t work.

mhh ok gonna look into it. I didn’t test to save and reopen so maybe the issue is still there in master also

1 Like

Found the issue.
That’s somthing I fixed when reworking the animations on master and never backported it to 3.2

Do you have a way to build your editor against the v3.2 branch and test again?
I’ll release a 3.2.2 if it works.

1 Like

ok, I will try it :slight_smile: thanks

I have checked your fix, it works good, thanks :slight_smile:

I’m assuming you might have worked this out by now. But if not, a confusing aspect of the glTF export is that the active action is linked under the object while all actions are children of the armature node (which has the object as its child). I suspect your problem is that you exported (from jME) the object node rather than the armature node. I had the same problem and it took me quite a while to work out what was happening.

I’ve added a wiki page that describes how this works - it’s currently being reviewed.

1 Like

Exported a gltf file from OnShape which uses extensions to put unique ID. When I try to load into jMonkeyEngine v3.2.4 get an error/lockup that it can’t find PTC_onshape_metadata. If I load the model into Blender and export the resulting file leaves out the extension PTC_onshape_metadata and able to import.

Following this thread understand it is difficult to deal with unrecognized extensions but would be better to ignore and report .

Any options for working around this problem?

“extensions”: {
“PTC_onshape_metadata”: {
“id”: [
“KFWJ”
]
}
},

You can probably define a custom importer “extension” that just does nothing, then it should work.

Can that be done in existing SDK framework as a plugin/added to classpath? Any guides available? Developed netbean modules back in the day but trying to avoid going down a rabbit hole for a time sink.