moved py controller functions from SCA_PythonController to SCA_IController - the base controller class so python can get the sensors & actuators from any controller (not just SCA_PythonController types)

also deprecated getActuators() and getSensors() for 'sensors' and 'actuators' attributes.

an example of getting every sensor connected to an object.
 all_sensors = [s for c in ob.controllers for s in c.sensors]
This commit is contained in:
Campbell Barton
2009-05-06 09:12:08 +00:00
parent 25b415f310
commit c1e1091f02
10 changed files with 266 additions and 164 deletions

View File

@@ -59,7 +59,7 @@ Documentation for the GameLogic Module.
actuator = co.getActuator("actuatorname")
# Activate an actuator
GameLogic.addActiveActuator(actuator, True)
controller.activate(actuator)
See the actuator's reference for available methods:
- L{2DFilterActuator<SCA_2DFilterActuator.SCA_2DFilterActuator>}
@@ -307,6 +307,8 @@ KX_SCENE_RESUME: See L{KX_SceneActuator}
@var VIEWMATRIX_INVERSE:
@var VIEWMATRIX_INVERSETRANSPOSE:
@var VIEWMATRIX_TRANSPOSE:
@group Deprecated: addActiveActuator
"""
# TODO
@@ -335,7 +337,7 @@ def getSceneList():
"""
def addActiveActuator(actuator, activate):
"""
Activates the given actuator.
Activates the given actuator. (B{deprecated})
@type actuator: L{SCA_IActuator} or the actuator name as a string.
@type activate: boolean