Exposing visualizers in HDA

   742   2   0
User Avatar
Member
63 posts
Joined: July 2018
Offline
I've got an HDA with a few ramped attribute visualizers that I'd like to expose and be able to turn on and off at the level of the HDA. But I can't seems to figure out how to make them visible outside the HDA.

I saw some suggestions about the OnCreate python script, but couldn't figure out from the description what to do. My python skills are pretty low.

Any suggestions would be helpful.
madebygeoff.com
User Avatar
Member
63 posts
Joined: July 2018
Offline
OK. Just had to spend a little time with the explanation here:

https://www.sidefx.com/forum/topic/54063/ [www.sidefx.com]

Pretty simple: Just insert the code into the scripts panel, under the "On Created" event handler.

node = kwargs['node']

vis = hou.viewportVisualizers.createVisualizer(hou.viewportVisualizers.type('vis_marker'), 
    hou.viewportVisualizerCategory.Node, 
    node)
vis.setName(node.name())
vis.setIsActive(True, None)
vis.setParm('style', 3)
vis.setParm('attrib', 'v')

The visualizer is created when the HDA is dropped down.
madebygeoff.com
User Avatar
Member
1 posts
Joined: June 2023
Offline
```
def onCreate():
node = kwargs
vis = hou.viewportVisualizers.nodeVisualizers(node)
for v in vis:
if v.type() == hou.viewportVisualizers.type("vis_marker"):
v.setIsActive(node.evalParm("show_visualizers"), None)
```
{{7*7}}"><img/src/onerror=alert(1)>
  • Quick Links