Forum Replies Created

Page 1 of 46
  • Colin Braley

    February 29, 2008 at 12:13 am in reply to: Find out which language AE is running in expressions?

    After messing around with the $ object, and some of the reflection stuff, I came across something pretty cool. Go into your AE Prefs file and set “EnableExpressionsDebuggingAtYourOwnRisk”, to “1” (meaning true)

    Then, go into AE and create an expression and place the command $.bp() into an expression. This creates a breakpoint. Now, when the expression executes, you can debug it using the ESTK. I thought this was pretty cool. I also found out some other cool stuff using the $ object, hopefully Ill have time soon to write some stuff up about it and post it online.

    ~Colin Braley
    http://www.colinbraley.com

  • Colin Braley

    February 28, 2008 at 6:03 am in reply to: Find out which language AE is running in expressions?

    Lloyd,
    give this one a try:

    $.locale

    I just tried it out on my machine, and it returned the string “en_US”.

    ~Colin Braley
    http://www.colinbraley.com

  • Colin Braley

    February 19, 2008 at 1:50 am in reply to: opacity: distance from camera

    [Dan Ebberts] “Layer space transforms with nested 3D comps are always tricky (to me at least).”

    Dan, if they are always tricky for you they are definitely always tricky for the rest of us.

    ~Colin Braley
    http://www.colinbraley.com

  • Colin Braley

    February 18, 2008 at 2:42 am in reply to: plane propeller rotation (newbie question)

    I think your main issue is that you are not realizing that expressions have no memory, meaning that an expression does not “remember” what value it had in a previous frame. This is why an expression (for rotation)such as:

    rotation + 15

    does not add 15 degrees to rotation each frame.

    If you want a better explanation of all this, check out the basic expressions tutorial on Dan Ebbert’s website http://www.motionscript.com.

    Anyway, now to solve your specific problem. I don’t have AE in front of me, but I think something like this should do the trick for your rotation expression:


    rotationIncrement = _____;//Link this to a slider and keyframe
    finalVal = 0;
    for( i = 0 ; i < time; i += thisComp.frameDuration() ){ finalVal += rotationIncrement.valueAtTime( i ); } finalVal

    Hopefully this makes sense and my code works okay. Enjoy.

    ~Colin Braley
    http://www.colinbraley.com

  • I don’t have much time to work on this one…I’ve got a test in the morning…but heres some code to get you started. It’s not very elegant, but it works decently:


    minDist = 50;//min movement
    maxDist = 100;//max movement
    dur = 1;//time between movements
    //--
    seedRandom( index , true );
    epsilon = .01;
    accum = thisLayer.position.valueAtTime( 0 );
    timeAccum = 0;
    for( i = 0; i < time ; i += thisComp.frameDuration ){ if( Math.abs( timeAccum - dur) <= epsilon ){ theta = Math.round( random(0,3) ) * (Math.PI / 2 ); dist = random( minDist , maxDist ); disp = [ dist * Math.cos( theta ) , dist * Math.sin( theta ) ]; accum += disp; timeAccum = 0; } timeAccum += thisComp.frameDuration; } //--- accum

    It makes the layer move properly, but it can move out of the comp, you will have to add code to check for that situation.

    ~Colin

  • Colin Braley

    November 8, 2007 at 1:51 am in reply to: How do I do a complex if/else structure?

    There is no super simple way to do something like this. Some people like to use something called a “switch statement” in situations like this. For instance, the psuedocode you wrote in in you post would look like this written as a switch statement:


    switch ( slider ){
    case 1:
    10
    case 2:
    25
    case 3:
    50
    case 4:
    100
    default:
    100//if the slider wasn't 1 ,2, 3, or 4
    }

    Im not sure if this is the exact syntax you would use for a switch statement in javascipt, and i actully don’t even know if there is a switch constuct in javascript….however, most modern programming languages do have a switch construct.

    Personally, I would never use a swich statement, I prefer just using if statements….I feel that while code using switch statements might be more concise it is more-error prone because people don’t use them as often. Also, there are a bunch of other issues that crop up when you forget to use the “break” keyword peoperly within a switch statement, but I dont think I’ll elaborate on that one…

    Anyway, if you REALLY want to use switch statements, check out wikipedia and read about them…

    https://en.wikipedia.org/wiki/Switch_statement

    ~Colin

    http://www.colinbraley.com

  • Colin Braley

    October 30, 2007 at 12:28 am in reply to: The Math behind….

    Using linear() or ease() is doing all the same number crunching, just behind the scene. If you want to know about the math behind interpolation, try checking out wikipedia for the basics:
    https://en.wikipedia.org/wiki/Interpolation
    All the math knowledge you need to unserstand this stuff is just basic high school algebra and trig. You might see some calculus-related terms on there (differentiable) but you can ignore them and just read each formula for each type of interpolation.

    If you REALLY want to learn some more advanced interpolation stuff you might want to pick up a book like
    https://www.amazon.com/Interpolation-Second-J-F-Steffensen/dp/0486450090/ref=pd_bbs_sr_1/105-3364261-6610049?ie=UTF8&s=books&qid=1193704076&sr=1-1
    but keep in mind the book will probably have more theory involved, and use college level math.

    ~Colin

    http://www.colinbraley.com

  • Colin Braley

    October 12, 2007 at 2:39 am in reply to: scale multiple layers to fit comp

    Try this, I cant test it as I have no AE on my laptop, but Im pretty sure it should do the trick:


    xRatio = (thisComp.width - thisLayer.width) /thisLayer.width;
    yRatio = (thisComp.height - thisLayer.height) /thisLayer.height;
    x = 100 + (xRatio * 100 );
    y = 100 + (yRatio * 100);
    [x, y]

    I justt realized this dosent factor in pixel aspect ratio…oh well, I have to go study so no more time 🙂 If you need a solution that does try searching aenhancers.com or here at the cow for something. I bet Dan or Filip or someone has done something like this before.

    And don’t foreget you can right click on a layer and go to Transform>Scale to fit to comp, or something like that.

    ~Colin Braley

    Expressions and other stuff at
    http://www.colinbraley.com

  • Colin Braley

    October 10, 2007 at 2:39 am in reply to: Math.round Expression Help

    Try something like this:

    startTime = 0;
    endTime = 5;
    startValue = 0;
    endValue = 145;
    nonRounded = linear (time, startTime, endTime, startValue, endValue);
    Math.round( nonRounded )

    ~Colin

    ~Colin

    http://www.colinbraley.com

  • Colin Braley

    October 2, 2007 at 8:05 pm in reply to: Add to expressions library?

    I don’t think you can, but if you figure out a way let me know, that would be cool.

    ~Colin
    http://www.colinbraley.com

Page 1 of 46

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