Blender Git Commit Log

Git Commits -> Revision 136d4c3

Revision 136d4c3 by Campbell Barton (master)
May 10, 2009, 01:48 (GMT)
deprecate controller.getActuator(name) and controller.getSensor(name) for
controller.actuators[name] and controller.sensors[name]

Made a read-only sequence type for logic brick sensors and actuators which can access single items or be used like a list or dictionary.
We could use a python dictionary or CValueList but that would be slower to create.

So you can do...
for s in controller.sensors: print s

print controller.sensors["Sensor"]

print controller.sensors[0]

sensors = list(controller.sensors)

This sequence type keeps a reference to the proxy it came from and will raise an error on access if the proxy has been removed.

Commit Details:

Full Hash: 136d4c34badc12b72f5c3541fcdaf2b1459af408
SVN Revision: 20124
Parent Commit: f155da0
Lines Changed: +465, -52

2 Added Paths:

/source/gameengine/Ketsji/KX_PythonSeq.cpp (+384, -0) (View)
/source/gameengine/Ketsji/KX_PythonSeq.h (+60, -0) (View)

5 Modified Paths:

/source/gameengine/Expressions/PyObjectPlus.cpp (+0, -1) (Diff)
/source/gameengine/GameLogic/SCA_IController.cpp (+9, -21) (Diff)
/source/gameengine/Ketsji/KX_GameObject.cpp (+4, -24) (Diff)
/source/gameengine/PyDoc/KX_GameObject.py (+3, -3) (Diff)
/source/gameengine/PyDoc/SCA_IController.py (+5, -3) (Diff)
By: Miika HämäläinenLast update: Nov-07-2014 14:18MiikaHweb | 2003-2021