scaleNodes v1.3
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: Frank Rueter
contract and expand node connections
Requirements:
6.3 or later
Linux, Mac, Windows
6.3 or later
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:
Please login in order to download these files.
Comments
the one question I have concerns backdrops. I wonder if there'd be any way to accurately scale them up prior to doing the spacing so that they maintain their relationship through the scale? It's been on my list to look into it for a while, but haven't had the time. just putting it out there in case anyone else can get to it first, would be a smooth addition!
that's a great idea, and o obvious once pointed out :-D. Will have a look
try v1.1 and let me know if it does what you are after.
Works great if there are no backdrops, so thanks for that.
Look forward to using it more when the backdrop issue is resolved.
Much appreciated, Frank.
Been a great and useful tool - would it be possible to scale in x or y as well as both? Often I might want to just widen or lengthen a selection.
Howard
Traceback (most recent call last):
File "", line 1, in
File "/Users/ME/.nuk e/scaleNodes.py ", line 33, in scaleNodes
backdrops[bd] = getSideNodes( bd )
File "/Users/ME/.nuk e/scaleNodes.py ", line 9, in getSideNodes
bd.selectNodes()
AttributeError: 'Node' object has no attribute 'selectNodes'
Traceback (most recent call last):
File "", line 1, in
File "/Users/ME/.nuk e/scaleNodes.py ", line 33, in scaleNodes
backdrops[bd] = getSideNodes( bd )
File "/Users/ME/.nuk e/scaleNodes.py ", line 9, in getSideNodes
bd.selectNodes()
AttributeError: 'Node' object has no attribute 'selectNodes'
Isa, are you still seeing this error message? If so, can you let me know how it can be reproduced?
This still doesn't work inside of group nodes as there is no support yet for figuring out which node graph is the "active" one. Pining for that one...
scaleNodesV13.scaleNodesV13(1, 1.7)
# Result:
Traceback (most recent call last):
File "", line 1, in
File "/Users/XXX/.nu ke/python/scale NodesV13.py", line 37, in scaleNodesV13
backdrops[bd] = getSideNodes( bd )
File "/Users/XXX/.nu ke/python/scale NodesV13.py", line 11, in getSideNodes
bd.selectNodes()
AttributeError: 'Node' object has no attribute 'selectNodes'
Traceback (most recent call last):
File "", line 1, in
File "/home/me/.nuke /scaleNodes.py" , line 35, in scaleNodes
backdrops[bd] = getSideNodes( bd )
File "/home/me/.nuke /scaleNodes.py" , line 9, in getSideNodes
bd.selectNodes()
AttributeError: 'Node' object has no attribute 'selectNodes'
-----------
File "", line 69, in
File "", line 57, in scaleNodes
TypeError: list indices must be integers, not str
i love this script
can i add your code to my "Massive Panel" please?, it is a tool for manipulation of many nodes in the same time
i am posting here as well, and i did implement some new features, one of them is based on your code.
thank you
http://www.nukepedia.com/python/ui/scalebox
RSS feed for comments to this post