Network View: Layout Nodes Left Alphabetically?

   517   2   1
User Avatar
Member
1179 posts
Joined: 4月 2017
オフライン
Hi!

I just found out about the Layout -> Layout Nodes Left. Alternatively, you can press and hold "A" + left-click and drag in the direction you want them to stack.

Wonderfull, but!! It's not in alphabetical order. Any way to change the behavior?

-Olivier
Edited by olivierth - 2025年4月29日 13:07:39

Attachments:
Houdini_Layout_Nodes_Left_01.JPG (51.3 KB)

User Avatar
Member
654 posts
Joined: 8月 2014
オフライン
I don't think so.
But for this particular case, where all nodes are disconnected, you can lay them out alphabetically with a tiny bit of Python:

import hou
selection = hou.selectedNodes()
node_paths = []
for node in selection:
    node_paths.append(node.path())
node_paths = sorted(node_paths)
for node_path in node_paths:
    # Either create your own layout rules here, using position(),
    # setPosition() and shiftPosition() methods of hou.Node class,
    # or use:
    hou.node(node_path).moveToGoodPosition()
User Avatar
Member
1179 posts
Joined: 4月 2017
オフライン
Thanks, ajz3d !
  • Quick Links