Any way to set Zoom Independent Thickness as default?

This has become one of my favorite functions and I would love to be able to set it as default for new drawings. Is it possible through scripting or some setting I am missing?

I’m using Pro. If it is something that can be scripted I would be able to do that without too much difficulty. The difficulty I have hit is that the Scripting guide has little in the way of menu functions that I can use. Is there any documentation on menu functions? If so, that would be most helpful.

Thanks. Is there anywhere I can go to read up in detail what parameters are valid for these scripting functions? I am curious how you know to use “ZOOM_INDEPENDENT_LINE_ART_THICKNESS” or anything else for that matter. It doesn’t seem to be listed in the scripting guide.

Also, can a script be run through the command line without opening Animate Pro?

Wow. That is a treasure trove of information. Thanks.

Is it possible to run a script without opening Animate Pro?

Good morning Lilly.

I used the script to change multiple drawing modules at once.
It works great.

I would like to ask you, is there a way to set the proportional value by script?

I’m working on Harmony 7.8.1
tnx in advance

THANK YOU SO SO SO MUCH!
you just saved me days of work.

a virtual hug
;D

Thank you very much.

I am loving the template. So many options! Another question.

The WRITE module has an listing with sub-attributes in them.








How do I set the enabling options using node.setTextAttr(“node_path”, “attrName”, atFrame, “attrValue”) in this case?

And is there a way to create a new scene via the command line?

Are you using Animate Pro or Harmony Standalone? We have a script written for Harmony but not for Animate Pro at the moment.

~Lilly

I was just trying to write the script myself, but I had run into a slight difficulty with setting the Normal Thickness to false. Check out the in-progress script that I have (it works apart from that). I’ll have to track down why that one’s not working though. Perhaps I have the name wrong.

function zoomIndependent() {
//This function will set Zoom Independent Line Thickness on the selected nodes
//Written by Lilly Vogelesang

var numNodes = selection.numberOfNodesSelected();
var selNode;
var i;

for (i=0; i<numNodes; i++) {
selNode = selection.selectedNode(i);
node.setTextAttr(selNode, “ADJUST_PENCIL_THICKNESS”, 0, “true”);
node.setTextAttr(selNode, “NORMAL_LINE_ART_THICKNESS”, 0, “false”);
node.setTextAttr(selNode, “ZOOM_INDEPENDENT_LINE_ART_THICKNESS”, 0, “true”);
}

}

So I figured out what I was doing wrong, you need to set it as true with Y and false with N. To find out more about the scripting you can download the Scripting Template, which has in it an XML file that has all the modules with all the attributes. So you can look at it in a text editor to check out the attributes.

You can download the Scripting Template from the Resources section at the bottom under Documentation.

http://beta.toonboom.com/professionals/animating/resources

There’s another way too, you can also check out inside the Resources folder in your application directory, under editors, and then you can look at read.xml and that lists the attributes for the read module.

So here’s the corrected script:

function zoomIndependent() {
//This function will set Zoom Independent Line Thickness on the selected nodes
//Written by Lilly Vogelesang

var numNodes = selection.numberOfNodesSelected();
var selNode;
var i;

for (i=0; i<numNodes; i++) {
selNode = selection.selectedNode(i);
node.setTextAttr(selNode, “ADJUST_PENCIL_THICKNESS”, 0, “Y”);
node.setTextAttr(selNode, “NORMAL_LINE_ART_THICKNESS”, 0, “N”);
node.setTextAttr(selNode, “ZOOM_INDEPENDENT_LINE_ART_THICKNESS”, 0, “Y”);
}

}

Oh sorry! I got so caught up in the other question that I forgot that one. Are you on windows or mac?

From the command line, you can browse over to the application directory, and find the AnimatePro executable (the path is slightly different on windows and on mac). Then you can do:

AnimatePro -script

For example:

./AnimatePro -script “batchtest()” ~/Documents/TestMeAnimPro/TestMeAnimPro.anim

(on Mac)

When you create a script in the application, in the scripting interface, it saves that script directly to the evironment, so you can just call the script from the command line. If you have an outside script, though, that you have saved to a text file, then you’ll need to compile it first. I didn’t fully test this but you should be able to do it like:

AniamatePro -compile

Hope this helps!

Yes there is. It’s the same set attribute function, and the attribute here is called MULT_LINE_ART_THICKNESS

Here it is added to the script:

function zoomIndependent() {
//This function will set Zoom Independent Line Thickness on the selected nodes
//Written by Lilly Vogelesang

var numNodes = selection.numberOfNodesSelected();
var selNode;
var i;

for (i=0; i<numNodes; i++) {
selNode = selection.selectedNode(i);
node.setTextAttr(selNode, “ADJUST_PENCIL_THICKNESS”, 0, “Y”);
node.setTextAttr(selNode, “NORMAL_LINE_ART_THICKNESS”, 0, “N”);
node.setTextAttr(selNode, “ZOOM_INDEPENDENT_LINE_ART_THICKNESS”, 0, “Y”);
node.setTextAttr(selNode, “MULT_LINE_ART_THICKNESS”, 0, “2”);
}

}