forked from bartvdbraak/blender
c1e1091f02
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]
42 lines
975 B
Python
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.
|
|
"""
|
|
|