Forum Replies Created

Page 10 of 24
  • This is how to do it.

    I’ve highlighted what you needed to alter, but you weren’t far off.

    prefix = “$”;
    tStart = .4;
    startCount = 0;
    endCount = parseFloat(thisComp.layer(“End Count”).text.sourceText);
    if (isNaN(endCount)) endCount = “0”;

    countDur = parseFloat(thisComp.layer(“Max Duration”).text.sourceText);
    if (isNaN(countDur)) countDur = “0”;

    t = Math.max(time-tStart,0);
    fin = Math.round(linear(t,0,countDur,startCount,endCount));

    prefix + fin

  • Scott Mcgee

    August 22, 2018 at 9:47 am in reply to: Using expression to loop layer and trim Work Area?

    Forgot to mention that if you want to update comp length based on the outPoint of a selected layer.

    var myComp = app.project.activeItem;
    var myLayer = myComp.selectedLayers[0];
    myComp.duration = myLayer.outPoint;

    or you can do it based on cursor of time

    var myComp=app.project.activeItem;
    myComp.duration = myComp.time;

    So these are a few other options available to you.

  • Scott Mcgee

    August 22, 2018 at 8:49 am in reply to: Using expression to loop layer and trim Work Area?

    I’ve updated it to include frames.

    There might be an easier way to add frames and seconds, but I’ve bodged it this way and it works fine.

    var win = new Window (“palette”,”Comp Duration”,undefined);

    var title = win.add(‘statictext’,undefined,”Seconds”);
    var myTextSec = win.add(‘edittext’,[100,120,150,140],0);
    var title2 = win.add(‘statictext’,undefined,”frames”);
    var myTextFrames = win.add(‘edittext’,[100,120,150,140],0);
    var btn = win.add(‘button’,undefined,”Submit”);

    btn.onClick = function(){
    var myComp = app.project.activeItem;
    var text1 = myTextSec.text;
    var text2 = myTextFrames.text;
    myComp.duration = text1;
    myComp.duration += text2*myComp.frameDuration;// set duration
    }

    win.show();

    All it’s doing is changing the comp based on seconds, then changing it a second time to add the frames separately. If someone can offer a way to change it in one line cool. Otherwise this will work fine for you.

  • Scott Mcgee

    August 21, 2018 at 4:30 pm in reply to: Using expression to loop layer and trim Work Area?

    I’d have to dig it out as I don’t work for that company anymore, but there is no reason why you couldn’t use it to do it based on a marker, but I did mine based on seconds.

    Unless Someone answers before hand I will come back to you maybe later on or tomorrow

  • Scott Mcgee

    August 21, 2018 at 7:57 am in reply to: Using expression to loop layer and trim Work Area?

    You can do it with a script, otherwise you have to manually trim. Expressions don’t trim your Comp.

    So you could implement your expression into said script. Add a text box for time length, so it’s a bit more dynamic. Hit the submit button and that will trim your activeComp and add the expression to your layer.

    I do something similar for idents I used to make that ranged between 2-15 seconds.

    If you want to trim the layer and not the comp. I guess you could add an opacity expression to switch itself off, but again if that’s the case. Manually or script is the only way.

  • Scott Mcgee

    August 20, 2018 at 7:41 am in reply to: parent layer vs position expression

    No other things and that all makes sense. I’ll have a stab at it today and see how that does.

    Cheers for the help and advice.

  • Scott Mcgee

    August 17, 2018 at 7:44 am in reply to: parent layer vs position expression

    Ooo, nearly worked.

    So it rotates based on the position perfectly, but is there anyway to get the text to anchor itself directly into the centre of the circle. That was my other problem.

    because I want to utilise the anchor in the centre of the comp for my circle to rotate. I couldn’t figure out how to get my text to sit in the circle as it places itself based on the position which it thinks is the centre of the comp. But that’s a cool trick for the rotation.

    As I’m still learning, what does this mean though?

    xd *= xd;
    yd *= yd;

    I understand the rest, but that I don’t.

  • After reading Dan’s response and your it makes more sense.

    After effects is a lot more fiddly. I’ll still never grasp coding entirely, but i’ve learnt most my stuff here from Dan or others. So if Dan’s saying there are some ways around it. Might be worth delving a bit more for future reference. The more stuff is document the better I say.

  • Have you got a screen grab, I’m not gonna lie I’m completely lost. It sounds very simple, but I’m missing something hahaha

    So to clarify

    Speed dial has the keyframes? or rpm dial?

    Then which ever one has the keyframes, the other is to copy but +10?

    If that’s the case same expression I previously gave, but change speed dial to rpm dial.

  • in anchor point firstly

    r = sourceRectAtTime();
    [r.left + r.width, r.top + r.height/2]

    This will automatically place the anchor point always to the right hand side.

    Then in position.

    x = 150; //(you can assign it to a slider swell if you want multiple.)
    y = value[1];
    [x,y]

Page 10 of 24

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