I would like to write a python script that is able to listen to mouse events when focus is on a 3d view (not only on script window). basically i want to create a tool that can “paint” points within a 3d view. I need mouse position when mouse is dragged over a 3d view.
i tryed this (but it just give mouse coordinates when focus is on the script window):
from Blender.Draw import *
def event(evt, val):
print 'mouse coord: ', XY
Blender.Draw.Register(None, event, None)
thanks in advance for your help