Creating Nodes With Keybinds

Hi team,

Just out of interest is there a way to create nodes such as Paint or Roto with keybind shortcuts without python? I know there was talk of some kind of potential gui in the future, any progress with that?

But if you do need python and an artist just wants to set it up to hit ‘P’ when in the nodegraph to quickly create a paint node that should be fairly simple right? As long as it doesnt conflict with anything but if it was context based just to the nodegraph?

Thanks!

You would need to use scripting.

  1. add a custom action that creates (and potentially wires up) the new node (see scripts/gui/extractNodes.py for an example) - call it “CreatePaintNode” or something

  2. add a keybind for it in keybinds.py to hook it up to the tree, ie:
    fx.trees.bind("p", "CreatePaintNode")

Here is code that creates a RotoNode and wires it to the currently selected node (if there is one):

from tools import selection
from gui import undo

def create_node():
	node = Node("RotoNode")
	activeSession().addNode(node)
	# wire up selected node
	nodes = selection.nodes()
	if len(nodes) > 0:
		output = nodes[0].outputs[0]
		input = node.primaryInput
		if input and output:
			input.connect(output)
	activate(node)

undo.run(create_node, "Create Node")
2 Likes

Thanks Paul !!