[Bf-committers] Create Link between logic bricks with Python

Dalai Felinto dfelinto at gmail.com
Wed Jun 29 07:18:32 CEST 2011


Sven ,
Alex suggestion is spot on.

If you need to look at the code it's on the api files (e.g. rna_sensors.c)

--
Dalai
On Jun 28, 2011 10:07 PM, "Alex Fraser" <adfries at vpac.org> wrote:
> Hi Sven,
>
> ----- Original Message -----
>> From: "Sven von Brand" <svbrand at alumnos.inf.utfsm.cl>
>>
>> I added the logic brick with
>> bpy.ops.logic.sensor_add(type='ALWAYS',name="Name",object="Cube") and
>> supposed there was something like
>> bpy.ops.logic.link(sensor="",sensobject="", controller="",
>> contobject="") but could not find anything like it.
>
> Try something like this:
>
> ob.game.sensors['Name'].link(ob.game.controllers['And'])
>
> where ob is the object you added the bricks to.
>
> Cheers,
> Alex
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at blender.org
> http://lists.blender.org/mailman/listinfo/bf-committers


More information about the Bf-committers mailing list