Forum Replies Created

Page 1 of 2
  • Davis Lindsay

    July 2, 2013 at 11:26 pm in reply to: Scripting date Modified or creation

    Wow, that was so easy;

    Tunnel vision totally had me there.

    Thanks Dan

    var proj = app.project;
    var comp = proj.item(2);
    var movFolder = app.project.item(3)
    var movs = app.project.item(3).numItems;
    var newSource = movFolder.item(1);
    var fso, f, s;
    f = File("/slate script/projects/"+newSource.name);
    var lastModifiedDate = new Date(f.created);

    if (f.exists) alert("File exists.");

    alert([lastModifiedDate, f])

  • Hey Glenn,

    This solution works with peak of range and instant falloff.

    You’ll have to convert each expression to key frames after each step.
    This is found under animation > key frame assistant > convert expression

    1 : Simple part, if the audio is below 100 it becomes a zero.

    2 : You may need to relink your sound keys in this part.

    3 : Almost done, relink the slider variable.

    remember to convert expression to key frames after each step.

    hopefully this helps
    regards,

    //1
    //add this to your sound keys output property.

    Math.floor(value/100)

    //2
    //Create an expression slider on the same layer of your sound key effect
    //Add this to the slider

    sound = effect("Sound Keys")("Output 2");
    n = sound.nearestKey(time).index;
    a = 0;
    if ( n>1){
    a = 1;
    }
    current = sound;
    past = sound.key(n-a).value;
    if (current == 1){
    current - past;
    } else {
    0;
    }

    //3
    //Add this to your range selectorâ

  • Davis Lindsay

    December 19, 2012 at 6:15 pm in reply to: Countdown(up) to newyear

    Hello,

    Here’s a solution that will get you from 23:50:00 to 24:09:59 using a text layers source text.

    You can also use the Text >Timecode Effect if you can handle the default font.
    Set your Time Source to custom:
    Time Units = 60
    Starting Frame = 5148000

    fps = (1/thisComp.frameDuration);
    spm = 60/fps;
    fpm = fps*spm

    s = Math.floor(Math.floor(time)%fpm);
    m = Math.floor(Math.floor(time)/fpm);

    if ((s>9) && (m<10)){
    "11"+":"+(50+m)+":"+s
    } else if ((s<=9) && (m<10)){
    "11"+":"+(50+m)+":0"+s
    } else if ((s<=9) && (m>=10)){
    "12"+":0"+(m-10)+":0"+s
    } else if ((s>9) && (m>=10) && (m<20)){
    "12"+":0"+(m-10)+":"+s
    }

    Prepare for today and you’ll survive, prepare for tomorrow and you will thrive.

  • Davis Lindsay

    December 19, 2012 at 5:13 pm in reply to: Train Trigonometry

    That works nicely Dan, thanks.

    Each time I get a response form you I learn something new.
    The parent trick is epic for this.

    Prepare for today and you’ll survive, prepare for tomorrow and you will thrive.

  • Davis Lindsay

    May 30, 2012 at 10:48 pm in reply to: Adding a frame rate to random() function

    Thanks Darby,

    This simple code works better than I imagined.

    Prepare for today and you’ll survive, prepare for tomorrow and you will thrive.

  • Davis Lindsay

    April 26, 2012 at 7:23 pm in reply to: Replace Footage Script

    Hey Dan,

    Thanks for the help today.
    I hacked away at it and I came up with this jumble of code 😛

    Is there a way to compress my two for loops?
    Also, what method would be used to modify my format options when I add to render queue?

    var proj = app.project;
    var comp = proj.item(2);
    var movFolder = app.project.item(3)
    var movs = app.project.item(3).numItems;

    for (i = 1; i <= movs; i++) {
    var newSource = movFolder.item(i);
    comp.duplicate()
    proj.item(3).layer(3).replaceSource(newSource, true);
    proj.item(3).layer(3).name = newSource.name;

    var d = newSource.name.split("_");
    var e = d[2].split(".");
    var f = d[0]+"_"+d[1]+"_"+e[0];

    proj.item(3).name = f;
    alert(movFolder.item(i), "number");
    }
    for (i = 1; i<= movs; i++) {
    app.project.renderQueue.items.add(proj.item(1).item(i))
    }

    Prepare for today and you’ll survive, prepare for tomorrow and you will thrive.

  • Davis Lindsay

    April 26, 2012 at 4:55 pm in reply to: Replace Footage Script

    yeah, the index value counts down like layers for expressions on the timeline.
    so the file structure should actually look like…

    root
    -main folder
    -_template comp
    –text layer
    –text layer
    –video I want to replace
    –text layer
    -movs folder
    –video
    –video 2

    proj
    -item(1)
    –.item(2)
    —.layer(1)
    —.layer(2)
    —.layer(3)
    —.layer(4)
    -item(3)
    –.item(4)
    –.item(5)

    Alrighty… lol
    So that means when I build my program I’ll probably want to have my videos already in a precomp.
    That way when I duplicate my comps hopefully it won’t effect their item number 😛

    Thanks Dan

  • Davis Lindsay

    April 26, 2012 at 4:46 pm in reply to: Replace Footage Script

    Ah, that solves one error message.
    I was missing .layer(3) to define what I was replacing.

    error:
    Unable to call “replaceSource” because of parameter 1. [object TextLayer] is not of the correct type.

    perhaps my vision of the item / layer structure isn’t correct?

    root
    -main folder
    -_template comp
    –text layer
    –text layer
    –video I want to replace
    –text layer
    -movs folder
    –video
    –video 2

    proj
    -item(1)
    –.item(1)
    —.layer(1)
    —.layer(2)
    —.layer(3)
    —.layer(4)
    -item(2)
    –.layer(1)
    –.layer(2)

    //Creates a new project
    var proj = app.project;

    proj.item(1).item(1).layer(3).replaceSource(proj.item(2).layer(2),true);

  • Davis Lindsay

    April 26, 2012 at 4:02 pm in reply to: Replace Footage Script

    Thanks for the reply Dan,

    When I use the replaceSource() method I come up with this error.

    Unable to execute script at line 6. Function proj.item().item().replaceSource is undefined
    It’s probably something small I’m missing.

    //Creates a new project
    var proj = app.project;
    var i = 0;

    proj.item(1).item(1).duplicate();
    proj.item(1).item(2).replaceSource(proj.item(2).item(1), true);
    proj.item(1).item(2).name = proj.item(1).item(1).layer(3).name;

    Prepare for today and you’ll survive, prepare for tomorrow and you will thrive.

  • Davis Lindsay

    April 26, 2012 at 1:55 pm in reply to: Replace Footage Script

    Thanks John,

    I’ll post in expressions.

    Prepare for today and you’ll survive, prepare for tomorrow and you will thrive.

Page 1 of 2

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