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 )
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
I somehow now managed th do the close animation
Now for the second half of the door (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
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
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?
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.
WoW ! Just Perfect … @david_bernard_31 I want to give you thousands of
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 )
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 )
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 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.