Forum Replies Created

Page 16 of 1081
  • Like this maybe:

    p = thisComp.layer("Shape Layer 1")("Contents");
    nGroups = 0;
    for (i = 1; i <= p.numProperties; i++){
    if (p(i).name.indexOf("Group") == 0) nGroups++;
    }
    nGroups
  • Dan Ebberts

    September 25, 2024 at 10:11 pm in reply to: PS Layer Comps to AE

    When importing PSD files, you can set Import Kind to “Composition”, or “Composition – Retain Layer Sizes”. Does that help?

  • Like this maybe:

    s = Math.round(effect("Slider Control")("Slider"));
    txt = value;
    n = 0;
    for (i = 0; i<txt.length; i++){
    if (txt[i] == " "){
    n++;
    if (n == s) break;
    }
    }
    txt.substr(0,i)
  • Dan Ebberts

    September 19, 2024 at 12:16 am in reply to: Trying to adjust inPoint of a layer

    You generally access a marker by its key index, like this:

    property("Marker").key(1)

    or by time, like this:

    property("Marker").nearestKeyIndex(myComp.time)
  • Dan Ebberts

    September 18, 2024 at 1:07 pm in reply to: Trying to adjust inPoint of a layer

    I think I would try not to use any menu commands, if possible. So I’d try a workflow like this: you drop a marker layer at one end of the area you want to cut out and move the CTI (current time indicator) to the other end, and run a function like this (which you could attach to your button):

    function splitAdjust(){
    var myComp = app.project.activeItem;
    if (!(myComp && (myComp instanceof CompItem))){
    alert ("No comp selected.");
    return;
    }
    if (! (myComp.selectedLayers.length > 0)){
    alert("No layer selected.");
    return;
    }
    var myLayer = myComp.selectedLayers[0];
    if (! (myLayer.property("Marker").numKeys > 0)){
    alert("Selected layer has no marker.");
    return;
    }
    var compTime = myComp.time;
    var markerTime = myLayer.property("Marker").keyTime(1);
    myDup = myLayer.duplicate();
    myDup.moveAfter(myLayer);
    if (markerTime < compTime){
    var t1 = markerTime;
    var t2 = compTime;
    }else{
    var t1 = compTime;
    var t2 = markerTime;
    }
    myLayer.outPoint = t1;
    myDup.inPoint = t2;
    myDup.startTime -= t2-t1;
    myLayer.property("Marker").removeKey(1);
    myDup.property("Marker").removeKey(1);
    }
    splitAdjust();
  • Dan Ebberts

    September 17, 2024 at 2:40 pm in reply to: control 3D position to cam

    If that’s the situation, layer moving on z, camera not moving, a position expression like this might work:

    p0 = valueAtTime(0);
    d = length(value,p0);
    v = normalize(thisComp.layer("Camera 1").position - p0);
    p0 + v*d
  • Dan Ebberts

    September 17, 2024 at 1:36 pm in reply to: control 3D position to cam

    Are you animating the photos by moving them on their z axis?

  • Dan Ebberts

    September 17, 2024 at 5:24 am in reply to: control 3D position to cam

    It’s a little ambiguous, so a picture would help.

  • Dan Ebberts

    September 16, 2024 at 3:38 pm in reply to: A question about global variable

    I think the important takeaway is that it’s not reliable. It might appear to work in some situations, but you shouldn’t count on it.

  • Dan Ebberts

    September 15, 2024 at 9:33 pm in reply to: A question about global variable

    I would expect that not to work reliably just because of the way AE is designed to render frames asynchronously, where you can drop the CTI anywhere in the timeline and any expressions will solve without depending on results from previous frames. I suspect there is no good way to do global variables.

Page 16 of 1081

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