Blender Git Loki

Git Commits -> Revision 23f5407

Revision 23f5407 by Mateo de Mayo (master)
August 3, 2015, 22:10 (GMT)
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

Commit Details:

Full Hash: 23f54076db6d241af2a8f9404ab5f5b8072a4db0
Parent Commit: 73522e1
Committed By: Porteries Tristan
Lines Changed: +65, -4

7 Modified Paths:

/doc/python_api/rst/bge_types/bge.types.KX_GameObject.rst (+10, -0) (Diff)
/source/gameengine/Ketsji/BL_Action.cpp (+12, -0) (Diff)
/source/gameengine/Ketsji/BL_Action.h (+2, -0) (Diff)
/source/gameengine/Ketsji/BL_ActionManager.cpp (+6, -0) (Diff)
/source/gameengine/Ketsji/BL_ActionManager.h (+5, -0) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+24, -4) (Diff)
/source/gameengine/Ketsji/KX_GameObject.h (+6, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021