[Fwd: Re: [Bf-python] newbie]
Michel Selten
michel.s at home.nl
Tue May 13 19:39:38 CEST 2003
On Tue, 2003-05-13 at 03:47, Willian Padovani Germano wrote:
> On Mon, 2003-05-12 at 22:11, guignot wrote:
> > b) I am studying Blender code, and I don't understant how the Blender
> > module gets the
> > link, bylink and event members. Could someone explain me?
>
> The linking and parenting parts haven't been done yet, this will be our
> next goal after all basic modules are in place. Due to the basic
> structure of Blender objects and the 2.25 API, they haven't been
> necessary to write and test most of the functionality in each module.
Well, there are 2 link parts in the API. One of them is implemented, the
other one I'm working at :)
* link, bylink events
These get emitted by Blender at some point depending on the event type
(frame changed, redraw, ...).
In source/blender/python/BPY_interface.c, you'll find some functions
that take a (short event) as one of the arguments. This defines the
type of event the scripts are invoked. In the function BPY_do_pyscript
I loop through all objects of a specific type, looking for the link
and bylink flags settings. From there on, the script is called with
the appropriate object as the to-be-manipulated object.
* data link objects
The Object module describes general data for each object, be it a
Camera, Lamp, Mesh or whatever. This functionality is not yet
implemented, but I'm working on it. I must say that it's a little more
complicated than I expected :)
> > c) What about security? Suppose I send someone a blender file, with some
> > objects linked to an aggressive python script.
> > Will the script be executed ?
This is a very good point you're making!
A script can be executed at load time (OnLoad event), so this can be
just as dangerous as those famous e-mail virusses that are spreading
around the world. And the funny thing is - such a virus can now run on
more platforms than just Windows :)
Wee, I can see those headlines on Slashdot already!
With regards,
Michel
More information about the Bf-python
mailing list