Accessing effect parameters

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
jeremy
Posts: 3
Joined: February 22nd, 2012, 7:15 pm

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?
Alan Eddie
Posts: 30
Joined: January 12th, 2012, 1:36 am
Location: Ireland
Contact:

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.
Alan Eddie
_______________________
www.alaneddie.com
3d Animation and VFX
RTE
Dublin
Post Reply