diff options
author | Campbell Barton <ideasman42@gmail.com> | 2008-08-14 12:58:25 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2008-08-14 12:58:25 +0400 |
commit | 47c2271d673173ee93b9d91926de9ea41415d411 (patch) | |
tree | 0a13432423c321cd415a4ea5771e89d7ee56d3d9 /source/gameengine/Ketsji/KX_GameObject.h | |
parent | 639f3e12a98f6459cb1f7d948e7a3f2658570b31 (diff) |
Python API get/setObject update for Actuators. (SetParent, AddObject, Camera and TrackTo)
* bugfix for BGE python api - SetParent actuator getObject would segfault if the object was not set.
* Added utility function ConvertPythonToGameObject() that can take a GameObject, string or None and set the game object from this since it was being done in a number of places.
* allow setObject(None), since no object is valid for actuators, Python should be able to set this.
* added optional argument for getObject() so it returns the KX_GameObject rather then its name, would prefer this be default but it could break existing games.
Diffstat (limited to 'source/gameengine/Ketsji/KX_GameObject.h')
-rw-r--r-- | source/gameengine/Ketsji/KX_GameObject.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 4e435e9ddf4..a7ac2d75a93 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -48,6 +48,7 @@ #include "KX_KetsjiEngine.h" /* for m_anim_framerate */ #include "KX_IPhysicsController.h" /* for suspend/resume */ #include "DNA_object_types.h" +#include "SCA_LogicManager.h" /* for ConvertPythonToGameObject to search object names */ #define KX_OB_DYNAMIC 1 @@ -775,5 +776,8 @@ private : }; +/* utility conversion function */ +bool ConvertPythonToGameObject(PyObject * value, KX_GameObject **object, bool py_none_ok); + #endif //__KX_GAMEOBJECT |