[Bf-python] Access of logic bricks via python API

Matthieu Delanoë matthieu.delanoe at gmail.com
Thu Jan 17 19:52:58 CET 2008


On Jan 17, 2008 6:42 PM, Carsten Wartmann <cw at blenderbuch.de> wrote:
> Matthieu Delanoë schrieb:
> > Hi!
> >
>
> Hello!
>
> [...]
> > Since last week I've been working on the access of logic bricks in
> > Python. I'm totally new to the development of Blender, but as far as I
> [...]
> >>From my tiny description above, do you think this is the right way of
> > adding this access to the API, or is there a better way for doing
> > this?
>
> So you want to create Logic Bricks during runtime of the GameEngine? Or
> from "normal" Blender?
>
> I can`t see a use for creating LBs from the GE, maybe it is usefull from
> normal Blender (I can think of some smart helper scripts etc.).
>
> But the normal way of using the GE is to first prototype with LBs, then
> in the end you will always end up with
>
> Always->Python
>
> Maybe some Actuators.
>
> So I cant see really a use for your Idea. Can you elaborate?
>
> Best Regards,
> Carsten
> --
> Carsten Wartmann: Autor - Dozent - 3D - Grafik
> Homepage:         http://blenderbuch.de/
> Das Blender-Buch: http://blenderbuch.de/redirect.html
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>


Hi Carsten,

Of course that I can elaborate! ;-)
What I've done allows python scripts in "normal" Blender to create,
access and modify logic bricks (just the same way you would create
Modifiers), and the ability to link them, remove links, etc. If you
tried it, it's exactly like the blendGame plugin, but right inside
Blender source code, with a different structure, and with full support
of all bricks.

What do I intend to do with it? Well, you hit the nail on the head: I
want to build helpers to add more or less complex objects with logic,
and automate this process. In fact some of my helpers are already
coded, but with the help of blendGame, and sometimes there are some
memory leaks while using it (I think). And as blendGame is a compiled
code, it's possible that it may not be compatible with upcoming
releases of Blender, so that's why I integrated it in Blender.

My helper is mainly (right now) a camera builder that recreates the
"Blender 3D view movement" on a GE camera : you can navigate in the GE
just like in Blender (don't know if this is clear enough). This helper
can create as many camera of this kind as you want, and you can also
add a "camera switcher" which will switch between all those camera in
the GE. I'll post this little app on blenderartists next week with a
demo (the blendGame version for now, and the one based on this patch
later).

Well I think such automation tools could be useful to GE users.

Thanks for your quick reply!
-- 
Matt



More information about the Bf-python mailing list