diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2010-07-11 01:15:10 +0400 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2010-07-11 01:15:10 +0400 |
commit | 96a7e478b6ef0c9f4b15e27ab22db548bbab1fe5 (patch) | |
tree | c1c326457af385fbe455e310f16d77c7daaf8238 /source/blender/blenkernel/BKE_sca.h | |
parent | e531f3736df13d9143f4b4c7589d65b12df1ff1b (diff) |
Logic Editor Python API: link/unlink logics through python
After initial talk with Matt (awhile ago) we realzed that rna_api would fit well for this instead of an operator.
The next step would be to move the current UI code to use the rna funcs instead.
Note: it takes the s/c/a as argument, not its name. (e.g. cont.link(actuator=act) )
Sample code to link all the logic bricks between each other:
ob = bpy.context.object
for cont in ob.game.controllers:
for sens in ob.game.sensors:
cont.link(sensor=sens)
for act in ob.game.actuators:
cont.link(actuator=act)
For a script to create bricks, link bricks, unlink bricks and remove them:
http://www.pasteall.org/14266
Diffstat (limited to 'source/blender/blenkernel/BKE_sca.h')
-rw-r--r-- | source/blender/blenkernel/BKE_sca.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_sca.h b/source/blender/blenkernel/BKE_sca.h index b1df32d5cd7..7adbfd9b48d 100644 --- a/source/blender/blenkernel/BKE_sca.h +++ b/source/blender/blenkernel/BKE_sca.h @@ -37,6 +37,9 @@ struct Object; struct bController; struct bActuator; +void link_logicbricks(void **poin, void ***ppoin, short *tot, short size); +void unlink_logicbricks(void **poin, void ***ppoin, short *tot); + void unlink_controller(struct bController *cont); void unlink_controllers(struct ListBase *lb); void free_controller(struct bController *cont); |