I’m currently stuck at animating a model. It’s an aeroplane rigged and animated in blender. Exporting and playing single animations works without problems.
Now to the problem:
The plane has multiple animations for its particular parts (e.g. landing gear, windscreen, rudder, ailerons and so on), which are defined by joints (Better overview here).
I can play single animations without any problems, but when i start another one at the same time, the previously started one is stopped and reset. I’ve read that you need to define subparts to get the animations working without disturbing each other and blending, but that doesn’t really work. I’ve tried many different approaches studying the methods from the Actor class API - also the seemingly outdated and complicated one from the manual. I’ve also tried to make subparts from joints and bind the animations to those - which seemed most logical. So far nothing worked as it should.
Anybody an idea how this is supposed to be used?
Does it play a role how i export or load the parts and animations? I’ve tried with everything packed into one egg and with separately saved animations.
Does anybody maybe have a working animated multipart actor?
i have worked with a non-multipart actors, even there you have to take care that you dont “overwrite” animations of bodyparts when playing multiple animations at the same time. the mayor problem lies within the exporting. iirc you have to take care that you only have keys in that animation that are relevant for this bodypart.
none of my joints share vertices with others and all animations are animating only up to two joints at the same time.
by the way, i believe there is a bug in direct/src/actor/Actor.py in the method __bindAnimToPart in line 2352 (as of 1.6.2). It expects an animation to have a filename attribute, which is None if the animation was not loaded from a separate egg.
and… how do you actually load animations separately from eggs where multiple animations (and a model) are storedin one file?
thanks for the response, but that’s something else. what you’ve done is also already used in the Looking and Gripping sample. it’s about controlling a joint procedurally and getting a joint’s transforms. what i am looking for is playing multiple animations on the same actor at the same time without blending.
Do i understand it correctly:
i have a model that has two subparts, torso and legs.
i loop run on legs and loop run on torso, then i can play attack on torso yet the feet keep running, i can pose,loop,play torso for what i want and i can do the same for legs with a separate animation.
If that is what you want then the multipart model,that is described in the manual will do it.
For your plane:
You create 3 subparts:propeller,landing gear,flaps.
So you can, loop propeller,play landing gear in,pose landing gear,play flaps out,pose flaps and you can of course play any anim from 1 to -1(forwards or backwards at any speed you like).
well that snippet do a little more actually: it programatically load and stick animated models over the panda and animate them as well. in that snippet all of them uses the same rig bones and the same animations and I synced them but in effect the are running in parallel non as a whole, therefore I don’t see why I cant’ apply different animations for each part involved instead to synch them.
I didn’t want to go too much into detail, but my plane has about 19 parts and exporting each one in a separate egg file seems more than suboptimal to me. Imagine you also have at least two animations for each part.
This already makes over 60 files for only one plane!
Beside, the manual is very incomplete. There are methods in the Actor class that enable you define subparts from joints. My only problem is that there are so many ways to load animations, define subparts and connect them all. There’s no straightforward way and all i’ve tried so far didn’t work out as expected.
still, you’re working with one part (“modelRoot”) all the time and playing only one animation at a time.
what i am trying to do is having multiiple animations playing independently of each other on the same actor. that’s only possible with subparts. in the actor model you define those subparts and attach animations to the single parts, so that panda doesn’t think of the animations they’re affecting the whole model (which makes playing multiple animations at the same time without blending impossible), but only their parts.
think of it as multiple models put together - every having its own animations and able to play those independently of the other models. the actor class actually should give you thins functionality within one actor as the whole and multiple subparts playing their animations - i write “should”, because i can’t get it working…
yeah thinking about after a good supper now I guess I’m into your problematic a little bit more and I must say that that multipart feature is not what you need - so, since looks like you just need to rotate single joints, am I wrong or it is just enough to expose those joints you need to move and just rotate when need to with Lerp functions?
So lets say your plane has:
and you want to have
0-brazillian groups or subparts
and every group has
So you have to export your model + animations from blender 1 time.(or many if you export separate animation files)
You have to define subparts in panda 1 time.
You can choose what animation what subpart plays,loops or poses godzillion+brazillian+gazillion time during runtime.
I know only two ways of loading animations,
one way of defining subparts
and you cant connect subparts(you can connect multipart models)
So in my cast the answer is always more simple than i want to admit and i curse my self too often for that.
Found the issue. Big thanks to Hypnos!
You can create subparts from bigger models on the fly as long as it’s rigged correctly. The animations all need to be saved separately, as the Actor interface intends all-in-one files for single-part actors (at least the init sees it so). To bind an animation to a subpart you have to load your anims with loadAnims() and that function requires one file per animation, so loading from an all-in-one file is impossible here, i guess.
EDIT: also Actor.__bindAnimToPart() expects the animations to have filenames.