There is a timeline window in Blender, where all animations are played.
But somehow I do not get how exacly replicate the same timeline in game ( when I want just predifined animations to be played ).
If there is a streight way to do that?
There is a timeline window in Blender, where all animations are played.
But somehow I do not get how exacly replicate the same timeline in game ( when I want just predifined animations to be played ).
If there is a streight way to do that?
In Blender Game Engine, all features stem from the SCA concept.
Monster has done a very good series of explainations of the SCA system, but here is a simplified extract:
In order to perform any action, a sensor must trigger a controller, which in turn executes an actuator.
So, to do anything, animations included, you need a sensor, controller, actuator.
The easiest way to play an object’s animations is to:
Create an Always Sensor (Not True Pulse)
Connect it to an AND sensor
Connect the AND sensor to an FCurve (blender 2.5) or IPO (blender2.4*) actuator.
Fill in the neccessary parameters in the fcurve, then press P and watch!
If this is not what your asking, i apologise!
Thanks for your explanation
But it is what I already tried and now I try to avoid.
My thought is that while the concept of action is OK for the game - sometimes it make sense to play ‘video’ of actions.
As far as I get, it is not implemented.
Still it would be nice to know any ideas how to proceed.
Of cause it is possible to add timer and envoke actions based on elapsed time
like described here http://blenderartists.org/forum/archive/index.php/t-30000.html ( not using NLA editor )
but still blender already has all things being arranged .
so if there are any hints on how to use this feature in game engine - that will be great to know,
I might get to the details myself (implement http://blenderartists.org/forum/archive/index.php/t-30000.html for example ), but if anyone has any experience - this will greatly save my time.
edit:effectively -I think I’ve almost done something like what is required ( a log file with events I need and a code which fires messages to controllers when the frame to play animation is achived ).
When using the BGE forget the NLA. You can only use it for preparation, but not with the BGE.
“All” you need is to activate the right actuator (IPO/Action) a the right time.
If you want to play multiple animation synchronized, you need to activate the according actuators in a synchronized way.
E.g. 2 animations start at the same time another one 60 frames later and so on. It is a question when sensors send a True pulse to the actuators.
You can even build a sequence: The actuators allow a frameProp. The frameProp is a (float) property that gets the frame of the current pose. Which means if the animation reaches the end the frameProp will get the last frame number. Please keep in mind that frames arer floats. So you might need to use an property sensor in intervall mode.
It also helps to organize that by using the controller’s state system.
Monster