Forum Replies Created

  • Juan Bosnic

    January 3, 2012 at 9:35 pm in reply to: Extra decimal places using math.floor expression

    Ok I screwed it. Wont help at all yet, but it’s a good starting point, I just misunderstood where you wanted the “0” to be.

    Below is the corrected expression.

    needleRot = (Math.floor(((thisComp.layer("needle wiggle").transform.rotation)/4.5)))*.01
    needleRot = needleRot.toString();

    if (needleRot.length == 3){
    needleRot + "0";
    } else {
    needleRot;
    }

  • Juan Bosnic

    January 3, 2012 at 9:24 pm in reply to: Extra decimal places using math.floor expression

    Let ME talk about overcomplicating stuff…

    Take a look at the expression below. It converts the rotation value, makes it a String, and evaluates if it has just one character to add a “0” accordingly.

    That should help while somebody smarter thinks something simpler.

    needleRot = Math.floor((thisComp.layer("needle wiggle").transform.rotation)/4.5) * 0.1
    needleRot = needleRot.toString();

    if (needleRot.length == 1){
    needleRot + ".0";
    } else {
    needleRot;
    }

  • I was betting on you to answer Dan.
    Of course that worked!

    Don’t you guys consider this type of short/basic threads a kinda waste of cyberspace?

    It would be great if there was a full scripting dictionary that merely lists keywords in alphabetical order and a few words describing what they do. Like the material you get if you search for “Javascript functions” or “full PHP keyword reference”.

    Does anybody know of anything like that?

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