Forum Replies Created

Page 27 of 1081
  • Dan Ebberts

    April 9, 2024 at 3:31 pm in reply to: color change expression

    Try it this way:

    c1 = thisComp.layer("Null 1").effect("Color 1")("Color");
    c2 = thisComp.layer("Null 1").effect("Color 2")("Color");
    n = 0;
    if (numKeys > 0){
    n = nearestKey(time).index;
    if (key(n).time > time) n--;
    }
    if (n == 0){
    c1;
    }else if (n == numKeys){
    c2;
    }else{
    if (n%2){
    linear(time,key(n).time,key(n+1).time,c1,c2);
    }else{
    linear(time,key(n).time,key(n+1).time,c2,c1);
    }
    }
  • Dan Ebberts

    April 3, 2024 at 1:40 pm in reply to: Noob Question — Specifying X and Y

    Yes, multi-dimension property values are stored as JavaScript arrays, so to access the individual elements you use JavaScript’s square bracket array notation. Once you have those values stored in local one-dimensional variables (x and y in this case) you wouldn’t use array notation with those. The brackets in Math.round(x) are associated with the Math.round() function, and have nothing to do with x or y. It’s all core JavaScript syntax. Hope that helps.

  • Dan Ebberts

    March 31, 2024 at 12:45 pm in reply to: After Effects Scripting Help!

    Try it this way:

    var selectedLayer= app.project.activeItem.selectedLayers[0];
    var myAnimator = selectedLayer.property("ADBE Text Properties").property("ADBE Text Animators").addProperty("ADBE Text Animator");
    var mySelector = myAnimator.property("ADBE Text Selectors").addProperty("ADBE Text Selector");
    var myPositionProp = myAnimator.property("ADBE Text Animator Properties").addProperty("ADBE Text Position 3D");
    var myOpacityProp = myAnimator.property("ADBE Text Animator Properties").addProperty("ADBE Text Opacity");
  • I think the expression would need to know the gap between layers. Then something like this would work (it assumes all layers in the comp are participating):

    gap = 50
    n1 = 0;
    for (i = 1; i < index; i++){
    if (thisComp.layer(i).opacity == 0) n1++;
    }
    n2 = 0;
    for (i = index+1; i <= thisComp.numLayers; i++){
    if (thisComp.layer(i).opacity == 0) n2++;
    }
    value - [0,(n1-n2)*(height +gap)/2]
  • This is a simple example with lots of assumptions. It assumes that the layers participating are at the top of the layer stack (layers 1 thru n). It expression counts the number of layers above its host layer that have opacity = 0. For each of those it finds, it move upwards a distance equal to its own height.:

    n = 0;
    for (i = 1; i < index; i++){
    if (thisComp.layer(i).opacity == 0) n++;
    }
    value - [0,n*height]
  • Dan Ebberts

    March 29, 2024 at 12:51 pm in reply to: Dynamic Text Animator Index for Duplicates

    Try this:

    animatorIndex = thisProperty.propertyGroup(2).propertyIndex;
  • Dan Ebberts

    March 29, 2024 at 5:05 am in reply to: Dynamic Text Animator Index for Duplicates

    Where is the expression applied?

  • Dan Ebberts

    March 29, 2024 at 3:41 am in reply to: Disable a Composition Programmatically

    What eyeball are you talking about for comps? Comps as layers have layer eyeballs, but comps in the project bin don’t have eyeballs. If you’re talking about a comp layer, then to access it’s eyeball, you have to reference it as a layer.

  • The name testing could be more robust, but this might get the job done for you. I’m not sure why you’d use a point control if you’re only interested in the x dimension, but here it is:

    max = 0;
    for (i = 1; i <= thisComp.numLayers; i++){
    if (thisComp.layer(i).name[0] == "A"){
    try{
    x = thisComp.layer(i).content("Rectangle 1").content("Rectangle Path 1").size[0];
    max = Math.max(max,x);
    }catch(e){
    }
    }
    }
    [max,0]
  • Dan Ebberts

    March 26, 2024 at 8:38 pm in reply to: Setting Min and max values to Sound reactive effect

    Fair enough. The linear() function just says that as the value of variable temp varies from 10 to 100, remap that linearly to an output range of 90 to 100. Any value of temp below 10 gets clamped to an output value of 90 and any value of temp above 100 gets clamped to an output value of 100.

Page 27 of 1081

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