[Tutor] Command not issued until after escape from loop

David Hutto smokefloat at gmail.com
Mon Mar 15 10:44:43 CET 2010


On Mon, Mar 15, 2010 at 4:53 AM, Alan Gauld <alan.gauld at btinternet.com>wrote:

>
> "David Hutto" <dwightdhutto at yahoo.com> wrote
>
> Caveat: I know zero about Blender... but...
>

I *thought* that since the code was in Python it might be the way I was
executing it. I think now it might be how the other windows are updated in
blender when the command is executed.

>
>  When I execute the script, it shows my main window, then if I
>> press the CKEY it's *supposed* to call the cleanSlate() function,
>>
>> My problem is, it doesn't execute cleanSlate() until I hit the
>> ESCKEY, or the QKEY.
>> ******************************************************************
>> # defining the event handling list
>> def ev(evt, val):
>>     scn = Scene.getCurrent()
>>     if evt == Draw.ESCKEY or evt == Draw.QKEY:
>>              Draw.Exit()
>>     elif not val:
>>            return
>>     elif evt == Draw.CKEY:
>>           cleanSlate(scn)
>>     else:
>>          return
>>
>
>
> Can you insert debvug statements to display values?
> If so I'd try printing the value of val. If it is "False" - ie empty - the
> event function will exit before reaching your code.
>
> Alternatively try moving your elif up above the test for not val.
>
> See if that helps.
>
> --
> Alan Gauld
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100315/1b4095b1/attachment-0001.html>


More information about the Tutor mailing list