Page 1 of 1

Accessing effect parameters

Posted: March 4th, 2012, 10:13 am
by jeremy
I have a script that creates a solid, applies Trapcode Form to it, and sets a bunch of the Form parameters.

As I understand it, there are two methods of accessing effect parameters. The cleaner method is to reference the name of the parameter:

Code: Select all

var Form = FX.addProperty("tc Form");
Form("Size X").setValue(100);	// size x
Form("Size Y").setValue(100);	// size y
Form("Size Z").setValue(100);	// size z
The alternate method is to reference the "parameter ID" (not sure what it is actually called):

Code: Select all

var Form = FX.addProperty("tc Form");
Form(4).setValue(100);	    // size x
Form(5).setValue(100);	    // size y
Form(6).setValue(100);	    // size z
The problem with using the name of the parameter is that there are multiple parameters within form that use the same name (i.e. "Map Over"). The problem with referencing the "parameter ID" is that it requires a lot of guessing and checking to figure out what the parameter you're looking for is numbered. The other problem is that these numbers change between versions as parameters are added or changed. Right now I have a cobbled together script that works, but needs to be modified depending on your version of Form. Is there a better way that I am missing? Insisting that developers not create parameters with shared names?

Re: Accessing effect parameters

Posted: March 6th, 2012, 2:34 am
by Alan Eddie
Check out Gimme proper path on AEScripts.com - it will give you the numerical positions by just selecting them rather than counting. At least then your script is reliable.