[Bf-python] Python presets menu

Willian Padovani Germano wgermano at ig.com.br
Fri Feb 11 04:25:53 CET 2005


Matt Ebb wrote:

> I've noticed a problem though, where the menu isn't getting populated 
> correctly on startup. Sometimes it works, but most of the time (for 
> me) it doesn't.

"Sometimes it works" is not my fave sentence in programming : ) ... just 
a possibility: if you add all render presets scripts to a dir, it may 
not be reported as "modified" and so the menus won't be updated from the 
dir contents, I've seen that on linux.  When you force an update that 
happens.  If this is not the problem, then something is a little weird, 
since the buttons are created on the fly and a refresh of py menus 
solves the issue.

The menus are populated in BPY_post_install() called right at startup 
(main() at source/creator/creator.c).  If needed, this can be postponed 
(not BPY_post_install, but BPyMenu_Init(0) inside it, at 
source/blender/python/BPY_interface.c), no problem, as long as 
BPY_post_install is called before BPyMenu_Init, because of U.pythondir.

> If I manually refresh the scripts menus (either in the file paths or 
> in the scripts window menu), then everything will be ok, after a redraw

I don't have tuhopuu3 sources here to tell me more, but I'll play a 
little with the sources and look at  the tuhopuu cvs, too.

> As a related issue, I realised that I can get various field rendering 
> settings ( enableFieldRendering / enableFieldTimeDisable / 
> enableOddFieldFirst ) with BPython, but I can't seem to set them. 
> Would this be possible to add?

Looking at the code, these methods should accept a parameter (like True 
or False) to (un)set them: .enableFieldRendering(True), for example.  
Sorry, not on linux right now, so I can't test myself.  But if they are 
not working, it won't be hard for Joe Gilbert, the original author, or 
one of us to fix.

-- 
Willian




More information about the Bf-python mailing list