Help needed with HDA action button

   139   1   0
User Avatar
Member
4 posts
Joined: 2月 2019
オフライン
Hi everyone!
I have a parameter in HDA that that allows me to pick a point on a geometry with the help of the node inside that HDA but I kinda messed up the action button.
When I click on a picker to select the point it dives into my HDA even if it is locked . I want it to not dive and display the node that I need in the viewport for me to pick the right point(in this case I have a blast node)
So here is the script I have maybe someone can spot my mistake

import hou
import soputils

hda = kwargs
blast = hda.node("blast3")

net = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor)

hou.clearAllSelected()

Dive into blast4

net.setPwd(blast.parent())



blast.setCurrent(True, clear_all_selected=True)
blast.setHighlightFlag(True)
blast.setDisplayFlag(True)

net.frameSelection()


kwargs = blast
kwargs = blast.parmTuple("group")
kwargs = 0



kwargs =



soputils.selectGroupParm(kwargs)
User Avatar
Member
4 posts
Joined: 2月 2019
オフライン
If anyone needed I figured it out. Need to add your node in Node tab to Editable nodes space
import hou
import soputils
import toolutils

hda = kwargs
blast = hda.node("blast3")

# === Toggle off Current Geometry guide to reduce auto-diving ===
viewer = toolutils.sceneViewer()
if viewer:
settings = viewer.curViewport().settings()
# Turn off the guide before selection (this often stops unwanted diving)
settings.enableGuide(hou.viewportGuide.CurrentGeometry, 0)

hou.clearAllSelected()

# Safe + effective selection setup
kwargs = hda
kwargs = blast.path() # This tells it to pick from blast3 stage
kwargs = blast.parmTuple("group")
kwargs = 0
kwargs =
kwargs = False

# Launch selection (minimal style)
soputils.selectGroupParm(kwargs)

# === After selection: force stay at HDA level + set render flag ===
net = hou.ui.paneTabOfType(hou.paneTabType.NetworkEditor)
if net:
# Safety: pull back to HDA level if it dove anyway
if net.pwd() != hda.parent():
net.setPwd(hda.parent())

hda.setCurrent(True, clear_all_selected=True)
hda.setHighlightFlag(True)
hda.setDisplayFlag(True)
hda.setRenderFlag(True)
net.frameSelection()

# Optional: turn the Current Geometry guide back on after picking
if viewer:
settings = viewer.curViewport().settings()
settings.enableGuide(hou.viewportGuide.CurrentGeometry, 1)
  • Quick Links