I may have found a bug. Here’s some sample code:
#!BPY
from Blender import Draw
FOO=Draw.Create(.5)
def gui():
global FOO
s=get_text()
exec s
def get_text():
s="FOO=Draw.Number('Foo',1,10,10,150,25,FOO.val,.0,1.0,'funk')"
return s
def event(evt,val):
if not evt:return
print FOO
if evt==Draw.ESCKEY:
Draw.Exit()
def bevent(evt):
pass
Draw.Register(gui,event,bevent)
What happens when I run this is that the FOO variable cannot be changed. Well, it can be changed with the button, but then if I mouse around to another window, it returns to it’s default value. I was trying to write a function that creates a string to be passed back to the gui function to be run. It’s not working the way I thought it would.