What is an unlinked animation?

I have a very simple slide door, with one action and two keyframes in blender. No bones just location keyframes.

Now when I try to load this model I get the log output
““Loading unlinked animations is not yet supported!””
So the question is, what makes this a unlinked animation? how can I link this? Searching google was nto really helpful at all (mostly tutorial how to unlink stuff :frowning: )

Do you even need the Blender/JME animation framework? It should be extremely easy to just write a control that moves the door then removes itself when it finishes.

In theory yes, but this is a doorSystem for an EntitySystem,
I have a class that detects changes in the doorStates and plays “close”, “open” ect no matter what type of door it is. This is just the simplest type of door as I hope when I get this to work all others will be easier

If you’re not planning on having more advanced animations (ie. those that can’t be easily implemented in a similar way), you could have an abstract class with open() and close() methods and then call those with a specific implementation per door. Also, I know this suggestion isn’t entity system based, but, I can’t recommend how to do it with such a framework as I haven’t looked into how they work in detail.

I’m just wildly guessing but maybe “unlinked” means “not attached to bones/armature” or something.
Have you tried simply giving the door a root bone so it’s basically a skeletal animation?
Without that the Engine might not know what vertices to influence and you also have no ability to play them

Hm with a bone it works somewhat better :frowning:

The moved vertices are definitly right, and the motion somewhat but the rotation is all wrong.

See for yourselves, maybee you have any idea, I spend the last 4h on this :confused:

From that video, in Blender you haven’t applied the rotation (cntrl+a - rotation)

(Oh, nor the scale or location, hence the positioning and scale will be off, depending if you applied it on the others)

1 Like

Yes that was it, it fixed quite a bit,

I somehow now managed th do the close animation :slight_smile:
Now for the second half of the door :confused: (That NLA Dope Actions stuff is so confusing if you never used it before)

But hopefully this time I will learn it finally so I can make simple animations myself that are more than overdue for many parts of the spaceships :slight_smile:

It took me months to get comfortable with the NLA editor, confused the shit out of me. I do the exact same thing for all my doors.

Hm next problem,

I now tried to change the skeleton of the door (biological tech doors … hmmm)
and now I get this one here, any idea why the importer throws this internally?

com.jme3.asset.AssetLoadException: An exception has occured while loading asset: models/multiuse/internal/scifi-corridors-map0222/doorframe_door3.blend
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:264)
	at com.jme3.asset.DesktopAssetManager.loadAsset(DesktopAssetManager.java:376)
	at com.jme3.asset.DesktopAssetManager.loadModel(DesktopAssetManager.java:419)
	at de.visiongamestudios.compiler.CompileApplication.internalcompile(CompileApplication.java:258)
	at de.visiongamestudios.compiler.CompileApplication.lambda$1(CompileApplication.java:210)
	at com.jme3.app.AppTask.invoke(AppTask.java:142)
	at com.jme3.app.Application.runQueuedTasks(Application.java:667)
	at com.jme3.app.Application.update(Application.java:681)
	at com.jme3.app.SimpleApplication.update(SimpleApplication.java:234)
	at com.jme3.system.awt.AwtPanelsContext.updateInThread(AwtPanelsContext.java:194)
	at com.jme3.system.awt.AwtPanelsContext.access$100(AwtPanelsContext.java:44)
	at com.jme3.system.awt.AwtPanelsContext$AwtPanelsListener.update(AwtPanelsContext.java:68)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.runLoop(LwjglOffscreenBuffer.java:125)
	at com.jme3.system.lwjgl.LwjglOffscreenBuffer.run(LwjglOffscreenBuffer.java:156)
	at java.lang.Thread.run(Thread.java:745)
Caused by: java.io.IOException: Unexpected importer exception occured: com.jme3.animation.BoneTrack cannot be cast to com.jme3.animation.SpatialTrack
	at com.jme3.scene.plugins.blender.BlenderLoader.load(BlenderLoader.java:223)
	at com.jme3.scene.plugins.blender.BlenderLoader.load(BlenderLoader.java:88)
	at com.jme3.asset.DesktopAssetManager.loadLocatedAsset(DesktopAssetManager.java:262)
	... 14 more
Caused by: java.lang.ClassCastException: com.jme3.animation.BoneTrack cannot be cast to com.jme3.animation.SpatialTrack
	at com.jme3.scene.plugins.blender.animations.BlenderAction.toTracks(BlenderAction.java:74)
	at com.jme3.scene.plugins.blender.animations.AnimationHelper.applyAnimations(AnimationHelper.java:74)
	at com.jme3.scene.plugins.blender.objects.ObjectHelper.toObject(ObjectHelper.java:264)
	at com.jme3.scene.plugins.blender.BlenderLoader.load(BlenderLoader.java:105)
	... 16 more

This here is the offending code the track in the 3rd last line

  public SpatialTrack[] toTracks(Node node, BlenderContext blenderContext) {
        List<SpatialTrack> tracks = new ArrayList<SpatialTrack>(featuresTracks.size());
        for (Entry<String, Ipo> entry : featuresTracks.entrySet()) {
            tracks.add((SpatialTrack) entry.getValue().calculateTrack(0, null, node.getLocalTranslation(), node.getLocalRotation(), node.getLocalScale(), 1, stopFrame, fps, true));
        }
        return tracks.toArray(new SpatialTrack[tracks.size()]);
    }

However for some reason I guess this method should be called instead.

/**
     * Converts the action into JME bone animation tracks.
     * 
     * @param skeleton
     *            the skeleton that will be animated
     * @return the bone tracks for the node
     */
    public BoneTrack[] toTracks(Skeleton skeleton, BlenderContext blenderContext) {
        List<BoneTrack> tracks = new ArrayList<BoneTrack>(featuresTracks.size());
        for (Entry<String, Ipo> entry : featuresTracks.entrySet()) {
            int boneIndex = skeleton.getBoneIndex(entry.getKey());
            BoneContext boneContext = blenderContext.getBoneContext(skeleton.getBone(boneIndex));
            tracks.add((BoneTrack) entry.getValue().calculateTrack(boneIndex, boneContext, boneContext.getBone().getBindPosition(), boneContext.getBone().getBindRotation(), boneContext.getBone().getBindScale(), 1, stopFrame, fps, false));
        }
        return tracks.toArray(new BoneTrack[tracks.size()]);
    }

That is is a bone track sounds kinda logical to me, after all I do bone animations?

Maybe you could use the ogre exporter?

I could try, but I guess that sooner or later I will end up in a similar/ the same kind of problems. I would rather try to understand how the importer applies animations to jme.

[ADS] or you can give a try to xbuf, it support animation with and without bones (if you used NLA).
:yum:

2 Likes

WoW ! Just Perfect …
@david_bernard_31 I want to give you thousands of :heart:
I never knew about it.

Here is a baked physic to keyframes action which is simulated in blender.(it is baked physics so it does not use any physic calculation in real time and IT HAS NO BONE ON IT. Sorry for yelling :slight_smile: )

@Empire_Phoenix try your case with xbuf .(Do not go around Ogre :yum:)

1 Like

O.o no bone? That might be just what I need for adding low cost animated spectators to my lil game.

1 Like

wait you already implemented that, I will try it asap :slight_smile:

So if I have a working animation in blender it will probably work in jme then?

Ok,
I got to implement it,
it now behaves kinda similar to blender, so now I only need to fix it up in blender (damn you nla editor :stuck_out_tongue: )

Btw,I found it extremly hard to consume the loader for jme, have you thought about a secondary deployment way with a folder and all required jars just dumpled into it? I basically forced gradle to generate me such one. The problem with the maven way is, that the build scripts only deploy to localMaven, but I use a central artifactory, so when trying to consume them I run into air :slight_smile: After trying around 5 hours with forking and adjusting build scripts i gave up and just worte a small collect all runtime jars into folder style adjustment, and consumed that folder.

Sorry, I need to update the doc (and the README)
Did you follow the instruction from http://www.xbuf.org/get_started/ ?

You have a working sample at jme3_xbuf/samples/simple at master · xbuf/jme3_xbuf · GitHub (it doesn’t use the latest code)

No, I followed the one directly on github :slight_smile: