JME GLTF Support

I added bin file and it is uploaded, but there are many problems

  1. There are no bones
  2. Only one animation instead two
  3. vertexes attached to something wrong

http://dl3.joxi.net/drive/2018/03/12/0011/2843/781083/83/8cdb1f29cb.jpg

That was kind of my point. The Khronos exporter did shit.
It’s not working very well right now.

As for the issue with sketchfab there are some troubles right now and it should be fixed soon.

1 Like

Guys from sketchfab.com fixed converter, and now it works fine
Thanks for help

http://dl4.joxi.net/drive/2018/03/12/0011/2843/781083/83/79e75cfd6e.jpg

3 Likes

Hi guys,

is vertex animation part of JME3.2?
If not, are there plans to implement it?

Will be in 3.3

And if you feel adventurous it’s already available in the monkanim branch of the engine. Just know it’s an utterly unstable branch and things may break from one commit to another.

2 Likes

Only if you pay money or invite a person who signs up.

Thought I would try gltf and have found I have the same results as Konstantin_Denisov.

No fix since cant upload to sketchfab without losing your models…

I also ran into a bit of trouble using Sketchfab’s converter and have an issue opene on their forums currently.

Although have you tried the Khronos GLTF exporter since it’s been updated? They finally released a version that’s working enough that I can export a fully animated model from blender into JME very quickly and without needing to use NLA tracks :slightly_smiling_face:

They said it’s a development version but it seems to work perfectly from my trials so far. The download is at the bottom of the first post on this pull request Support multiple actions, NLA tracks by donmccurdy · Pull Request #166 · KhronosGroup/glTF-Blender-Exporter · GitHub

Yes, that’s the script I am using but with 2.79b blender. I cant figure out if your supposed to use actions or nla strips, bake or not, apply modifiers or not, blah blah blah. I have tried every setting on and off and it always results in as Konstantin_Denisov reported or worse.

Wait, I was using the linked to release. I will try this one out.

Nah. Doesn’t work either.

If you do as instructed, nothing is exported. Have to bake on export and then you get a non playable action in your .blend and one in the AnimControl that doesn’t play.

I ran though every setting again and no different then the released script.

What version of blender are you using?

I’m on 2.78c

I made a model and gave it a skeleton, assigned vertex groups to each bone and left the armature modifier set but not applied. Then if I make any new animations in the action editor, they all get imported to the engine without having to do anything else.

Occasionally I’ll have one animation that doesn’t make it out of blender, but If I just create a new animation and copy the key frames over then then it works.

I also noticed that you need to set the frame start and end time equal to the values of your longest animation. My longest animatino is a walk animation that’s 30 frames, so i have to have the end frame set to 30 at export time or it will be shortened when it makes it into JME.

That may be why.

The New versions break a lot of old stuff. I ran into some Ogre problems right off. I also used maximo for my animations so that may be a problem.

This version totally wiped my settings also, that’s probably because they wanted a vanilla install due to the 1k bug fixes.

Hrmm, with ogre it needs to equal all your animations lengths added together, including any gaps between strips.

Mhh true.
Though, Sketchfab workflow is not really the intended way. The khronos exporter should be at some point.

Cool I’ll try it again.

Hello
I have problems with animation for this model.

It works on https://sketchfab.com as you see, and it works on https://gltf-viewer.donmccurdy.com/
also I converted its to j3o
But I cant open it. I think it happens because clothes on this character have animation but don’t have bones.
It is separated objects what copied from parts of character and changed to have view of clothes and have animation.
Exception:
0:164(1): preprocessor error: #error NUM_BONES must be between 1 and 255.

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.SinglePassAndImageBasedLightingLogic.render(SinglePassAndImageBasedLightingLogic.java:237)
at com.jme3.material.Technique.render(Technique.java:166)
at com.jme3.material.Material.render(Material.java:974)
at com.jme3.renderer.RenderManager.renderGeometry(RenderManager.java:614)
at com.jme3.renderer.queue.RenderQueue.renderGeometryList(RenderQueue.java:266)
at com.jme3.renderer.queue.RenderQueue.renderQueue(RenderQueue.java:305)
at com.jme3.renderer.RenderManager.renderViewPortQueues(RenderManager.java:877)
at com.jme3.renderer.RenderManager.flushQueue(RenderManager.java:779)
at com.jme3.renderer.RenderManager.renderViewPort(RenderManager.java:1108)
at com.jme3.renderer.RenderManager.render(RenderManager.java:1158)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:253)
at com.jme3.jfx.injfx.JmeToJfxApplication.update(JmeToJfxApplication.java:31)
at com.ss.editor.JmeApplication.update(JmeApplication.java:384)
at com.jme3.system.lwjgl.LwjglWindow.runLoop(LwjglWindow.java:494)
at com.jme3.system.lwjgl.LwjglWindow.run(LwjglWindow.java:577)
at com.jme3.system.lwjgl.LwjglWindow.create(LwjglWindow.java:418)
at com.jme3.jfx.injfx.JmeOffscreenSurfaceContext.create(JmeOffscreenSurfaceContext.java:215)
at com.jme3.app.LegacyApplication.start(LegacyApplication.java:463)
at com.jme3.app.LegacyApplication.start(LegacyApplication.java:424)
at com.jme3.app.SimpleApplication.start(SimpleApplication.java:125)
at com.ss.editor.JfxApplication.startJmeApplication(JfxApplication.java:184)
at com.ss.editor.JfxApplication.lambda$main$0(JfxApplication.java:143)
at java.base/java.lang.Thread.run(Thread.java:844)

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.