Is there a way to auto set display flag on clicked node?

   3364   9   3
User Avatar
Member
233 posts
Joined: March 2009
Offline
Hi. Another little thing that I find annoying in Houdini. I often need to select a node and set display flag. That right now is two clicks. Is there any chance that there is a key modifier that allows the display flag to auto set in any node I select?

This combined with a node info panel that would show info of node selected automatically (without middle mouse button click) would be so handy in inspecting scenes and trying to follow what’s happening.
User Avatar
Member
7762 posts
Joined: Sept. 2011
Offline
Hold down the display flag key ‘r’ when clicking to move the flag on click.

Doing either of those things on selection would cause unnecessary cooking, since most of the time selecting a node is for accessing the parameters or moving the node around.
User Avatar
Member
233 posts
Joined: March 2009
Offline
Thank you!
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
jsmack
Doing either of those things on selection would cause unnecessary cooking, since most of the time selecting a node is for accessing the parameters or moving the node around.

Houdini already cooks on selection by default.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
105 posts
Joined: Aug. 2018
Online
is there a way to automate this with Python, each time I select a node the display flag is on or tempate flag ?
- David
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
You can use addEventCallback:
https://www.sidefx.com/docs/houdini/hom/hou/Node.html#addEventCallback [www.sidefx.com]

with hou.nodeEventType.SelectionChanged:
https://www.sidefx.com/docs/houdini/hom/hou/nodeEventType.html [www.sidefx.com]

and:

node.setDisplayFlag(True)
node.setRenderFlag(True)
node.setGenericFlag(hou.nodeFlag.Template, True)
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
User Avatar
Member
105 posts
Joined: Aug. 2018
Online
animatrix_
You can use addEventCallback:
https://www.sidefx.com/docs/houdini/hom/hou/Node.html#addEventCallback [www.sidefx.com]

with hou.nodeEventType.SelectionChanged:
https://www.sidefx.com/docs/houdini/hom/hou/nodeEventType.html [www.sidefx.com]

and:

node.setDisplayFlag(True)
node.setRenderFlag(True)
node.setGenericFlag(hou.nodeFlag.Template, True)

Thanks but where should I put this code to be active when Houdini starts?
- David
User Avatar
Member
7762 posts
Joined: Sept. 2011
Offline
animatrix_
jsmack
Doing either of those things on selection would cause unnecessary cooking, since most of the time selecting a node is for accessing the parameters or moving the node around.

Houdini already cooks on selection by default.

nope.
User Avatar
Member
6 posts
Joined: March 2019
Offline
animatrix_
You can use addEventCallback:
https://www.sidefx.com/docs/houdini/hom/hou/Node.html#addEventCallback [www.sidefx.com]

with hou.nodeEventType.SelectionChanged:
https://www.sidefx.com/docs/houdini/hom/hou/nodeEventType.html [www.sidefx.com]

and:

node.setDisplayFlag(True)
node.setRenderFlag(True)
node.setGenericFlag(hou.nodeFlag.Template, True)

Where to put this code?
CURRENT GEAR
Laptop: Alienware 51m (i9900K. 128 gb RAM. RTX 2060. 1 TB SSD)
Desktop: Custom-Build (i9900K. some Radeon card. 128 gb RAM. 1 TB SSD + 2 TB Glyph Drive)
Accessories: 3D Connexion SpaceMouse & CAD mouse | Wacom tablet | iPad | OnePlus 7 Pro

CURRENT SOFTWARE LEARNED
2D Asset: Photoshop | Illustrator | Affinity Design | Procreate | Animate | Toon Boom Harmony
3D Asset: Zbrush | Nomad Sculpt | Substance Painter & Designer | Mixamo | Rokoko
Animation & Rendering: Cinema 4D | Maya | Blender + plugins | Arnold | CyclesX + SheepIt | Eevee
Compositing & Video Production: After Effects + plugins | Nuke | Premiere Pro | Ableton

CURRENTLY LEARNING
Houdini | Fusion | Redshift | Octane | Vray | 3Delight | Renderman

Currently streaming my study sessions at Twitch.tv@Retopo001

WHAT I'M LISTENING TO
Audio read aloud by text-to-speech: articles by the Economist | Compiled Wikipedia branches |
Music: Bach - Complete Collection. NIN - Pretty Hate Machine. Aphex Twin.
User Avatar
Member
4512 posts
Joined: Feb. 2012
Offline
Retopo001
animatrix_
You can use addEventCallback:
https://www.sidefx.com/docs/houdini/hom/hou/Node.html#addEventCallback [www.sidefx.com]

with hou.nodeEventType.SelectionChanged:
https://www.sidefx.com/docs/houdini/hom/hou/nodeEventType.html [www.sidefx.com]

and:

node.setDisplayFlag(True)
node.setRenderFlag(True)
node.setGenericFlag(hou.nodeFlag.Template, True)

Where to put this code?

You have to turn this into a function and then register it like this (this one is using name changed event):
def name_changed(node, event_type, **kwargs):
    print("The geometry object is now named", node.name())

hou.node("/obj/geo1").addEventCallback((hou.nodeEventType.NameChanged, ), name_changed)

But I would recommend a different way. nodegraphhooks actually offers better methods. For example in some contexts I override RMB on a node to diplay that node, but it's a bit more involved to detect what's under the mouse is a node and if so, check the clicked buttons and/or modifier keys.
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]

youtube.com/@pragmaticvfx | patreon.com/animatrix | animatrix2k7.gumroad.com
  • Quick Links