検索 - User list
Full Version: Node Editor Setting / Behaviour
Root » Houdini Lounge » Node Editor Setting / Behaviour
coccarolla
I have two basic questions regarding the node editor:

1. is the default spacing of nodes configurable? For example when you align nodes, where is that spacing defined vertically / horizontally?
2. is there an option to delay the middle mouse node info window? When navigating big networks with middle mouse butotn I get crashes if instead of panning it tries to display the node info window
lsgalante
coccarolla
1. is the default spacing of nodes configurable? For example when you align nodes, where is that spacing defined vertically / horizontally?

Press 'D' in the network editor to bring up display options. Or in the network editor menu go to View > Display Options. On the first tab there should be a grid spacing option. I am not sure if this is what you are looking for.

coccarolla
2. is there an option to delay the middle mouse node info window? When navigating big networks with middle mouse butotn I get crashes if instead of panning it tries to display the node info window

The best I can think of is 'extending the network editor' [www.sidefx.com] in the documentation. I don't think I have ever done anything with mouse handling, so I don't know if it is possible to override the default behavior. Of course, you would have to understand some python in order to do this.
animatrix_
coccarolla
I have two basic questions regarding the node editor:

1. is the default spacing of nodes configurable? For example when you align nodes, where is that spacing defined vertically / horizontally?
2. is there an option to delay the middle mouse node info window? When navigating big networks with middle mouse butotn I get crashes if instead of panning it tries to display the node info window

For #2, I submitted an RFE about this, to not show the MMB info dialog if the user is panning the view, it's easy to accidentally MMB on a node with rapid panning. I am not sure if it's implemented yet.
coccarolla
Here is what I mean:

When I align nodes their spacing is too small, I would like to be able to align nodes more like the grid spacing shown.
When I say align I mean aligning the nodes with the A key.
lsgalante
I looked in the python api and there is indeed a way to do this, but still some scripting required. It can be installed by looking at the documentation page I mentioned earlier.

If you want to actually move the nodes onto the grid after spacing them you could write some more code, or just select all the nodes and drag them to the grid with the cursor. The default grid size is 2x1, and can be changed by doing what I mentioned in my previous response. You will of course need to disable the default layout hotkey.

import hou
from canvaseventtypes import *
import nodegraphdisplay as display
import nodegraphview as view

def action(uievent):
    if isinstance(uievent, KeyboardEvent) and uievent.eventtype == 'keyhit':
        editor = uievent.editor
        node = editor.currentNode()
        parent = node.parent()
        key = uievent.key
        step_x = 2
        step_y = 1

        if key == "A":
            parent.layoutChildren(horizontal_spacing=step_x, vertical_spacing=step_y)
coccarolla
lsgalante
I looked in the python api and there is indeed a way to do this, but still some scripting required. It can be installed by looking at the documentation page I mentioned earlier.

If you want to actually move the nodes onto the grid after spacing them you could write some more code, or just select all the nodes and drag them to the grid with the cursor. The default grid size is 2x1, and can be changed by doing what I mentioned in my previous response. You will of course need to disable the default layout hotkey.

import hou
from canvaseventtypes import *
import nodegraphdisplay as display
import nodegraphview as view

def action(uievent):
    if isinstance(uievent, KeyboardEvent) and uievent.eventtype == 'keyhit':
        editor = uievent.editor
        node = editor.currentNode()
        parent = node.parent()
        key = uievent.key
        step_x = 2
        step_y = 1

        if key == "A":
            parent.layoutChildren(horizontal_spacing=step_x, vertical_spacing=step_y)

Thanks for looking into this! Can you help me a little more with how to actually use this? Is this code good for a shelf tool? I already tried it but it doesn't seem to do anything.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB