[Bf-python] spacehandler links do they work?

Ken Hughes khughes at pacific.edu
Thu Dec 1 15:49:08 CET 2005


Tom M wrote:
> Hi, I can't seem to run even the demo spacehandler scripts for 2.37a nor 2.40rc1
> 
> could someone try the demo one located here?
> 
> http://www.blender3d.org/documentation/237PythonDoc/API_related-module.html
> 
> The one that begins
> 
> # SPACEHANDLER.VIEW3D.EVENT

Yeah, doesn't work as-is, but this seems to work:

# SPACEHANDLER.VIEW3D.EVENT

import Blender
from Blender import Draw
evt = Blender.event

# if Blender should not process itself the passed event,
# set event to None
if evt == Draw.LEFTMOUSE:
   print "Swallowing the left mouse button press"
   Blender.event = None
elif evt == Draw.AKEY:
   print "Swallowing an 'a' character"
   Blender.event = None
else:
   print "Let the 3D View itself process this event:", evt




More information about the Bf-python mailing list