[SOLVED] Import FBX

i tried use this model but i had:

SEVERE: Uncaught exception thrown in Thread[jME3 Main,5,main]
java.lang.ArrayIndexOutOfBoundsException: 19
	at com.jme3.renderer.opengl.GLRenderer.setVertexAttrib(GLRenderer.java:2755)
	at com.jme3.renderer.opengl.GLRenderer.setVertexAttrib(GLRenderer.java:2808)
	at com.jme3.renderer.opengl.GLRenderer.renderMeshDefault(GLRenderer.java:3040)
	at com.jme3.renderer.opengl.GLRenderer.renderMesh(GLRenderer.java:3077)
	at com.jme3.material.logic.DefaultTechniqueDefLogic.renderMeshFromGeometry(DefaultTechniqueDefLogic.java:70)
	at com.jme3.material.logic.SinglePassAndImageBasedLightingLogic.render(SinglePassAndImageBasedLightingLogic.java:255)
	at com.jme3.material.Technique.render(Technique.java:166)
	at com.jme3.material.Material.render(Material.java:1024)
	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:270)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:151)
	at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:197)
	at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:232)
	at java.lang.Thread.run(Thread.java:748)

Hmm, I do not get ArrayIndexOutOfBoundsException but an assertion error in MorphTrack.java.

It works for me with a trick.

I tested it from the TestGltfLoading.java which Nehon wrote.

but there is an assertion error in

I commented out that line and it works fine.
Not sure if this an issue with the model itself or a bug in Gltf loader.

Edit:
I opened an issue for this:

1 Like

i found some problems, that might need to fix.

Character has animations: Anim1
Morph control found
FOUND MORPH TARGET:Character_0
FOUND MORPH TARGET:Character_1
FOUND MORPH TARGET:Character_2

each of geoms(trully just different materials), even if its same model, they have same keys.
animation is in closest parent node.

using Blender 2.8 and default .gltf exporter

  • Problem 1 is, that after export animation is visible not via NLA tracks, but only from Dope Sheet.(where i can see only edited current action - this mean one action)

  • Problem 2 is, if i got no animation in Dope Sheet, i cant even use manual shape key change. (it dont change if no MorphControl controller is generated and its only generated if there is animation. (i would suggest generate MorphControl even if there are no shape key animations)

  • Animation problem is that even if its visible(only one animation from Dope Sheet, because it dont get animations from NLA tracks) and i use morphHelper.morphElements.get(“Character_0”).composer.setCurrentAction(“Anim1”);
    it just dont work, where this composer says it have animation in its list… (this one is from Character node)
    not sure why this dont work, i tried a lot things and im still not sure, it could be i use new blender and gltf exporter, and @nehon used older so there might be some changes. Or maybe it was not commited into JME code fully.

Currently can use only manual shape key change in code, but anyway need animation visible to get .gltf importer create MorphControl to even have this working.

For what it worth, I already have made an issue for this

1 Like

afaik Nehon did not use blender Gltf addon in his examples. He was using the Gltf exported directly from Sketchfab.

1 Like

right, this model had gltf download version only i think anyway, so yes its possible it could be about gltf exporter.(did you verify its their issue? - because im not sure where to check this in gltf files)

i tried some gltf exporter options, but none helped.

anyway im glad it work somehow for manual change. animations can be done via code, could be nice to have it working, but imo shape keys usually will be used for manual code change purpose.