[Help] How to switch animation in an object?

edited October 2011 in Help request
Hi,

I am working on getting animations displayed by using orx. There a question about it. Any answers would be much appreciated :)

In orx, is it possible that an object could contain multiple animation set? Based on the reference here
http://orxproject.org/wiki/en/orx/config/settings_structure/orxobject
It seems that each orx object can only contain single AnimationSet. If I want to create composite animation I have to create multiple object for single animation. That does not sound correct to me.


Thanks!


Rong

Comments

  • edited October 2011
    Hi rong.yang. Could you could switch animation sets with orxObject_SetAnimSet to another animation set?
  • edited October 2011
    As sausage pointed out, you can switch to a different AnimSet at runtime. However my question is more why would you do that?

    I guess that it all boils down to the concept for 'composite' animation. I'm not sure what you mean by that. :)

    Would you mind providing us with more details on what you want to achieve?

    Cheers!
  • edited October 2011
    hi,

    Sorry about did not explain the 'composite' animation while I asked the question :p. Here is an example ~~~ In a character walking animation, I think I could separate the character into different parts, body, arms and legs and rendering them separately. For rendering the walking animation, I only need to create textures about the legs' and arms' movement, but not the body. In the render stage, I need to render all those parts together. By doing that, I think I could some hard drive space but need more artist works.

    Thanks for your replies!

    Cheers!

    Rong
  • edited October 2011
    Mmh, if I understand correctly, this sounds like a mix of traditional sprite animation and skeletal animation (as in what is done with vector graphics in flash, for example).

    That's the first time I've seen such approach. But yes, if you want to use orx's animation system, you'll need an object hierarchy and create your own SetAnim wrapper functions that will go through the hierarchy and apply the corresponding animation, by using a suffix based on the bodypart, for example.
    I began to work on a skeletal animation system for orx in a branch, but it'll use an object hierarchy too. It'll use animation keys to apply interpolated values of position, rotation and scale on the object children. It's something that can already be done on the user side but I want to formalize an easy way to do it in orx, using config files and adding the concept of animation channels.

    But anyway, yes, I'm afraid you need to have a hierarchy of objects as mentioned earlier unless you want to listen to the render object events and manage your own custom animation/rendering code for those objects.

    Cheers!
Sign In or Register to comment.