I guess what I'm looking for is a way to have a "global" GUI and sub
GUIs that appear based on the "application state", i.e. ShaderEditor,
Shader assignment, etc. <br>
<br>
The thought was to have a set of buttons that were always visible on
the screen, and use those for notifying the script of a state change,
so I could do some cleanup if neccessary, and maybe save some data
before launching another part of the script that would rely upon data
that I've created (but not saved).<br>
<br>
As an example, see <a href="http://www.stormwind-studios.com/Misc/Blenderman.jpg" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://www.stormwind-studios.com/Misc/Blenderman.jpg</a> <<br>
<br>
The buttons at the top of the script are the ones I'd like to be
persistent across the board, and everything below that depends upon
state variables.<br>
<br>
Using the Registry isn't a bad idea, tho I wonder about it
performance-wise.  I suppose I could maintain the same set of
global buttons per script, tho.<br>
<br><div><span class="gmail_quote">On 1/18/06, <b class="gmail_sendername">Willian Padovani Germano</b> <<a href="mailto:wgermano@superig.com.br" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
wgermano@superig.com.br</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Bobby Parker wrote:<br>> Can you suggest a better method of developing a script in such a fashion<br>> that several people can work on components of it?<br><br>I don't know the details of how your script should work, so please point
<br>any problem with my suggestions.<br><br>Blender.Run() can be used to execute another script. If your data is<br>kept in a place accessible to all scripts (*), you can open each<br>component as a separate script, with its own gui, called with
<br>Blender.Run() from the master script.<br><br>(*) aka anywhere outside that script's global dict. The Registry dict<br>would be the fastest, but Blender texts, external files or an external<br>database are other possibilities, depending on the type and amount of
<br>data you need.<br><br>If one script changes data used by others or sets state info that other<br>scripts need, just be sure to get / check this data in the draw<br>callbacks, because these all always executed when you move to a script's
<br>gui and thus you will get the current value of the needed data.<br><br>So you can divide your script: one dealing with the data (and a place<br>where the data is stored), module(s) with common functions and "light"
<br>ones to display the guis.<br><br>> Also, I'm not following your above indicated method, rather I'm doing<br>> import from math.* since the Register() function doesn't appear to be<br>> happy with callbacks stored in a module (as in 
ShaderEditorGUI.draw()),<br>> since that loads the functions/variables I need into the current<br>> namespaces( at least I think/hope that's what's happening, and results<br>> seem to bear me out).<br><br>Saving a function is not enough, you'd also need to store everything it
<br>used (which can be cumbersome for methods, complex functions, etc), or<br>some references are lost. The simplest is to only store very basic data<br>(numbers, strings) in the Registry, not Blender objects, functions, etc.
<br><br>Yep, I understood math was only an example Toni used in his email and<br>used it as an example, too (sorry if I "sounded" harsh or anything).<br><br>There are multiple ways to create the data for shader parameters and
<br>keep it around to create guis dynamically, you know. I didn't test your<br>code, but if you're saving created Blender buttons, that might cause the<br>crashes (String buttons come to mind). Try to save only the info needed
<br>to recreate the buttons.<br><br>Feel free to keep discussing, we all benefit from it (and we enjoy<br>Python :) ).<br><br>--<br>Willian<br>_______________________________________________<br>Bf-python mailing list<br>
<a href="mailto:Bf-python@projects.blender.org" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">
Bf-python@projects.blender.org</a><br><a href="http://projects.blender.org/mailman/listinfo/bf-python" target="_blank" onclick="return top.js.OpenExtLink(window,event,this)">http://projects.blender.org/mailman/listinfo/bf-python
</a><br></blockquote></div><br>