Forum Replies Created

  • Thank God for Dan… in fact he is a god. He gave me the key which is basically turning this

    s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

    to this:

    s = (Math.floor(linear (t, 0, dur, beginCount, endCount)/100)*100).toFixed(numDecimals);

    The full working is right down below. Be sure to give a shout out to Dan.

    numDecimals = 2;
    commas = true;
    dollarSign = true;
    beginCount = -1999;
    endCount = 1999;
    dur = 4;

    t = time - inPoint;
    s = (Math.floor(linear (t, 0, dur, beginCount, endCount)/100)*100).toFixed(numDecimals);

    prefix = "";
    if (s[0] == "-"){
    prefix = "-";
    s = s.substr(1);
    }
    if(dollarSign) prefix += "$";

    if (commas){
    decimals = "";
    if (numDecimals > 0){
    decimals = s.substr(-(numDecimals + 1));
    s = s.substr(0,s.length - (numDecimals + 1));
    }
    outStr = s.substr(-s.length, (s.length-1)%3 +1);
    for (i = Math.floor((s.length-1)/3); i > 0; i--){
    outStr += "," + s.substr(-i*3,3);
    }
    prefix + outStr + decimals;
    }else{
    prefix + s;
    }

  • Orme Dominique

    February 5, 2013 at 8:42 pm in reply to: incrementing by 100

    Worked like a charm. Now I just need to start working these out on my own. Thanks for all your help, Dan.

  • Hey Dan,

    Can you help me me with the commas on this one. It’s incerment just fine but the commas aren’t working.

    I was poking around and I found this script on your Motion Script site it works pretty well but I can’t figure how to make it increment. I like how you outline what each section is doing, it helped understand it for sure. I need to get a lot better at doing expressions, its one of my goals this year.

    numDecimals = 2;
    commas = true;
    dollarSign = true;
    beginCount = -1999;
    endCount = 1999;
    dur = 4;

    t = time – inPoint;
    s = linear (t, 0, dur, beginCount, endCount).toFixed(numDecimals);

    prefix = “”;
    if (s[0] == “-“){
    prefix = “-“;
    s = s.substr(1);
    }
    if(dollarSign) prefix += “$”;

    if (commas){
    decimals = “”;
    if (numDecimals > 0){
    decimals = s.substr(-(numDecimals + 1));
    s = s.substr(0,s.length – (numDecimals + 1));
    }
    outStr = s.substr(-s.length, (s.length-1)%3 +1);
    for (i = Math.floor((s.length-1)/3); i > 0; i–){
    outStr += “,” + s.substr(-i*3,3);
    }
    prefix + outStr + decimals;
    }else{
    prefix + s;
    }

  • Well it seems to work, it counts up but I can’t get the commas to work. I wish I could figure this out. I think this part is

    newVal.toString().replace(/B(?=(d{3})+(?!d))/g, “,”);

    that does the trick, but I can’t figure out why its not working. Let me know if you have any thought, which I’m sure you do.

  • Thanks, Dan. I’ll give a try and let you know. BTW do you have any suggestion for learning and or training resources for someone that wants to get into doing expression full on?

  • Would this same counter go beyond 30,000. And how would you get commas in to it? I need something just like this that goes from 100 to 5,000,000 in increments of 100. I’m not that good with expressions yet so, trying to figure this out is tricky.

  • Its very experimental motion, so I’m not sure what I’ll want to do with it other than to say that I’ll like smooth movement on the dolly and being able to control the easing a lot more. I’m just very used to 3D camera controls and every time I try to move the AFX camera as I would in most in 3D package I find the movement very wonky. I’m used to being able to assign a camera to a path as well as its point of interest and just adjust/animate the path according the movement I’m trying to get.

    Basically, I’m flying through a series of images and I need to make both sharp and gradual dolly and jib moves.

    Hope that helps.

  • Thanks for the reply. Its just series of nulls attached in a hierarchy and controlled via linked expressions to master control null that uses sliders. Nothing to complex. I just want to be able to finese things without pulling my hair out.

    Sometimes I just wish the camera in AFX worked like the cams in most 3D sofware. Its crazy that such simple thing should cause such head when it comes to control.

  • yeah that’s what I figured. I what could be done to fix it. Thanks for your support.

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