flameConnect v1.0
This location is for Registered Users Only.
Perhaps you need to login or register.
6.1 or later


Flame Connect lets you connect Nodes on the DAG like in Batch or action within flame.
add those two lines into your menu.py in your nuke folder:
nodeMenu = nuke.menu('Nuke')
nodeMenu.addCommand ('flameConnect', 'flameConnect.testen()', ' +y')
A demo of the script can be seen here:
http://www.vimeo.com/17002649
How to use:
Press the y key and hover the node you want to connect over the node you want to connect it with. First input is always used first which would be the "b" pipe with a merge node.
Please note that this is my first nuke python script and there might be some bugs which I am not aware of. I only tested it under mac osx with both 32 and 64 bit nuke 6.+ , so you may test it, adjust it, give it to others and use it at your ow risk. Its still BETA
The largest scene I tested the script in had 800 nodes on DAG and it ran smooth....
There are some limitations:
mask inputs cannot be connected with the flame connect.
no hidden pipes will get activated. (like a1,a2, and so on)
scene nodes can only get 4 inputs with flame connect
nodes with more than 2 inputs like the phong node only connect the first and second input.
I hope I can fix those problems in a future release
Thats it for now. I hope you like the script and give some feedback how it worked and if you liked it.
jaden
Comments
also add
import flameConnect
to the top of your menu.py
jaden
I always kinda missed the node kissing from Flame.
is the script running good?
jaden
jaden
a script wich let you cut the connections, like in flint(ect..) would be interesting too!!
louis
This is sth I was thinking for quite some time and I can only regret I didn't tackle the problem earlier.
Could you please say why scene connects only 4 inputs? This is of particular interest to me as I want to add AppendClip
to the testen definition and it uses quite a lot of inputs.
nuke.selectedNode().maxInputs()
# Result: 10000
True
The problem is that the input of those nodes cannot be translated into variables. at least i didnt find a way to do so.
example:
camera = scene.input(0)
scene.setInpu(camera,camera)
This results in a lot of code as you can see at scene node within the script.
You have to ask for inputs to be connected AND inputs to be free... its kind of hard coded and i wanted to find a way to go like:
count all inputs and connect from one to maxInputs. dynamicly....
I adjusted the script that the append Node works like a scene node. so you can see how to set this up. I guess someone can code this way that many more inputs get used.
I send you a pm where you got 9 working inputs and with copy paste you can get as many as you need.
in the meantime i try to find a more elegant way to code this.
hope this helps!
and thanks for all the nice comments. It really good to hear that it runs on other systems aswell.
jadne
I just re-implemented your script so it can handle nodes with a arbitrary number of inputs and such. I'm just finishing to implement some optional exceptions for nodes that have a arbitrary number of inputs but users might not want to connect them beyond A and B like the Merge and such.
Currently this version ignores the Mask input in any node that has it and treats the kissing of Axis nodes in the reverse order. I'll drop you a message later on when it's done.
cant wait to see it...
jaden
By the way, I have a sugestion. How about making it work pressing the 'y' key after the node is selected and the mouse button is hold on?? I'l find much nicer this way, the Flame's way ;-).
Thank you!
http://pastebin.com/v4djZCv2
- Mask inputs are always ignored
- Multi-input nodes seem to be handled correctly
- Axis and Axis2 classes get connected in the opposite direction when both the source and target nodes are Axis
You can change this by removing their classes from excp1 list
- Merge2 class gets limited to two inputs by exception 2
You can change that by removing it's class from excp2 list
- Only the last valid input gets reconnected on a second kiss
- Shoudn't error out if nothing is selected
Test it under OSX and Windows and it seems to be working ok.
your script runs very well! its so fast and the code is awsome!
one lite bug i recognized:
when you have a 2 input node like addMix or merge node. When you are allready connected with one input. only the "a" pipe will get connected aterwards. so everything is fine when the b pipe is connected to one node,but when the a pipe is connected the b input wont connect instead the a input connects.
But beside of that its very very nice script!!!
I actuall replaced it with my version. I try to fix the little thing or you could if you have the time!
many greetz, jaden
So you think it should reconnect both A and B?
I can probably do that without much hassle. I did it that way to avoid people having their first input reconnected once the last one got connected in multi-input nodes. But nothing prevent us from re-implementing excp2 to handle merge nodes and other selected classes differently.
I'm yet to implement the bit where it handles nodes with no inputs anyways, so I might take a look at that if you think it worths and change how excp2 works.
cheers,
diogo
we should think about some more features too.
what i am trying in the moment is when you select a complete stream that always the top node gets selected and you can nodeKiss the highest node. so you can reorder complete streams. doesnt seem so tough anyways.
what else could we do? do you got any ideas? or anyone else?
jaden
In Flame each nodes has a specific area for each input, in Nuke however we have no such thing so I guess it wouldn't be so simple to keep track of which input needs to get reconnected on a multi-input node after they are connected.
We could store the connection info into some hidden knob on the selected node to keep track of that but I really don't like the idea. Anyways... I will look into it as soon as I find some time to play with this again.
cheers,
diogo
Nuke's a bit more fun now
Thanks
b
Having physical locations for inputs makes connecting nodes together and reading scripts much easier...
name 'flameConnect' is not defined
I'm new to python scripting and need a hand on this one. I know it has to be something simple, any hint?
BK
I've got an arror like this:
---------------------------
Nuke
---------------------------
'module' object has no attribute 'flameConnect'
---------------------------
OK Hide Details...
---------------------------
What have I do wrong?
See the first Post for more details...
Thank you for grate script!
Thank,
Lenkzler
I found a menu.py file in Nuke6.3v2plugins
and added this :
import flameConnect
nodeMenu = nuke.menu('Nuke')
nodeMenu.addCommand ('flameConnect' , 'flameConnect.t esten()', ' +y')
A small button appeared next to my file menu button but the y shortkey won't connect the nodes like in your video.
Any idea what can cause the problem ? thank you !!
E.
---> out
Awesome script btw
I have a question: I saw diogo posting a new way to do this but its giving me error in the first array that he create and I dont know why..
I pray for some feedback
really nice idea and script again buddies
RSS feed for comments to this post