Model animating weird in JME


#1

Hi.

Two issues

So, I took up the advice from JME forum to learn blender. I went ahead joined some tutorials and was finally able to make a model, rig and animate it. I was able to successfully load the model in SceneExplorer and animate it, directly as a blender file. But when I export it as a gltf, exceptions are thrown. But I can live with that. My problem is that the animation plays fine in blender, but in JME, the parts of the model are disjoined from each other during animation. I am attaching a screenshot of a lamp model that I created. What can possibly cause this?

The error when I get trying to open gltf:

JME only supports linear interpolation for animations
JME only supports linear interpolation for animations
An Exception has occured when trying to load asset AnimatedLamp3-1-JME
com.jme3.asset.AssetLoadException: An error occurred loading Scenes/AnimatedLamp3-1-JME.gltf
at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:150)
at com.jme3.scene.plugins.gltf.GltfLoader.load(GltfLoader.java:78)
at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:259)
at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:373)
at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:416)
at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:94)
at com.jme3.gde.core.assets.actions.OpenModel$1.run(OpenModel.java:69)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.jme3.asset.AssetLoadException: Inconsistent animation sampling
at com.jme3.scene.plugins.gltf.TrackData.checkTimesConsistantcy(TrackData.java:139)
at com.jme3.scene.plugins.gltf.TrackData.update(TrackData.java:130)
at com.jme3.scene.plugins.gltf.GltfLoader.readAnimation(GltfLoader.java:805)
at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:136)
… 7 more


#2

I am ready to share the blender file.


#3

Well the error is explicative, you’re applying some type of animation that jME doesn’t support. I can’t tell you exactly what it is because I’ve not studied glTF yet.


#4

I second aegroto comment and for me I found that the gltf script was not working for 2.79c blender.

Maybe this will help.
https://docs.blender.org/manual/en/dev/editors/graph_editor/fcurves/introduction.html


#5

So, I am applied linear interpolation to the animation, yet it throws another of set of errors. But that will be figured out. What I dont understand why the mesh is pulled apart when I use blend file in jme and animate the model.


#6

That’s all I can come up with.

Maybe it needs to be baked, or you didn’t apply the scale, rot, and translation. Couldn’t get it to work myself.

Edit:
See this thread, maybe it will help clear things up.


#7

have you fixed it / found solution?

for test purpose i just created new Cube and one bone, set ctrl-p autoweight, added only one animation, set to linear interpolation, but still i got SAME issue. i were using 2.79 before, and exporter worked for old khronos script but materials were not exported. New khronos group script dont work with animations for 2.79 and as i see it also dont work for 2.8 beta

tested also for 2.79 new khronos script and also same error in JME for same test cube/armature/anim created.

old script(for 2.79) - animations work, materials dont

new(both 2.79 and 2.8 as i know) - materials work, animation dont

@thetoucher not sure if you added to “wiki” what exporter script work what way and for what blender version, but if not then worth to add.

i changed interpolation to linear for all.
qqqqqqqqq
qqqqqq

What is the most funny, using OLD khronos script, interpolation DONT NEED TO BE LINEAR. it work anyway.

JME only supports linear interpolation for animations
JME only supports linear interpolation for animations
JME only supports linear interpolation for animations
An Exception has occured when trying to load asset test
com.jme3.asset.AssetLoadException: An error occurred loading Models/character/test.gltf
	at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:150)
	at com.jme3.scene.plugins.gltf.GltfLoader.load(GltfLoader.java:78)
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:259)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:373)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:416)
	at com.jme3.gde.core.assets.SpatialAssetDataObject.loadAsset(SpatialAssetDataObject.java:94)
	at com.jme3.gde.core.assets.actions.ConvertModel$1.run(ConvertModel.java:65)
	at java.lang.Thread.run(Thread.java:748)
Caused by: com.jme3.asset.AssetLoadException: Inconsistent animation sampling 
	at com.jme3.scene.plugins.gltf.TrackData.checkTimesConsistantcy(TrackData.java:139)
	at com.jme3.scene.plugins.gltf.TrackData.update(TrackData.java:130)
	at com.jme3.scene.plugins.gltf.GltfLoader.readAnimation(GltfLoader.java:805)
	at com.jme3.scene.plugins.gltf.GltfLoader.loadFromStream(GltfLoader.java:136)
	... 7 more

Also about linear interpolation issue. maybe its just about name? Both files were using linear, will report to them as issue if none exist.

        "samplers" : [
            {
                "input" : 6,
                "interpolation" : "LINEAR",
                "output" : 7
            },
            {
                "input" : 8,
                "interpolation" : "LINEAR",
                "output" : 9
            },
            {
                "input" : 10,
                "interpolation" : "LINEAR",
                "output" : 11
            }
        ]

and

        "samplers" : [
            {
                "input" : 7,
                "interpolation" : "CUBICSPLINE",
                "output" : 8
            },
            {
                "input" : 9,
                "interpolation" : "CUBICSPLINE",
                "output" : 10
            },
            {
                "input" : 11,
                "interpolation" : "CUBICSPLINE",
                "output" : 12
            }
        ]

edit:

also there are issues like animation work fine in blender, but need re-apply objects translation/scale/rotation to make animations work in jme. not sure if exporter related or more JME.