push_nodes v1.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Mitja Müller-Jend
Move nodes in the DAG.
Requirements:
11.0, 10.5, 10.0, 9.0, 8.0, 7.1, 7.0 or later
Linux, Mac, Windows
20 Jul 2019
123

A common issue of building up a comp script is the lack of space between nodes to add more nodes. The push() function inside this package push nodes around the selection to make space.

 For example the following code moves all nodes below the selection down.

from nuke_move_nodes.push_nodes import push
push(down=True)

 

Nodes can also be pushed up, left and right and at the same time.

The script follows a few rules to maintain the order of the nodes in the DAG.

  • All selected nodes and Backdrop nodes stay where they are and only nodes in the specified direction are moved.
  • Selected backdrops are not be move nor re-sized.
  • Deselected backdrops surrounding selected nodes are re-sized.
  • Overlapping backdrops and their content are not be moved when pushing in one direction only.
  • Nodes snapped to the grid stay snapped after being moved.
  • If no node is selected, the last clicked position in the node graph is used as pivot.

The script may lead to unexpected results in messy scripts and does not consider how nodes are connected between sections. Still, it can be a massive timesaver while building up a node graph.

Full documentation: https://filmkorn.gitlab.io/nuke_move_nodes

 

Installation:

  1. Extract the nuke_move_nodes folder into your .nuke folder.
  2. Add the following to your menu.py (example):
import nuke


push_menu = nuke.menu('Nuke').addMenu('Push') # Adjust to match your setup.
push_menu.addCommand(
'Down',
'from nuke_move_nodes import push_nodes; push_nodes.push(down=True)',
'ctrl+PgDown',
shortcutContext=2 # Remove this line for Nuke < 9
)
push_menu.addCommand(
'Up',
'from nuke_move_nodes import push_nodes; push_nodes.push(up=True)',
'ctrl+PgUp',
shortcutContext=2 # Remove this line for Nuke < 9
)
push_menu.addCommand(
'Left',
'from nuke_move_nodes import push_nodes; push_nodes.push(left=True)',
)
push_menu.addCommand(
'Right',
'from nuke_move_nodes import push_nodes; push_nodes.push(right=True)',
)

 

Copyright (c) 2019 Mitja Mueller-Jend Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please login in order to download these files.

Comments   

 
0 # Francesc Macià 2019-07-31 16:55
Not moving left or right, I changed the shortcuts and nothing... But Thanks!
 
 
0 # Martin Rombos 2022-07-26 12:47
This is amazing. Thanks a lot! Works great in Nuke 13.1
 
 
0 # Abhishek Bose 2024-01-29 06:30
Not working in nuke 14.0 and 15.0
Getting error: No module named 'nuke_move_node s'
 

You have no rights to post comments

We have 3423 guests and 112 members online