Scripting - linking to the matte of an effect

As per title using

node.link(“Top/ToneMatte”,0,“Top/Tone”,0);

How do I get scripting to tell the differnce between which one I want to put it into? At the moment it goes into the drawing side but I want to put it in the mask(matte) side.

That’s what that handy 0 is for. That is the port that it’s linking to. If you want to link it to the next port over, then put a 1 instead of a 0. And so on, if you had a node with 3 ports, you’d put a 2 to get it to the third port (in programming numbering always starts with 0, so it goes 0, 1, 2 instead of 1, 2, 3).

So if you look at what the help says when you write it - node.link(srcNode : String, srcPort : Number, dstNode : String, dstPort : Number) then it’s the Port that you want to change.

Hope this helps!

~Lilly
Toon Boom Support

ohhhh that is good to know. Also really good for ordering things into the composite.

I figured it was something simple :slight_smile: