[Bf-funboard] Question on appending

joeedh joeeagar at prodigy.net
Wed Sep 15 02:36:33 CEST 2004


First, a invaluable tip for developing Blender modules: don't import 
then.  Concatinate the lines from the Text object and run it using 
exec().  Blender will only import from a Text object once.  After that, 
it will NOT reload it, not even if you tell Blender to reload the file.  
You have to physically exit Blender, or maybe open another file, or 
something to clear it.


from Blender import Text
#To make developing BPyGUI easier, we are going to exec the module,
#rather then just importing it, since Blender never re-imports scripts
txt = Text.Get("BPyGUI.py")
str = ""
for s in txt.asLines():
----str = str + s + '\n'

exec(str)
print "Imported BPyGUI.py"
#See, ^that will tell python to include it.

Vania Smrkovski wrote:

>joeedh,
>
>	....But what would be really nice is to have a distribution of Blender 
>include not just scripts but reusable packages and modules for other BPython 
>coders.  My secondary aim for my Project Management software is to provide 
>some utility classes that can be used by others in their scripts, whether 
>they want to bother with the database and project stuff at all.
>
>  
>
I think so too, although my efforts have mainly been aimed at a better 
way of doing GUIs.  I've written a 99.9% Draw-free (it mainly uses BGL) 
GUI library with features like windows, a vertical scrollbar, a textbox, 
an image element that uses PIL.

I've also written a small module I call convkey (shiftdict in certain 
.blends) that can convert keyboard codes to ASCII, with support for the 
shift modifier (e.g. caps), plus the numpad.  Also I've written a 
somewhat limited wrapper for SOLID, the collision detectin api used 
internally by the gameengine.

Right now, however, I need to work on finishing BPyGUI, after which I 
will rewrite PyEffects to use it. 

joeedh


More information about the Bf-funboard mailing list