Search - User list
Full Version: How to make a python UI state permanent?
Root » Technical Discussion » How to make a python UI state permanent?
ndasilva
Hi all

I have a working python state that displays some information in the UI. I want this state to always be active from the moment Houdini starts. Can anyone tell me how to do that? My state seems to disable when I select different objects no matter what I change.

Thanks!
mabelzile
By default python states belongs to one context only, you can register your state with multiple contexts that would keep the state active as you select nodes in different contexts. Take a look at the context argument of the hou.ViewerStateTemplate API

https://www.sidefx.com/docs/houdini18.0/hom/hou/ViewerStateTemplate.html [www.sidefx.com]
ndasilva
I guess what I'm trying to do is not make it sensitive to selection at all. If I specify a node, I want the state to stay active regardless of what I'm currently selecting or not. Is that possible? Basically I want a UI overlay that displays information on a node whether it's the current selection or not. It seems that even when selecting nodes of the same context is stops displaying my state.

Thanks so much!
mabelzile
By adding multi contexts to your state it will make it nodeless and should become insensitive to node selection, providing your state is compatible with the selected node context.
ndasilva
That seems to have done the trick. Thanks!
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB