[Bf-python] getting what's under the mouse

Vilem Novak pildanovak at post.cz
Mon Jun 9 01:07:46 CEST 2014


Thanks, 
I guess that ends the discussion :)
Well, I won't see any chance of learning C and doing this myself, 
so will have to find another ways...
regards
Vilem


---------- Původní zpráva ----------
Od: CoDEmanX <codemanx at gmx.de>
Komu: bf-python at blender.org
Datum: 8. 6. 2014 21:37:51
Předmět: Re: [Bf-python] getting what's under the mouse

"I assume by "properties under the mouse" you mean you want to know over 
which UI widget (numeric input slider, text field, ...) the cursor is over?
This isn't possible with python, low level events as well as the event 
handling (e.g. right-click context menu) are done in the C code, and 
none of it exposed to python - such as the location of a property widget 
in a panel, the panel dimensions or scroll and zoom factors.

You can bind a new operator to RMB for e.g. the properties panel, but 
widgets' right-click handling takes precedence. So you can't event 
trigger an own event on RMB as a (python) user.

There are no UI element events at all on the python-side, modal 
operators do get an event object passed hover, from which you can get 
the device input (keystrokes and mouse events, but no "context" such as 
which widget was underneath on mouse click).

Drawing images requires the bgl module, and I'm not sure if you can 
disable the OpenGL sciccors (or multiple viewports?) to draw independent 
of a certain area.


Am 08.06.2014 21:17, schrieb Vilem Novak:
> I recently did a research for implementing an blender-education related
> addon/
>
> I wanted to be able to detect properties under the mouse, or to be able
> to add something to the context menu that's available for all properties.
>
>
> Is that somehow possible?
>
> Another thing I would like to try is an alternative wiki-connected
> tooltip system, with drawing of images.
> Is there some kind of event like on-mouse-over for blender's UI elements?
>
> Thanks,
> Vilem
>
>
>
>
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>
_______________________________________________
Bf-python mailing list
Bf-python at blender.org
http://lists.blender.org/mailman/listinfo/bf-python"
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20140609/f984ae36/attachment.html>


More information about the Bf-python mailing list