Page MenuHome

Short patch to make spacehandler event scripts work more like normal python gui script handlers
Closed, ArchivedPublicPATCH


There is allready a mail on the mailing list about this, but since i got no reply i've created this post.

Short what the patch does:

When writing spacehandler event scripts the current event is passed in


but there is no event value. For those who don't know: gui scripts also need an
event handler and it has the form of: handle(event, value). So to read all the
information you need about an event you also need it's value part.

Because spacehandler event scripts does not get this value it must get the value with Window module functions, which are reallly slow, and it's totaly against the normaly event handling philosophy as far as i can see.

i've just added the "eventValue" argument for the python spacehandler function
and added Blender.eventValue to pass the eventvalue also to the handler.

It would help alot to make spacehandlers more similar to normal gui handlers, that would help my current script allot.

Steven Truppe

Event Timeline

Friendly bump at William to give his opinion?
Steven: i'm not familiar with this part of code, but would this mean old scripts break?


Answering Ton: the scripts get these values from vars: Blender.event and, with this patch, Blender.eventValue, no callbacks involved. So, no incompatibility with old spacehandler scripts.

Steven: thanks for the patch, sorry for taking this long to add it. Since it was small, I edited myself each file, so any problem is my fault. I just changed from unsigned short to short to follow the definition in BWinEvent struct. I also updated the docs.


Willian Padovani Germano (ianwill) changed the task status from Unknown Status to Unknown Status.Sep 19 2008, 8:52 PM