flameConnect v1.0


 
This location is for Registered Users Only.
Perhaps you need to login or register.
Contributor: jaden
Flame Connect beta
Requirements:
6.1 or later
19 Nov 2010
453

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

Please login in order to download these files.

Comments   

 
0 # jaden star 2010-11-19 15:56
sorry i forgot to add that you have to import the flameConnect in your menu.py

also add

import flameConnect

to the top of your menu.py

jaden
 
 
0 # Diogo Girondi 2010-11-19 18:42
Cool!

I always kinda missed the node kissing from Flame.
 
 
0 # Mikolaj Valencia 2010-11-20 02:13
is there any chance to have it on Linux?
 
 
0 # Mikolaj Valencia 2010-11-20 02:59
forget last question. I`m just tired :-)
 
 
0 # jaden star 2010-11-20 05:54
yeah, but i always found the node kissing in flame a little tricky, since the inputs are too small.
is the script running good?

jaden
 
 
0 # Mikolaj Valencia 2010-11-20 13:54
very good. I`m impressed.
 
 
0 # jaden star 2010-11-20 16:09
good to hear that! thank you for the nice comment
jaden
 
 
0 # Martin Graßl 2010-11-21 06:55
great script!

a script wich let you cut the connections, like in flint(ect..) would be interesting too!! ;-)

louis
 
 
0 # Philippe HUBERDEAU 2010-11-21 15:09
Great idea, thanks for that Jaden !
 
 
0 # Lukasz Omasta 2010-11-22 07:03
The script is great, really. Runs smoothly on OSX and Win even on ver 5.1.x
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.
 
 
0 # jaden star 2010-11-22 08:02
appendClip:
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
 
 
0 # Diogo Girondi 2010-11-22 09:19
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.
 
 
0 # jaden star 2010-11-22 09:55
wow, cool !!!!
cant wait to see it...

jaden
 
 
0 # George Anison 2010-11-24 16:38
Wow! It works great! I wished this in Nuke since I saw Flame.

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!
 
 
0 # Diogo Girondi 2010-11-27 12:29
Here it is
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.
 
 
0 # jaden star 2010-11-28 05:56
diego

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
 
 
0 # Diogo Girondi 2010-11-28 09:47
Thanks Jaden, glad you like it!

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
 
 
0 # jaden star 2010-11-29 02:52
yeah, personally i think we need this feature, since when you select a node and press m for a merge the a pipe gets connected. now you are not able to nodeKiss the node...
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
 
 
0 # Diogo Girondi 2010-11-29 05:31
Yeah, but it's not that easy due to Nuke's nature and how this script is triggered. After looking at it yesterday once again, dealing with free inputs should be trivial, but restarting the reconnection of every connected input doesn't seem to be that simple or even possible at a first look.

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
 
 
0 # behram patel 2010-12-03 03:22
nifty lil script.
Nuke's a bit more fun now :-)
Thanks

b
 
 
0 # Andi Novianto 2011-01-19 11:03
coooolllll
 
 
0 # Charles Taylor 2011-02-20 14:36
I would say that not having a physical location for each input is a flaw in Nuke's design, but the Foundry obviously doesn't see it that way...

Having physical locations for inputs makes connecting nodes together and reading scripts much easier...
 
 
0 # Diogo Girondi 2011-02-20 16:44
The problem is that Nuke has nodes with a arbitrary number of inputs so adding a physical location for their inputs would be pretty tricky withing the current architecture. To change this, they would probably have to change how Nuke approaches the whole thing forcing people to work a certain way loosing Nuke's "free form" nature that allows users to build their trees in any direction.
 
 
0 # Brian Kubovcik 2011-07-28 15:40
Having some issues getting this python script installed. Added the flameconnect.py file to the plugins directory on MacOS, where menu.py is currently located. Added the two lines to menu.py file, saved. Opened Nuke, tried flame connect and got this error.

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?
 
 
0 # Brian Kubovcik 2011-07-28 16:06
Nevermind, apparently i'm a noob at this message board and didn't read the first response from Jaden. All is good. Thanks for making Nuke more enjoyable!
BK
 
 
0 # Dennis Tsoi 2012-05-16 04:08
Dear Jaden!
I've got an arror like this:
---------------------------
Nuke
---------------------------
'module' object has no attribute 'flameConnect'
---------------------------
OK Hide Details...
---------------------------
What have I do wrong?
 
 
0 # jaden star 2012-05-17 05:00
Hey Dennis. Did you Import the script in your menu.py
See the first Post for more details...
 
 
0 # Dennis Tsoi 2012-05-17 05:16
It was synax error
Thank you for grate script!
 
 
0 # Chainarong Wanachaisong 2012-07-29 10:41
How to change from "y" key to "shift" key same real autodesk flame key :-)

Thank,

Lenkzler
 
 
0 # Elliott KAJDAN 2012-10-01 08:11
Hello, I'd love to use the script but I can't make it work (I'm a novice here)
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.
 
 
0 # Elliott KAJDAN 2012-10-01 09:19
ok my bad it has to go in the .nuke folder under Users in Windows
---> out :-)


Awesome script btw
 
 
0 # Matt Grasso 2015-03-21 07:00
Really nice script!!

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
 

You have no rights to post comments

We have 3803 guests and 102 members online