NETWORK WALK HDA

WALK A NETWORK VIEW WITH JUST YOUR KEYBOARD

UPDATE: Network Walk is now part of SideFX Labs. Along the way, we remapped the keys to Insert, Home, PageUp and PageDown and transitioned to a shelf button - good work Paul A.

It can be found on the SideFX Labs Shelf. Click on the button to install and uninstall the shortcuts.

The technique of deploying keyboard shortcuts from a HDA and also insight into generally creating them via python is still an interesting topic, so I’ll leave the files and page up. I may create a new page specifically on the topic. Enjoy.





I always feel that when I have to take my hands off the keyboard I lose productivity, especially when I’m doing technical work in Houdini.

With this in mind I thought I’d try to tackle what is for me the most frequent occurrence of this: interacting with the Network View.

To set up:

  • Install the the HDA.
  • At Sop level Create Rich T Network Walk node.
  • Click the Add Action & Hotkeys button.
  • Restart Houdini.

Once you’ve restarted Houdini - and with HDA installed - you should be able to:

  • Select a node in a Network Editor.
  • Then press Ctrl + Alt + the cursor direction you want to go.

Depending on your OS, you might be able to use Alt Gr instead of Ctrl + Alt. That’s about it :-) Use the Houdini’s Hotkey Editor to change the key mappings to anything you prefer.



LOGIC AND CONCEPTS

Coming up with a logic to navigate a Houdini’s node network that deals with all the cases of how nodes might be connected was tricky.

A node might have several inputs and outputs in all manor of arrangements. I tried three or four different logic schemes, but one was far and away the best. This method used the concept of a Pivot node which allowed for flexibility yet predictability.

Generally speaking, when walking up or down, the tool will walk to an input/output node that is closest aligned with it veritcally. From there, you can cycle left or right through the other output or inputs of the last node you came from. In this way the previous walk becomes the Pivot.

This concept ensures the disambiguation of what can be traversed sideways. It can be necessary in complex graphs to walk up/down and then back to set a new Pivot in order to traverse new inputs/outputs. It’s actually quite intuitive believe it or not!

The interface displays what is acting as the Pivot to orientate yourself.

The tool’s Hotkeys are tied to when the Network View so that has to be the current type of Editor - if you leave the HDA as is. You can create your own “Global” Mappings if you like - though at the time of writing this I haven’t tested this much.



TECH BITS & IMPLEMENTATION

The HDA can be created in the Sop context… but the actual node doesn’t do anything currently apart from contain code and have button to aid setting up Hotkeys.

HDA creates several of what Sidefx refers to as Tool Scripts. These are what drive shelf buttons behind the scenes, but they can actually be embedded in a HDA. Script Tools are declared in the Operator Type Properties window in the interactive/shelf tools tab.

Note: this is how it appears from version 18. Previous Houdini versions have a different layout.

Inside this tab you’ll see the Hotkey’s section where the Hotkeys are assigned to each Tool Script. You can edit these here, or you can set additional Hotkeys with the usual editor.

There’s a ton of stuff you can do with this aspect of HDA’s. You can even trigger Tools with tab menus! Anyway check out the Docs: https://www.sidefx.com/docs/houdini/hom/tool_script.html

In Network Walk’s case I actually create four tools - one for each direction - that call the same function declared in the HDA’s python module with a direction argument. For those of you unfamiliar with this Module, it is found in the Operator Type Properties Window under the “Scripts” tab.

Have a look at the code in there. I found it quite interesting coming up with methods that deal with ** Pane Tabs ** - AKA Editors or Views - and the UI in general.



TRY IT OUT

Network Walk should be work on Houdini 18.0 and above.

The tool is quite young in its development, so I’m interested in how it works for you. Any ideas of how it could be improved or bug reports? Or, for that matter is there anything you’d like me to try and make?

Just drop me an email or comment on one of my social media accounts.

So go forth and let your flow be slightly less stem-ethed!

Download this tool for free (sweet!) just subscribe to my email list below, and I’ll send you a download link.



Please consider subscribing if you’d like to keep updated with what I’m up to or follow me on Twitter DoesCG.

DOWNLOAD



UPDATES

01:00 GMT 2020-11-30, version 0.3

  • Added network items support. No longer jumps out of subnet when walking up.

19:30 GMT 2020-11-30, verison 0.5

  • Improved Vop et al left-to-right traversal .
  • Buttons to assign and un-assign Hotkeys.
  • Switch from sessionId’s to Global variables. 12:00 GMT 2021-04-10
  • Dev moved over to SideFX Labs.