From 96a7e478b6ef0c9f4b15e27ab22db548bbab1fe5 Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sat, 10 Jul 2010 21:15:10 +0000 Subject: 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 --- source/blender/makesrna/intern/rna_actuator.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'source/blender/makesrna/intern/rna_actuator.c') diff --git a/source/blender/makesrna/intern/rna_actuator.c b/source/blender/makesrna/intern/rna_actuator.c index 2a29f3332b5..e7031ad8517 100644 --- a/source/blender/makesrna/intern/rna_actuator.c +++ b/source/blender/makesrna/intern/rna_actuator.c @@ -486,6 +486,8 @@ void rna_def_actuator(BlenderRNA *brna) RNA_def_property_boolean_sdna(prop, NULL, "flag", ACT_SHOW); RNA_def_property_ui_text(prop, "Expanded", "Set actuator expanded in the user interface"); RNA_def_property_ui_icon(prop, ICON_TRIA_RIGHT, 1); + + RNA_api_actuator(srna); } static void rna_def_action_actuator(BlenderRNA *brna) -- cgit v1.2.3