[Bf-python] Re: Presets - mail I sent a week or so ago

Ted Schundler tschundler at gmail.com
Sat Dec 25 03:01:45 CET 2004


I got the message OK. And as for your problem with the updates, it's a
little weird that it's running the script asyncronously, but I'm not
all that familiar with how Blenders works with python.
I'd imagine perhaps the simplest solution would be to setup a python
function to refresh menus. So any script (preset export, theme export,
whatever someone thinks of next) can trigger a menu update when
applicable via Blender.UpdateMenus() or some similarly named call.

For example, in source/blender/python/api2_2x/Blender.c:
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Blender.c,v
retrieving revision 1.48
diff -r1.48 Blender.c
136a137,139
> static char Blender_UpdateMenus_doc[] =
>       "() - Update Python Script Menus";
> 
148a152,153
>       {"UpdateMenus", &Blender_UpdateMenus, METH_VARARGS,
>          Blender_UpdateMenus_doc},
435a441,450
> 
> /*****************************************************************************/
> /* Function:          Blender_UpdateMenus              */
> /* Python equivalent: Blender.UpdateMenus                      */
> /*****************************************************************************/
> static PyObject *Blender_UpdateMenus( PyObject * self, PyObject * args )
> {
>         /*PUT UPDATE MENU CODE HERE*/
>       return Py_None; 
> } 


Put the code to update the menus in there, then call that from your
python script.

Ted


On Sat, 25 Dec 2004 00:01:57 +1100, Matt Ebb <matt at mke3.net> wrote:
> Hi, just checking, did anyone receive a mail I sent on the 9th of
> December titled "Presets / help refreshing the menus" ? The reason I
> ask is that on the archives page, it's all screwed:
> http://projects.blender.org/pipermail/bf-python/2004-December/
> 002116.html . If it didn't come through properly, I'll send it again.
> 
> Cheers and happy xmas
> 
> Matt
> 
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
> 
> 
> 
>



More information about the Bf-python mailing list