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:
2009-05-06 09:12:08 +00:00
parent 25b415f310
commit c1e1091f02
10 changed files with 266 additions and 164 deletions

View File

@@ -440,7 +440,7 @@ class Vector:
Example::
wrappedObject = Object.getAttribute() #this is wrapped data
print wrappedObject.wrapped #prints 'True'
copyOfObject = Object(wrappedObject) #creates a copy of the object
copyOfObject = wrappedObject.copy() #creates a copy of the object
secondPointer = wrappedObject #creates a second pointer to the same data
print wrappedObject.attribute #prints '5'
secondPointer.attribute = 10
@@ -564,7 +564,7 @@ class Euler:
Example::
wrappedObject = Object.getAttribute() #this is wrapped data
print wrappedObject.wrapped #prints 'True'
copyOfObject = Object(wrappedObject) #creates a copy of the object
copyOfObject = wrappedObject.copy() #creates a copy of the object
secondPointer = wrappedObject #creates a second pointer to the same data
print wrappedObject.attribute #prints '5'
secondPointer.attribute = 10
@@ -652,7 +652,7 @@ class Quaternion:
Example::
wrappedObject = Object.getAttribute() #this is wrapped data
print wrappedObject.wrapped #prints 'True'
copyOfObject = Object(wrappedObject) #creates a copy of the object
copyOfObject = wrappedObject.copy() #creates a copy of the object
secondPointer = wrappedObject #creates a second pointer to the same data
print wrappedObject.attribute #prints '5'
secondPointer.attribute = 10
@@ -760,7 +760,7 @@ class Matrix:
Example::
wrappedObject = Object.getAttribute() #this is wrapped data
print wrappedObject.wrapped #prints 'True'
copyOfObject = Object(wrappedObject) #creates a copy of the object
copyOfObject = wrappedObject.copy() #creates a copy of the object
secondPointer = wrappedObject #creates a second pointer to the same data
print wrappedObject.attribute #prints '5'
secondPointer.attribute = 10