[Bf-python] OnSave event -- patch attached to email

Willian Padovani Germano wgermano at ig.com.br
Wed Jul 21 05:35:24 CEST 2004


Hi Joseph (joeedh),

----- Original Message -----
From: "Joseph" <joeeagar at prodigy.net>
To: <bf-python at blender.org>
Sent: Monday, July 19, 2004 8:29 PM
Subject: [Bf-python] OnSave event -- patch attached to email


> Hi, I've written some code to add a OnSave scriptlink.  This new
> scriptlink runs a python script when a user chooses to save a file, but
> before the file is actually saved.  The event is sent from the
> BIF_write_file function in source/blender/src/usiblender.c.  Oh, and I
> used the latest Tuhopuu source, not bf-blender.

Is this event meant to let scripts also save their data when a .blend file
is saved or do you have more in your mind?  Cause possibly it's better to
extend the Draw.Register (see Method_Register in api2_2x/Draw.c) with a
"save" callback that scripts themselves can register, much easier this way.
I was thinking about adding a "quit" callback, so scripts could exit nicely,
saving their data, etc., but your idea about "save" covers that and is more
general.

So could you tell us about your ideas of uses for this new event and what
you think about adding a callback in Draw.Register instead?  Others please
also share your ideas on this.

> There is a small problem, though.  For some reason my build will not
> allow the creation of object or material scriptlinks.  I'm not sure why,
> but I cannot find  anything in my code that could account for this.  Was
> things that way before?

You mean directly on the interface or via the scriptlink methods, like
object.setScriptLink(textname, event) ?  I tested both ways today, for
objects, worked fine here.  Please give more details.

--
Willian, wgermano at ig.com.br




More information about the Bf-python mailing list