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/PyDoc/KX_SCA_AddObjectActuator.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py') diff --git a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py index 44f9e051c8c..4f2bf85bff3 100644 --- a/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py +++ b/source/gameengine/PyDoc/KX_SCA_AddObjectActuator.py @@ -13,7 +13,7 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): C{ERROR: GameObject I{OBName} has a AddObjectActuator I{ActuatorName} without object (in 'nonactive' layer)} """ - def setObject(obj): + def setObject(object): """ Sets the game object to add. @@ -21,17 +21,18 @@ class KX_SCA_AddObjectActuator(SCA_IActuator): If the object does not exist, this function is ignored. - obj can either be a L{KX_GameObject} or the name of an object. + object can either be a L{KX_GameObject} or the name of an object or None. - @type obj: L{KX_GameObject} or string + @type object: L{KX_GameObject}, string or None """ - def getObject(): + def getObject(name_only = 0): """ Returns the name of the game object to be added. Returns None if no game object has been assigned to be added. - - @rtype: string + @type name_only: bool + @param name_only: optional argument, when 0 return a KX_GameObject + @rtype: string, KX_GameObject or None if no object is set """ def setTime(time): """ -- cgit v1.2.3