Forum Replies Created

Page 13 of 32
  • Xavier Gomez

    November 5, 2015 at 2:44 pm in reply to: Expression

    This might work:

    completion = (pickwhip the radial wipe completion property) ;
    linear(completion, 0, 100, 6000, 8000);

    Xavier

  • Can it be that the project as more than one comp named “02 Scene”, and the first one that appears in the project panel doesnt have the required layer ?

  • Xavier Gomez

    November 3, 2015 at 5:14 pm in reply to: Calculating overlying opacities…

    I had missed the slider thing, didnt see.
    You have 3 opacities and just one slider, so it’s not clear what the slider is expected to do.

    These 2 expressions assume that the slider value (range 0-100) gives the percentage opacity layer “A1” gets, and the second one adjusts the opacity for layer “A2”

    A1:

    B = thisComp.layer("B").transform.opacity;
    pc = clamp(thisComp.layer("CONTROLLER").effect("A1 percent")("Slider"), 0, 100)/100;
    B*pc;

    A2:

    B = thisComp.layer("B").transform.opacity/100;
    pc = clamp(thisComp.layer("CONTROLLER").effect("A1 percent")("Slider"), 0, 100)/100;
    A1 = B*pc;
    A1 == 1 ? 0 : 100*(B-A1)/(1-A1);

    Xavier

  • Xavier Gomez

    November 3, 2015 at 12:17 pm in reply to: Calculating overlying opacities…

    If you have two layers “TOP” and “BOT”, and set
    top = layer(“TOP”).transform.opacity/100;
    bot = layer(“BOT”).transform.opacity/100;

    then the resulting opacity is: total = 100*(top+bot-top*bot)

    So you have to “solve” total = layer(“B”).transform.opacity;
    which does not always have a solution, because opacity is clamped to the range [0,100].

    If you leave the top layer opacity free and set the expression in the bottom layer, it would be:

    top = layer("TOP").transform.opacity/100;
    other = layer("B").transform.opacity/100;
    top == 1 ? value : 100*(other-top)/(1-top);

    (when the opacity of the top layer is 100, the bottom layer is completely hidden – unless its shape/scale has changed).

    Else if you want to control the bottom opacity, the expression for the top layer would be:
    bot = layer("BOT").transform.opacity/100;
    other = layer("B").transform.opacity/100;
    bot == 1 ? value : 100*(other-bot)/(1-bot);

    Xavier.

  • You can try this:

    DX = transform.position[0]-thisComp.layer(“Null 1”).transform.position.value[0];
    ease(DX, -100, +100, -90, 0);

    In this setup, if the layer is moving from left to right, it will start to stand up 100 px before the null, and will be facing the view 100px after.

    Xavier.

  • We got pretty lucky there 😉

    For the other question i’m not optimistic.

    If you have several layers, the first expression can become slow.

    Now your second expression queries the value of that slider with a slow expression, and moreover asks that slow slider to look back in time at every frame. It can’t be fast.

    How many layers do you have ?
    Can you post a screenshot for both comps?
    Maybe there is another way to reach your goal.

    (Edit: in case you are wondering, your second expression does not look back until frame 0, it does stop when it finds a trigger so i don’t think it can be changed to something faster).

    Xavier.

  • This ?

    theComp = comp("compname");
    N = theComp.numLayers;
    val = value; // the prexpression value of the current property (slider)

    for (n=1; n<=N; n++){ try{ L=theComp.layer("layername" + n); if (L.transform.opacity>0 && L.effect("Einstellungen für Schieberegler")("Schieberegler").value){ // increment the slider value val += L.transform.position.value[0]; }; // else do nothing } catch(e){ // ignore (the layer does not exist, or the effect "Einstellungen für Schieberegler" does not exist) }; }; // final result: val;

  • Xavier Gomez

    October 12, 2015 at 5:28 pm in reply to: Ae script import, search, then add to active comp

    I read the code again : i forgot the beginUndoGroup…
    I bet you would have realised anyway, and you’ll probably have to edit it quite a lot to get to what you actually want.

  • Xavier Gomez

    October 12, 2015 at 7:37 am in reply to: Ae script import, search, then add to active comp

    Hi,

    one major error is the line :

    var ImportOptions = new ImportOptions(File(Path));

    (you can’t redefine ImportOptions to be something else).

    This code would do most of what you want i think, except that it doesnt duplicate the imported comps.
    Also it adds imported comps in the alphabetical order, which might be completely wrong.

    function CALL (){

    // importing a footage might change the activeItem, so get it now.
    var comp = app.project.activeItem;

    var listTxt = List.selection.text ;
    var scriptFile = new File($.fileName);
    // use this if the system folder called "Folder" is in the same directory as the script
    var path = File($.fileName).path + encodeURI("/" + "Folder" + "/"+ ListTxt +".aep");
    var file = new File(path);
    //var file = File.openDialog();
    if (file.exists){
    alert("yeah !");
    var io = new ImportOptions(file);
    if (io.canImportAs(ImportAsType.PROJECT)){
    var aeFolder = app.project.importFile(io);
    var N = aeFolder.numItems, n;
    // the variable aeFolder represents the imported project (as a folder in the project panel)
    alert("project imported !");
    if (rnPanel.grp.rnG.rnTabbedPanel.rnCMT.ImComp.value){
    //if (true){
    var j=0;
    if (comp instanceof CompItem){
    for (n=1; n<==N; n++){ if (aeFolder.item(n).typeName === "Composition"){ // add that imported comp to the active comp ++j; j===1 ? comp.layers.add(aeFolder.item(n)) : comp.layers.add(aeFolder.item(n)).moveAfter(comp.layer(j)); }; }; alert(j + " imported comps have been added to the active comp"); } else{ alert( "No comp is active. Imported comps won't be added."); }; }; } else{ alert("Can't import that file as project"); }; }; app.endUndoGroup(); return; }; CALL();

    (edit : forgot to put the code inside code tags)

  • Xavier Gomez

    October 1, 2015 at 7:08 am in reply to: Loop through motion tracker points

    Sorry, i didnt see your post immediately.

    if (selectedLayers[i].property(“motionTracker”)){/**/}

    ==> this tells you if the layer has a motion tracker group, that is, can accept trackers.
    I think (not sure) that only layers with matchName “AVLayer” can be tracked (Solids, precomps, footage, etc) but not cameras, lights, texts and shapes. So, it should be equivalent to (not sure..)
    if (selectedLayers[i].matchName === “AVLayer”){/**/}

    Nevermind. Then, if the first test is true, to check that the layer actually has tracker(s): if (myLayer.motionTracker.numProperties>0). Overall :

    if (myLayer.motionTracker && myLayer.motionTracker.numProperties>0){/**/}

    This tells if the motion tracker group exists and has trackers (hence is visible in the timeline).
    It can still be that there are no tracker point in it, for instance the user deleted all tracker points…

    One last thing, the notation “myLayer.motionTracker…” is the one that appears if you activate an expression somewhere on a tracker property. It’s compact and handy, but you can also use matchNames:

    whole tracker group : “ADBE MTrackers”
    tracker 1: “ADBE MTracker”
    tracker point 1: “ADBE MTracker Pt”

    if (myLayer.property(“ADBE MTrackers”) && myLayer.property(“ADBE MTrackers”).numProperties>0){/**/}, etc

    Xavier

Page 13 of 32

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