Forum Replies Created

Page 7 of 10
  • Bryan Woods

    May 7, 2013 at 5:47 pm in reply to: Move created layer below selected layers

    No go after testing. I also noticed it looks like there was an extra “)” after myComp.selectedLayers.length; i++. I took that out since it was first getting hung up over that. After removing that, I get a new error: “Unable to execute at line 29. Unable to call “moveAfter” because of parameter 1. undefined is not of correct type”.

    Here’s the portion of my script that is handling this for your reference.

    //Define project and active items
    var proj = app.project;
    var theComp = proj.activeItem;
    var selectedLayers = theComp.selectedLayers;

    //Count number of selected layers
    var maxIndex = -1;
    for (var i = 0; i < selectedLayers.length; i++){
    maxIndex = Math.max(maxIndex,selectedLayers[i].index);
    }
    var lastSelectedLayer = selectedLayers[maxIndex];

    //Create Null Object to act as controller for items
    controlNull = theComp.layers.addNull();
    controlNull.source.name = "Logo_Controller";
    controlNull.moveAfter(lastSelectedLayer);

    Thanks for your help.

    EDIT:: Line 29 is referring to the line that starts with “ControlNull.moveAfter”

  • Bryan Woods

    April 13, 2013 at 1:43 am in reply to: Change layer index by script

    Looks like CC botched your code. Should probably be this:


    var activeItem = app.project.activeItem;
    var activeLayers=activeItem.layers;
    for(i=1;i<=activeLayers.length;i++){
    if(app.project.activeItem.layer(i).selected){
    app.project.activeItem.layer(i).moveToBeginning();
    };

    };

  • Bryan Woods

    April 12, 2013 at 4:56 am in reply to: Change layer index by script

    I’m curious about this too actually. Specifically, how to send a layer to the top or bottom of a comp.

  • Aaaah wonderful! MAN that makes reading the expression so much nicer. Thank you for the tip! Now I need to go back and update all my scripts with this.

  • Bryan Woods

    April 1, 2013 at 7:29 pm in reply to: expression to emulate a bobber floating in water

    So, are you looking down at the water from above? Thats what your linked image appears to be.

    If so, I would use this expression to oscillate the scale of the layer. You could also apply it to rotation and modify it a bit to get that subtle rocking.


    amp = 100;
    freq = 1;
     
    s = amp*Math.sin(time*freq*Math.PI*2);
    value + [s]

  • Bryan Woods

    March 25, 2013 at 8:08 pm in reply to: Flicker opacity expression issue

    Ah, thought so. Your solution seems to work for both CS5.5 and CS6, so thank you.

    I’ve never seen Number() used before though. What is that doing that fixes this for CS5.5? Is it just presenting the result within it as a number instead of as a string?

    Thanks again for you help!

  • I figured out the problem. The issue though was the warning message wouldn’t tell me where the error was. Just a line number. But that could be referring to the script, the expression, or the text file! Very frustrating! I eventually found out it was the text file that I was pulling from. I forgot to close my quoted text while adding a new variable.

  • Bryan Woods

    February 22, 2013 at 10:38 pm in reply to: Optics Compensation position expression…

    unless I’m missing something here, couldn’t you use AE’s built-in magnify effect instead of resorting to expressions? Would probably be faster rendering than the optics compensation…

  • Bryan Woods

    January 29, 2013 at 2:20 am in reply to: Wiggle Flicker expression

    Yup, thats it. Thank you Dan.

    Final flicker code:


    //triggers a flicker at every layer marker lasting 12frames

    n = 0;
    duration = 12; //# of frames from marker
    if (marker.numKeys > 0){
     n = marker.nearestKey(time).index;
     if (marker.key(n).time > time){
       n--;
     }
    }

    if (n == 0){
     value;
    } else {
    if (timeToFrames(time) < (timeToFrames(marker.key(n).time)+duration)){
    wiggle (10,90);
    }else{
    value;
    }
    }

  • Bryan Woods

    January 29, 2013 at 1:32 am in reply to: Wiggle Flicker expression

    Hold the phone. I got it.

    n = 0;
    if (marker.numKeys > 0){
    n = marker.nearestKey(time).index;
    if (marker.key(n).time > time){
    n--;
    }
    }

    if (n == 0){
    value;
    } else {
    if (time < (marker.key(n).time+1)){
    wiggle (5,100);
    }else{
    value;
    }
    }

    However I’m going by timecode, and I’d like to work in frames. I know there’s a timeToFrames, but how do I work that in to this? Do I need to set time converted to frames as a variable? How do I use that with marker.key?

Page 7 of 10

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