Saving and using only animations in jme format

I reaching the point where its about time to bring my own characters and assets into jme3 but I have an issue all the docs suggests that for animated models it is best to name all the parts i.e meshes, materials, animation with the same name, however in my cased each model wont have their own animations, but would build a “mutable” profile from one large library, there are three skeletal builds at present, all being more or less the same but two have different combos of additional bones, I’ve already conceded that I have to export the animations three times to match the different builds, but each build could have 6+ character model variants, and at last count, I had 50+ actions and growing, its cumbersome to export all that for every character.



Is there a way directly or indirectly to have models share animations or maintain animations in the form of a universal library

mhh there’s no easy way to do this as animation can’t be imported without a model, but once it’s loaded you can duplicate bone animations to add them to other models.

But you will need to re-target the anim to the correct bone as bone indices can differ from one skeleton to another (if as you said the structure is a bit different)



first try with exact same skeletons, get all the BoneAnimation from the AnimControl, clone them and add them to the 2nd model’s AnimControl.

nehon said:
mhh there's no easy way to do this as animation can't be imported without a model, but once it's loaded you can duplicate bone animations to add them to other models.
But you will need to re-target the anim to the correct bone as bone indices can differ from one skeleton to another (if as you said the structure is a bit different)

first try with exact same skeletons,, get all the BoneAnimation from the AnimControl, clone them and add them to the 2nd model's AnimControl.


well I have no issue exporting the library once per skeleton variant, I said as much, just not clearly, but my issues lies chiefly with exporting animations once per "model variant" that's like 18+ times to export 50+ animations in my case.... where as I could have exported just three times to match three skeletons if animations could be maintained separately......somehow

hmm well I know this is late but maybe it can help someone else

I know you can load the skeleton.xml data that exporting it as ogre gives as

AnimData animation = (AnimData) assetManager.loadAsset(location);

then you can add the animation to the model via



AnimControl ctrl = spat.getControl(AnimControl.class);

for (AnimData data : animData){

for(BoneAnimation anim :data.anims){

ctrl.addAnim(anim);

}

}



this only works however if the bones are all the same i think it will throw some error if their is a discrepancy…or worse it won’t throw an error but that bone wouldn’t update in position so if you added an extra section to say a tail it would go into idle position which wouldn’t look pretty

You will have to export the models anyway, wheres the problem exporting the animations with them?

just seemed cumbersome and “heavy” constantly exporting common data (that’s still growing) and then each model instance wont use all the animation data, just a fraction and I also want the ability to change that fraction



I suppose I should give an idea of what I am doing:

in the jme2 project I was using md5 which meant I had the animation data separate,

three skeletal builds 2 for males and one for females …so I only had to export the animations(alot of them) 3 times to match each skeleton as such I had three libraries one per skeleton and then only worry about exporting models after that.



each model instance would then be assigned a “moves list” …basically an array list of actions from the lib that they were allowed to use, a list that could be adjusted or changed at any given time…it was my way of making characters seem dynamic or unpredictable



in my game I dont want my characters to have “set” attacks that the player can get used to

so far I have boxing, kickboxing, bits of capoiera, what I like to call “rough neck brawling” and I am working on systema, krav maga, jeet kundo blah blah blah blah :roll:

Yes the main issue being pointed out is that you can have 100’s of models but only 1 skeleton + animation data that you want to use. In that case it is more efficient to just export the skeleton/animation data once and then reuse it for everything

Yes, I see the “useless data” thing… But if you load the model in the model editor and then have to export it anyway, is it really so much work to apply the animation to it before?

yeah but the problem comes when you have say 10 or more models that all share the same rig what happens when you slightly modify an animation or at new ones you would be forced to update each manually it would just be easier if you separated the animating process from the models that way you can work on a master rig and animations for all models plus it gets annoying after a while repeatedly exporting your model to conform with miner updates in animation =p

Momoko_Fan said:
Yes the main issue being pointed out is that you can have 100's of models but only 1 skeleton + animation data that you want to use. In that case it is more efficient to just export the skeleton/animation data once and then reuse it for everything


yeah I took note of what bonechilla said thanks bonechilla


normen said:
Yes, I see the "useless data" thing.. But if you load the model in the model editor and then have to export it anyway, is it really so much work to apply the animation to it before?


have you ever "heavily" used the ogre exporter depending on the amount of animations it can be a long process filling out the list, again if you have alot of animation it just would be less time consuming to do this once per skeleton ....and now I know how ;)