mouseX and mouseY

(Manuel) #1

I’ve a problem with mouseX, mouseY val.
The coordinates that return from this event have the origin
in the left-down corner of the WHOLE Blender windows.

The coordinates in the script windows have the origin in the
the left-down corner of the script-windows.

The mouse coordinates are the same of script only if the
Blender windows is splitted in 2 parts, and the script windows is
in the left parts…

If a user move the script window in another zone of Blender window, the coordinates isn’t the same…

How I can calibrate the mouse coord in the script win??



(theeth) #2

you can use this bits of code:

import Blender.BGL as GL

SBox = GL.Buffer(GL.GL_FLOAT, 4)


the SBox variable is a 4 item lists. The first two items are the position of the current window (from the bottom left of the screen) and the last two are the width and height of that same window.


(Manuel) #3

Oh thanks…!
Now I’m going to study your post…

This can be another little adjustement for the Open Source

Thanks again :smiley: