AnimComposer - Get Current Action

HI Guys,
I need to know the current action running by the AnimComposer.
While we have setCurrentAction method, we don’t have getCurrentAction…
So can I obtain this information from the AnimComposer or I need to store it somewhere in my code?

Thanks!

1 Like

Hi @adi.barda,
I (also?) started looking into the animation capabilities recently. In TestOgreAnim the currently running action gets stored, so I would take that as a hint, that you cannot get it any other way … But someone else might want to clarify …

I think it’s because it’s not entirely straight forward. Actions are actually run on layers… and setCurrentAction() without a layer is just doing it on the default layer.

I don’t actually know, though. I usually just keep a reference around to the action I ran… but it’s so rare to need to know the current action for me.

A PR for this is welcome :slightly_smiling_face:

1 Like

Looking at the code, this actually is a low hanging fruit. Layer-respecting removeCurrentAction is already there …

3 Likes

We also don’t have access to the layers collection otherwise it was sufficient to get the current action from the desired layer