BGE: Added getActionName() function to KX_GameObject()
authorMateo de Mayo <mateodemayo@gmail.com>
Mon, 3 Aug 2015 21:47:46 +0000 (23:47 +0200)
committerPorteries Tristan <republicthunderbolt9@gmail.com>
Mon, 3 Aug 2015 22:10:33 +0000 (00:10 +0200)
commit23f54076db6d241af2a8f9404ab5f5b8072a4db0
treec13d269da7a6414e0d121f1254afcf16b8541864
parent73522e1157eba1f475454c153f7c027f5dd097ea
BGE: Added getActionName() function to KX_GameObject()

It works similar to getActionFrame(), you have to give a layer or not (for layer 0) as the argument and it returns the name of the animation that the object is currently playing.

Example:

```
import bge
own = bge.logic.getCurrentController().owner
own.playAction("SomeAction",0,20)
print(own.getActionName())
```
>> SomeAction

Here is an example file, just open the blend file with the terminal opened
and press P, you can see how the current animation is being printed:
{F217484}

Reviewers: moguri, hg1, panzergame, campbellbarton

Reviewed By: panzergame

Subscribers: campbellbarton, hg1, #game_engine

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1443
doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst
source/gameengine/Ketsji/BL_Action.cpp
source/gameengine/Ketsji/BL_Action.h
source/gameengine/Ketsji/BL_ActionManager.cpp
source/gameengine/Ketsji/BL_ActionManager.h
source/gameengine/Ketsji/KX_GameObject.cpp
source/gameengine/Ketsji/KX_GameObject.h