Forum Replies Created

Page 22 of 32
  • There is a script by Jeff Almasol, rd: Slicer, that does precisely that.
    However for some reason his site, https://www.redefinery.com/ae/, has been ‘refocusing’ for a while now.

    Xavier.

  • Xavier Gomez

    January 3, 2014 at 11:24 pm in reply to: Oval motion

    x=radiusX*Math.cos(angle);
    y=0;
    z=radiusZ*Math.sin(angle);

    (you need 2 sliders).
    Xavier.

  • Xavier Gomez

    December 30, 2013 at 1:32 pm in reply to: Adding a fill to a shape layer.

    shapeLayer.content.addProperty(“ADBE Vector Graphic – Fill”);

    if you want to add a fill inside a group, it is likewise:
    group.content.addProperty(“ADBE Vector Graphic – Fill”);
    where group is a propertyGroup with matchName : “ADBE Vector Group” (one that can accept new content).

    Xavier.

  • Xavier Gomez

    December 15, 2013 at 5:46 pm in reply to: add drop shadow to layer

    currentComp is not defined.

  • Xavier Gomez

    December 14, 2013 at 8:50 pm in reply to: Creating Scripts with prompts

    Hi,

    Help > Scripting Help…
    links you to more or less everything you need to start scripting, but it’s a lot of things to read so here is some résumé:

    information about scripting for After Effects is all included in the After-Effects-CS6-Scripting-Guide.pdf, but it does not include UI stuff. UI related things are a topic on their own which is covered in the JavaScriptToolsGuide_CS5.pdf

    Now these ressources are very detailed, most of the time you will find answers to your questions there, but they are also a bit dry (just a bit) and it is more useful to start with some concrete examples. It is less and less easy to find open code scripts but there are some. Dan Ebberts’ site:

    https://www.motionscript.com/ae-scripting/table-of-contents.html

    gives a few tutorials/examples to get started and see how it works. Then build upon that and the guides.
    The adobe scripting forum is also helpful:

    https://forums.adobe.com/community/aftereffects_general_discussion/ae_scripting?view=discussions&start=30&numResults=30#/

    I was about to forget!! On the Adobe forum you will find David Torno’s video tutorials which will lift you from absolute beginner to Senior Coder in 19 Episodes:

    https://forums.adobe.com/message/5585539#5585539

    Xavier

  • Hello,
    You should tell more about the animation duration, the time range of your clock etc…
    I think the easier way to do it is to add a slider control that will represent the clock time in seconds, animate it from time_min to time_max with few key frame as you wish, then pickwhip that slider to your text and convert the number in seconds to a string hh:mm:ss using a similar expression as for a normal clock.

    Another possibility is to make a normal clock (apparently you have an expression for that), precomp and time remap, but that may generate some blur.

    If you absolutely want an expression that does everything you can use something like this:

    function f(x){ x=x.toString(); while (x.length<2) x="0"+x; return x;};

    startTime_display=0,
    startTime_ae=inPoint,
    t=time-startTime_ae;
    a= 0.1, b=0.5, c=0.8;
    t= startTime_display + t*(1+a+ t*(b+c*t));

    hh = Math.floor(t/3600);
    t-=hh*3600;
    hh=f(hh);

    mm = Math.floor(t/60);
    t-=mm*60;
    mm = f(mm);

    ss = f(Math.round(t));

    hh + ":"+ mm + ":" + ss;

    But it might be difficult to find the correct values for a,b,c (small positive nubers) to obtain what you want. All of them zero gives a normal speed clock.

    Xavier.

  • Xavier Gomez

    September 24, 2013 at 8:25 am in reply to: dynamic image grids (masonry)

    You’ll have hard time doing this with expressions.
    There is the (free) script Collage https://motionboutique.com/collage-script-328/ by the author of Newton.
    It is 100% random and always fits the layer. You can’t have the images to line up to only one border for instance.
    Xavier

  • Xavier Gomez

    September 6, 2013 at 9:21 pm in reply to: Quick and Dirty Expression Baker

    convertExpressionToValue is the function i had posted just before (by the way i realize i miscopied its name, it was convertToValue before… call it whatever you want). Just to make sure, here is the full text:

    function convertExpressionToValue(prop, evalTime)
    {
    if (prop.expressionEnabled && prop.numKeys<1)
    {
    prop.setValue(prop.valueAtTime(evalTime,false));
    prop.expressionEnabled = false; } return;
    }
    }
    var myComp = app.project.activeItem;
    if (myComp instanceof CompItem)
    {
    var i, numLayers=myComp.numLayers;
    var myLayer, evalTime;
    app.beginUndoGroup("convert expressions");
    for (i = 1; i <= numLayers; i++)
    {
    myLayer = myComp.layer(i);
    evalTime = myLayer.inPoint;
    try{ convertExpressionToValue(myLayer.property("position"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("anchorPoint"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("rotation"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("scale"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("opacity"), evalTime);} catch(err){ };
    }
    app.endUndoGroup();
    }

    Xavier.

  • Xavier Gomez

    September 6, 2013 at 11:02 am in reply to: Quick and Dirty Expression Baker

    The usage is the same as your “convertToKeyframes” function. You still need to loop over the layers/properties you want to apply it to.
    var myComp = app.project.activeItem;
    if (myComp instanceof CompItem)
    {
    var i, numLayers;
    var myLayer, evalTime;
    app.beginUndoGroup("convert expressions");
    for (i = 1; i <= numLayers; i++)
    {
    myLayer = myComp.layer(i);
    evalTime = myLayer.inPoint;
    try{ convertExpressionToValue(myLayer.property("position"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("anchorPoint"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("rotation"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("scale"), evalTime);} catch(err){ };
    try{ convertExpressionToValue(myLayer.property("opacity"), evalTime);} catch(err){ };
    }
    app.endUndoGroup();
    }

    If you know that you always want to convert expressions to keyframes inside the transform group only, you could make a function that does specifically that to a given layer. The principle is the same.

    Xavier.

  • Xavier Gomez

    September 5, 2013 at 8:08 pm in reply to: Quick and Dirty Expression Baker

    Why dont you use setValue instead of convert to keyframes?
    the code below converts the expression to its value if the expression is enabled and if there are no keys (otherwise the property is probably not constant and should not be converted to a constant value).
    function convertToValue(prop, evalTime)
    {
    if (prop.expressionEnabled && prop.numKeys<1)
    {
    prop.setValue(prop.valueAtTime(evalTime,false));
    prop.expressionEnabled = false;
    }
    return;
    }

    Xavier

Page 22 of 32

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