Forum Replies Created

Page 149 of 1081
  • Dan Ebberts

    April 23, 2020 at 8:26 pm in reply to: Linking value to specific keyframes

    I rushing through it, I made the code more complicated than necessary. This should work for the first version:


    temp = thisComp.layer("Reveal Text Box").content("Rectangle Path 1").size[1];
    if (time < key(2).time)
    easeOut(time,key(1).time,key(2).time,[0,temp],[0,0])
    else
    easeIn(time,key(3).time,key(4).time,[0,0],[0,temp]);

    and the second:


    temp = thisComp.layer("Reveal Text Box").content("Rectangle Path 1").size[1];
    if (time < key(2).time)
    easeOut(time,key(1).time,key(2).time,[0,0],[0,temp])
    else
    easeIn(time,key(3).time,key(4).time,[0,temp],[0,0]);

    Dan

  • Dan Ebberts

    April 23, 2020 at 8:21 pm in reply to: Random opacity on specific way

    It sounds do-able, but it seems like there’s info missing. Maybe a more detailed example would help.

    Dan

  • Dan Ebberts

    April 23, 2020 at 7:51 pm in reply to: Linking value to specific keyframes

    That would be like this:


    temp = thisComp.layer("Reveal Text Box").content("Rectangle 1").content("Rectangle Path 1").size[1]
    if (time < key(1).time)
    [0, 0]
    else if (time < key(2).time)
    easeOut(time,key(1).time,key(2).time,[0,0],[0,temp])
    else
    easeIn(time,key(3).time,key(4).time,[0,temp],[0,0]);

    Also, the previous version has a typo in it. The last line should have been like this:

    easeIn(time,key(3).time,key(4).time,[0,0],[0,temp]);

    Dan

  • Dan Ebberts

    April 23, 2020 at 7:28 pm in reply to: Linking value to specific keyframes

    I guess something like this could work:


    temp = thisComp.layer("Reveal Text Box").content("Rectangle Path 1").size[1];
    if (time < key(1).time)
    [0, temp]
    else if (time < key(2).time)
    easeOut(time,key(1).time,key(2).time,[0,temp],[0,0])
    else
    easeIn(time,key(3).time,key(4).time,[00],[0,temp]);

    Dan

  • Dan Ebberts

    April 23, 2020 at 6:43 pm in reply to: Linking value to specific keyframes

    It depends. What’s happening between the keyframes? Is there any easing going on?

    Dan

  • If you drag the file into your comp’s timeline, you can get at it like this:

    thisComp.layer(“Values.csv”)(“Data”)(“Number of Rows”)

    Dan

  • Dan Ebberts

    April 22, 2020 at 4:51 pm in reply to: Dan Ebberts wonderful expressions

    Something like this should let you control the start of the keyframe sequence with the In Point slider, and the duration with the Duration slider:


    ip = effect("In Point")("Schieberegler");
    d = effect("Duration")("Schieberegler");
    if (time < ip){
    key(1).value
    }else if (time < ip + d){
    t = linear(time-ip,0,d,key(1).time,key(numKeys).time);
    valueAtTime(t)
    }else{
    key(numKeys).value
    }

    Dan

  • Dan Ebberts

    April 22, 2020 at 3:32 pm in reply to: copy markers from layer markers to comp markers

    This should work:


    function CopyLayerMarkersToComp(){
    var theComp = app.project.activeItem;
    if ((theComp == null) || ! (theComp instanceof CompItem)){
    alert ("No comp active.");
    return;
    }
    if (theComp.selectedLayers.length == 0){
    alert("No layer selected.");
    return;
    }
    var theLayers = theComp.selectedLayers;
    var theLayer;
    var theMarker = new MarkerValue("");
    var theTime;
    for (var i = 0; i < theLayers.length;i++){
    theLayer = theLayers[i];
    for (var j = 1; j <= theLayer.property("Marker").numKeys; j++){
    theTime = theLayer.property("Marker").keyTime(j);
    theMarker = theLayer.property("Marker").keyValue(j);
    theComp.markerProperty.setValueAtTime(theTime,theMarker);
    }
    }
    }
    CopyLayerMarkersToComp();

    Of course only one comp marker can exist at a given time, so if two selected layers have markers at the same time, the layer selected last wins.

    Dan

  • Dan Ebberts

    April 20, 2020 at 9:50 pm in reply to: AE Scripting: Change value of a variable?

    If the selected property is the effect itself (not if it belongs to an effect) you should get “dog”.

    Dan

  • Dan Ebberts

    April 20, 2020 at 8:25 pm in reply to: AE Scripting: Change value of a variable?

    When you do this:

    var myProp = selectProps.isEffect;

    myProp will be a boolean, so then you can do this:

    var T = myProp ? “dog” : “cat”

    or, closer to the way you were doing it:

    if (myProp)
    var T = “dog”
    else
    var T = “cat”;

    In any case, you don’t need to do this:

    if (myProp == “false”)

    you would do this instead:

    if (! myProp)

    or, if you insist on doing it that way, at least lose the quotes:

    if (myProp == false)

    Dan

Page 149 of 1081

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