16
$\begingroup$

is it possible to trigger this kind of menu:

enter image description here

in the property panel when I press a hotkey over a button/input field? I want to specifically,when the user presses a specific hotkey when over an input field, call a function that checks if this input field allows divers and if it does to show the user this kind of popup menu (which of course includes own function, etc.).

$\endgroup$
  • 3
    $\begingroup$ This is easy except knowing if and what input field is under the cursor. I dont think this can be pulled off since bpy has nothing on this. You would have to somehow compute the position of elements from dpi, area dimensions and how much the panels are scrolled. And I dont think there is access to something like panel scroll amount. There are only some view_to_region and region_to_view functions on view2d of regions. $\endgroup$ – Jaroslav Jerryno Novotny Dec 10 '14 at 17:07
  • $\begingroup$ @Jerryno are you sure about that? I mean the tooltips that appear when you have your mouse cursor over a value come from somewhere and my guess is, that is python. So there should be some callback or something for each value field. If you could find that, you should be able to abuse it, right? $\endgroup$ – TeeTrinker Oct 8 '17 at 18:05
  • 1
    $\begingroup$ @TeeTrinker What is in those tooltips is defined in python classes, yep. But when, how and where do these tooltips show up is driven internally by Blender. As far as my knowledge goes, it is not exposed to the python api yet. $\endgroup$ – Jaroslav Jerryno Novotny Oct 8 '17 at 18:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.