Jump to content
Andr1

Viewport and python. Is this really impossible to do?

Recommended Posts

Hello guys,
I'm sorry for the little teasing title, but haven't found a solution so far, after reading docs and searching through forums.

So here my questions:

1) In case of a viewport layout split in 2 (or more),  I would like to know on which of the 2 viewports the radial menu is over.
If the radial menu is aware of which viewport is underneath, it could set specific settings or object isolations for that particular viewport (like the viewport isolator node).
I'm using the following code in my radial menu script, but it is always returning the first viewport, even when the radial menu is over the second viewport.

import toolutils
activepane = toolutils.activePane(kwargs)
print activepane.curViewport()

2) Given a double display setup, with two Scene View panels (one on each display),
I would like to know on which sceneviewer() the mouse cursor is over, and most importantly what are the (x,y) mouse coordinates relative to the viewport of that sceneviewer.
Do you know if this is possible at all?
I guess I could do something with the Mouse CHOP node and mapFromMouseChop() function, but Mouse Chop seems to be registering only the position of the mouse in the main Display. Is it not aware of the second display?

3) Bonus question: do you know how to refresh the 'radial menu' menu, so that newly installed radial menu files are loaded without need to restart Hou?
Ideally I would like to embed a radial menu file in the 'extra file' section of my Digital Asset. OnCreated(), the asset would then save the radial menu file in the user preferences directory, and I would like the user to be able to use the new radial menu right away, without restart.

 

Thanks for any help!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×