ndasilva
Aug. 7, 2020 11:53:26
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
Aug. 7, 2020 16:59:25
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
Aug. 7, 2020 21:37:08
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
Aug. 8, 2020 09:53:18
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
Aug. 8, 2020 17:25:10
That seems to have done the trick. Thanks!