contract and expand node connections
scaleNodes
Updated: 7 February 2012
Author: frank
Compatible Nuke versions: 6.3 or later
Compatibility: Linux, Mac, Windows
v1.3: added support for scaling X and Y independently. If only one argument is given, the nodes are scaled equally in both directions, otherwise the first argument defines the horizontal scale and the second the vertical one.
Example for horizontal scale
scaleNodes.scaleNodes( .5, 1 )
Example for vertical scale
scaleNodes.scaleNodes( 1, .5 )
v1.2: fixed bug with backdrop nodes not behaving as expected.
v1.1: auto-adjusts backdrop nodes to fit the new node positions after scaling (doesn't matter if they are selected)
scaleNodes increases and decreases the lengths of the selected nodes' connections to either make parts of the node tree more compact or give you more space.
menu.py example (note that these lines overwrite the default zoom hotkeys which I personally never use ayway):
1 2 3 4 5 |
import scaleNodes menuBar = nuke.menu("Nuke") menuBar.addCommand('Edit/Node/Scale/up', 'scaleNodes.scaleNodes( 1.1 )', '=') menuBar.addCommand('Edit/Node/Scale/down', 'scaleNodes.scaleNodes( 0.9 )', '-') |
original selection:
after scaling down:
after scaling up: