Script for adding tone/highlight from an old tutorial

I got a request to post this cause it was hard to read on the video

function toneHighlightAdd()
{
//Add Interface
d = new Dialog;
d.title = “Options”

var bothRB = new RadioButton;
var toneRB = new RadioButton;
var highlightRB = new RadioButton;

bothRB.checked = true;
bothRB.text = “Highlight and Tone”;
toneRB.checked = false;
toneRB.text = “Tone”;
highlightRB.checked = false;
highlightRB.text = “Highlight”;

var group = new GroupBox;
group.add(bothRB);
group.add(toneRB);
group.add(highlightRB);
d.add(group);
d.addSpace(1);


var CompositeRB = new RadioButton;
var NoCompositeRB = new RadioButton;

NoCompositeRB.checked = true;
NoCompositeRB.text = “Don’t connect to composite”;
CompositeRB.checked = false;
CompositeRB.text = “Connect to composite”;

var group = new GroupBox;
group.add(CompositeRB);
group.add(NoCompositeRB);
d.add(group);
d.addSpace(1);

var prefix = new LineEdit;
prefix.label = “prefix”;
prefix.text = “”;
d.add(prefix);


rc = d.exec();

if (!rc)
{
// Call dialog, pressing “Cancel” returns false
return;
}



if((bothRB.checked == true) || (toneRB.checked == true))
{

var elemname = prefix.text + “ToneMatte”;
var elemId = element.add(elemname, “BW”, scene.numberOfUnitsZ(), “SCAN”, “TVG”);
var vnode = node.add(node.root(), elemname, “READ”, -80, -320, 0);
column.add(elemname, “DRAWING”);
column.setElementIdOfDrawing(elemname, elemId );
node.linkAttr(vnode, “DRAWING.ELEMENT”, elemname);

node.add(node.root(),prefix.text + “Tone”,“TONE”,15,-280,0);

node.link(“Top/” + prefix.text + “ToneMatte”,0,“Top/” + prefix.text + “Tone”,1);

}

if((bothRB.checked == true) || (toneRB.checked == true))
{

var elemname = prefix.text + “HighlightMatte”;
var elemId = element.add(elemname, “BW”, scene.numberOfUnitsZ(), “SCAN”, “TVG”);
var vnode = node.add(node.root(), elemname, “READ”, -80, -240, 0);
column.add(elemname, “DRAWING”);
column.setElementIdOfDrawing(elemname, elemId );
node.linkAttr(vnode, “DRAWING.ELEMENT”, elemname);

node.add(node.root(), prefix.text + “Highlight”,“HIGHLIGHT”,15,-200,0);

node.link(“Top/” + prefix.text +“HighlightMatte”,0,“Top/” + prefix.text + “Highlight”,1);

}

if(bothRB.checked == true)
{

node.link(“Top/” + prefix.text + “Tone”,0,“Top/” + prefix.text + “Highlight”,0);

}

if(CompositeRB.checked == true)
{

node.link(“Top/” + prefix.text + “Highlight”,0,“Top/Composite”,0);

}

}

Which video are you referring to, James? Aside from that, exactly what does this script do and how do you use it?

It is just an old video in my channel, when I did a few scripting tutorials.

The script adds tone & highlight along with a drawing for the mask ready to hook up to your drawing. You need to use different prefixes for each one or it will throw back an error.

I used it sometimes so I don’t have to get up the structure in network view. It was also good for teaching lots of stuff in scripting.


Someone just said they couldn’t read it all cause of the video quality so i posted it here :slight_smile:

Thanks, I would of posted it there, but only you can :slight_smile:

Holy crap, you can make custom tools with scripting? time for me to checkout your script tutorials Raider.
I tried your script, awsome.

yeah you can do some cool things. I also made scripts to setup steroscopic cameras super fast and create primative 3D objects. That said I really never got that deep into it due to lack of time.

I really wish i had time to make more tutorials, i make plans but alas other stuff always seems to come up.

I would be interesting to see if you made any scripts what sort of things you did.

Well Raider I’ll keep you updated as soon as I learn scripting lol.

I’ll throw this in the Scripts bin to make it easier to find later

Yeah I did that just because I don’t want it to get cluttered with other things. I find that when I make bins people tend to throw things willy-nilly in them. 8)

~Lilly