blender/source/gameengine/PyDoc/SCA_PythonController.py
Campbell Barton c1e1091f02 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]
2009-05-06 09:12:08 +00:00

42 lines
975 B
Python

# $Id$
# Documentation for SCA_PythonController
from SCA_IController import *
class SCA_PythonController(SCA_IController):
"""
A Python controller uses a Python script to activate it's actuators,
based on it's sensors.
Properties:
@ivar script: the Python script this controller executes
@type script: string, read-only
@group Deprecated: getScript, setScript
"""
def activate(actuator):
"""
Activates an actuator attached to this controller.
@type actuator: actuator or the actuator name as a string
"""
def deactivate(actuator):
"""
Deactivates an actuator attached to this controller.
@type actuator: actuator or the actuator name as a string
"""
def getScript():
"""
DEPRECATED: use the script property
Gets the Python script this controller executes.
@rtype: string
"""
def setScript(script):
"""
DEPRECATED: use the script property
Sets the Python script this controller executes.
@type script: string.
"""