ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Extendscript setting Trapcode form property value via script?

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jason Ayre
Extendscript setting Trapcode form property value via script?
on Nov 8, 2019 at 9:28:03 pm

Having an issue with trapcode form / setting a value for a specific property via script, and wondering if anyone knows how to resolve. Most of the other properties I can set fine, but this one: (effect is layer.effect("Form"))



effect.property("Disperse F2").setValue(100);

Throws a "This property's propertyValueType is PropertyValueType.NO_VALUE

Yet others, i.e.

effect.property("Random Seed F2").setValue(1234);

works fine

Anyone have an idea how to resolve? Or how I can get the name of the actual property
Also if I select the property directly, and run a function to print the selected property data, i.e. the code below, it prints "Disperse F2 1", which should be the property I'm targeting, and it's showing a PropertyValueType.OneD -- So I'm quite confused

function printSelectedPropertyData(layer) {
var myProps = layer.selectedProperties;
var myProp;
var n;
for (var i = 0; i &lt; myProps.length; i++){
myProp = myProps[i];
if (myProp.propertyType == PropertyType.PROPERTY){
switch(myProp.propertyValueType){
case PropertyValueType.OneD:
n = 1;
break;
case PropertyValueType.TwoD:
case PropertyValueType.TwoD_SPATIAL :
n = 2;
break;
case PropertyValueType.ThreeD:
case PropertyValueType.ThreeD_SPATIAL:
n = 3;
break;
case PropertyValueType.COLOR:
n = 4;
break;
default:
n = 0; // just in case
break;
}
alert (myProp.name + " " + n);
}
}
}


Return to posts index

Dan Ebberts
Re: Extendscript setting Trapcode form property value via script?
on Nov 8, 2019 at 10:39:35 pm

Hard to say for sure, but Form has so many parameters it's possible there are multiple parameters with the same name. So I'd try using the Match Name of the particular parameter you're after instead of just the Name.

Dan



Return to posts index

Oleg Pirogov
Re: Extendscript setting Trapcode form property value via script?
on Nov 8, 2019 at 10:45:50 pm

There is another property called "Disperse" - the one that seems to be a property group in "Layers Maps" but
technically has property type "PROPERTY" and property value type "NO_VALUE". It has lesser property index than the Disperse you want, so effect.property("Disperse F2") references the wrong one.

I suggest referencing it by index or match name.


Return to posts index


Jason Ayre
Re: Extendscript setting Trapcode form property value via script?
on Nov 8, 2019 at 11:56:49 pm

Thanks guys, I will try that, except I haven't been able to figure out how to set a property via the match name, do you happen to have an example of doing so?


Return to posts index

Jason Ayre
Re: Extendscript setting Trapcode form property value via script?
on Nov 9, 2019 at 12:01:36 am

Actually, I guess my problem is more with getting the match name for the correct property. I think once I have that I can just do effect.property(match_name).setValue(), right? (I believe I tried it using the match name but got the same error, because it was referencing the wrong matchName) -- I can't seem to figure out how to loop through an effect to get the property keys/lookup the match names for them


Return to posts index

Dan Ebberts
Re: Extendscript setting Trapcode form property value via script?
on Nov 9, 2019 at 12:17:03 am

If you're looping through selected properties,

alert (myProp.matchName);

should work. Or, get your hands on Jeff Almasol's wonderful rd_GimmePropPath.jsx script.

Dan



Return to posts index


Jason Ayre
Re: Extendscript setting Trapcode form property value via script?
on Nov 10, 2019 at 12:00:07 am

thanks Dan, I'll check out that script and see if I get a different result. The problem is that I was getting a reference to the unsettable field match name, when I was alerting the selected property.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]