Auto select node when checking display flag
3425 9 2- LukeP
- Member
- 374 posts
- Joined: 3月 2009
- Offline
- CYTE
- Member
- 709 posts
- Joined: 2月 2017
- Offline
Hey LukeP,
I only have this snippet to set the display flag on the selected node. so you can put that to a shortcut.
But I barely use it as I work with this all the time: Hotkey System [animatrixx.gumroad.com]
It's money well spent. As it will speed up your Houdini workflow a lot. It provides a function to select and display the node that is nearest to the mouse. so you don't even have to be over the node, just near it.
Cheers
CYTE
I only have this snippet to set the display flag on the selected node. so you can put that to a shortcut.
# put all currently selected nodes in a tuple allnodes = hou.selectedNodes() if len(allnodes) == 0: hou.ui.displayMessage('Please select Nodes') else: #find last node Position of selected nodes lastNodePosition = len(allnodes)-1 # select last node lastnode = allnodes[lastNodePosition] # set display/render/selection flag on node lastnode.setDisplayFlag (True) lastnode.setRenderFlag (True) lastnode.setSelected(1,1)
But I barely use it as I work with this all the time: Hotkey System [animatrixx.gumroad.com]
It's money well spent. As it will speed up your Houdini workflow a lot. It provides a function to select and display the node that is nearest to the mouse. so you don't even have to be over the node, just near it.
Cheers
CYTE
- eikonoklastes
- Member
- 396 posts
- Joined: 4月 2018
- Offline
LukePIt doubles the number of clicks only when you want to do this. It's quite common to want to set the display flag to some other node, but continue working on the selected node.
Is there a way to auto select the node that I'm turning the display flag on? Seems like not being able to do so doubles the number of clicks one has to do...
As a workaround, you can click to select the node (or drag around it if you don't want to be precise), and hit R to display it.
- LukeP
- Member
- 374 posts
- Joined: 3月 2009
- Offline
CYTE
Hey LukeP,
I only have this snippet to set the display flag on the selected node. so you can put that to a shortcut.# put all currently selected nodes in a tuple allnodes = hou.selectedNodes() if len(allnodes) == 0: hou.ui.displayMessage('Please select Nodes') else: #find last node Position of selected nodes lastNodePosition = len(allnodes)-1 # select last node lastnode = allnodes[lastNodePosition] # set display/render/selection flag on node lastnode.setDisplayFlag (True) lastnode.setRenderFlag (True) lastnode.setSelected(1,1)
But I barely use it as I work with this all the time: Hotkey System [animatrixx.gumroad.com]
It's money well spent. As it will speed up your Houdini workflow a lot. It provides a function to select and display the node that is nearest to the mouse. so you don't even have to be over the node, just near it.
Cheers
CYTE
Thank you. Where would I out this snipped of code?
- animatrix_
- Member
- 4731 posts
- Joined: 2月 2012
- Offline
LukePCYTE
Hey LukeP,
I only have this snippet to set the display flag on the selected node. so you can put that to a shortcut.# put all currently selected nodes in a tuple allnodes = hou.selectedNodes() if len(allnodes) == 0: hou.ui.displayMessage('Please select Nodes') else: #find last node Position of selected nodes lastNodePosition = len(allnodes)-1 # select last node lastnode = allnodes[lastNodePosition] # set display/render/selection flag on node lastnode.setDisplayFlag (True) lastnode.setRenderFlag (True) lastnode.setSelected(1,1)
But I barely use it as I work with this all the time: Hotkey System [animatrixx.gumroad.com]
It's money well spent. As it will speed up your Houdini workflow a lot. It provides a function to select and display the node that is nearest to the mouse. so you don't even have to be over the node, just near it.
Cheers
CYTE
Thank you. Where would I out this snipped of code?
Drag the code onto a shelf and then right click -> Edit Tool -> Hotkeys tab to assign a hotkey.
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 | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- tamte
- Member
- 8845 posts
- Joined: 7月 2007
- Offline
- CYTE
- Member
- 709 posts
- Joined: 2月 2017
- Offline
tamteCYTEwhy?
I only have this snippet to set the display flag on the selected node
isn't that what R is doing by default?
It also sets the display flag on the selected node while the mouse is over the viewport. that can be handy in some situations.
I use it mostly when I traverse the network via the Move to Previous/Next Operation commands, while the mouse is in the viewport.
Cheers
CYTE
- pezetko
- Member
- 392 posts
- Joined: 11月 2008
- Offline
You can add this code to
This will auto-select a node with the display flag set (and auto-deselect nodes without it):
This is just quick Proof of Concept (not production tested).
"$HOUDINI_USER_PREF_DIR/houdini19.5/scripts/OnCreated.py"
file. (Create the scripts folder and this file if it doesn't exist.)import hou def auto_select_on_display_flag_set(node, event_type, **kwargs): # pylint: disable=W0613 node.setSelected(node.isDisplayFlagSet()) def add_callback(kwargs): node = kwargs["node"] node.addEventCallback((hou.nodeEventType.FlagChanged,), auto_select_on_display_flag_set) add_callback(kwargs) # pylint: disable=E0602
This will auto-select a node with the display flag set (and auto-deselect nodes without it):
This is just quick Proof of Concept (not production tested).
- raincole
- Member
- 539 posts
- Joined: 8月 2019
- Offline
- eikonoklastes
- Member
- 396 posts
- Joined: 4月 2018
- Offline
raincole
Or when there are 3 manual steps but you do them thousands times? What's your point...?
A bit of a straw man here. The scenario being discussed is two manual steps, not three, and both steps are very comfortably in the natural resting positions for either hand.
You have to click on the node, so do that with the mouse, and then just hit R with your other hand.
You don't even need a precision click, because you can drag a rectangle over the node.
I'm huge on automating a grind, and use macros heavily, but this one seems entirely unnecessary to me. Still, I'm glad that there does exist a solution for those looking to minmax their lives.
Edited by eikonoklastes - 2022年10月1日 16:22:56
-
- Quick Links