From 47c2271d673173ee93b9d91926de9ea41415d411 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Thu, 14 Aug 2008 08:58:25 +0000 Subject: 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. --- source/gameengine/Ketsji/KX_ParentActuator.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'source/gameengine/Ketsji/KX_ParentActuator.h') diff --git a/source/gameengine/Ketsji/KX_ParentActuator.h b/source/gameengine/Ketsji/KX_ParentActuator.h index 93b07cd424b..e2b30ba2d0f 100644 --- a/source/gameengine/Ketsji/KX_ParentActuator.h +++ b/source/gameengine/Ketsji/KX_ParentActuator.h @@ -79,9 +79,9 @@ class KX_ParentActuator : public SCA_IActuator virtual PyObject* _getattr(const STR_String& attr); /* 1. setObject */ - KX_PYMETHOD_DOC(KX_ParentActuator,SetObject); + KX_PYMETHOD_DOC_O(KX_ParentActuator,SetObject); /* 2. getObject */ - KX_PYMETHOD_DOC(KX_ParentActuator,GetObject); + KX_PYMETHOD_DOC_VARARGS(KX_ParentActuator,GetObject); }; /* end of class KX_ParentActuator : public SCA_PropertyActuator */ -- cgit v1.2.3