Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Extendscript setting Trapcode form property value via script?

  • Extendscript setting Trapcode form property value via script?

    Posted by Jason Ayre on November 8, 2019 at 9:28 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 < 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);
    }
    }
    }

    Jason Ayre replied 6 years, 8 months ago 3 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    November 8, 2019 at 10:39 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

  • Oleg Pirogov

    November 8, 2019 at 10:45 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.

  • Jason Ayre

    November 8, 2019 at 11:56 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?

  • Jason Ayre

    November 9, 2019 at 12:01 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

  • Dan Ebberts

    November 9, 2019 at 12:17 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

  • Jason Ayre

    November 10, 2019 at 12:00 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.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy