How to apply the expression using script?

I use a script and an expression to automate all the layer selected to attend the control layer. So, I've do it now in two steps, first make a layer of control using this script:

{

model var = app.project.activeItem;

var slctd_layer = comp.selectedLayers;

var new_adjustment = comp.layers.addSolid ([1,1,1], "Control", comp.width, comp.height, comp.pixelAspect, comp.duration);

new_adjustment.adjustmentLayer = true;

var addSlider1 = app.project.activeItem.selectedLayers [0]. Effects.addProperty ("ADBE Slider Control");

addSlider1.name = "time";

addSlider1.property (1) .setValueAtTime (0, 0.06);

var addSlider2 = app.project.activeItem.selectedLayers [0]. Effects.addProperty ("ADBE Slider Control");

addSlider2.name = "opacity";

addSlider2.property (1) .setValueAtTime (2, 0);

addSlider2.property (1) .setValueAtTime (2.03, 100);

}

Then, I select all the layer under the control and apply the expression, for example:

delay = thisComp.layer("Controler").effect ("delay") ("Slider") * index;

t = time + delay;

exp = thisComp.layer("Controler").effect ("opacity")("Slider").valueAtTime (t);

exp;

I'm working on an animation of the tight timelines and tons of materials with tons of layer for each model now. So I think that if it is possible to combine this stage two in a script that will automate this work for me. I'm still new to scripts and none need help with it. Thank you

Like this:

var ease = new KeyframeEase(0,100/6);    // speed (0 for easeIn or easeOut, influence range: 0-100)
var addSlider1 = new_adjustment.effect.addProperty("ADBE Slider Control");
addSlider1.name = "delay";
// 1st key: value + ease
addSlider1.property(1).setValueAtTime(0, 0.2);
addSlider1.property(1).setTemporalEaseAtKey(1, [ease], [ease]);
addSlider1.property(1).setInterpolationTypeAtKey(1, KeyframeInterpolationType.LINEAR, KeyframeInterpolationType.BEZIER);
// 2nd key: value + ease
addSlider1.property(1).setValueAtTime(2.03, 0.03);
addSlider1.property(1).setTemporalEaseAtKey(2, [ease], [ease]);
addSlider1.property(1).setInterpolationTypeAtKey(2, KeyframeInterpolationType.BEZIER, KeyframeInterpolationType.LINEAR);

(The use of setInterpolationTypeAtKey is not necessary, it is only there to do things similar to what you would get by doing things by hand).

Xavier

Tags: After Effects

Similar Questions

  • How to measure the distance using script

    Hello

    Is it possible to measure the distance of any document in photoshop using the measure tool, using the script. Below the steps required by me. Hope I'm clear in my communications.

    I've searched the forums, but couldn't find appropriate answers.

    1. open the Photoshop document

    2. allow the user to draw the line with measure tool

    3. the alert distance

    RGS

    Anish

    This only works with CS5 because it now uses the tool instead of a path rule. But it solves all the problems talked about in this thread and many other differences between the original function and the data in the info panel.

    It returns a custom with angle and length properties object if there is a rule tool line in the active document and not of the indefinite. I didn't know if the length must be a unitValue or number in the units of the rule settings. I went with number because the Panel info has different number of decimal places for the different units. And as the Panel assigned the corresponding graduation info per cent the length value is empty

    function getRulerToolLengthAndAngle() {}

    points of var = [];

    points. Start = [];

    points. End = [];

    var / / desc = new ActionDescriptor();

    Var ref = new ActionReference();

    ref.putProperty (charIDToTypeID ('Rprp'), charIDToTypeID ("RrPt"));

    ref.putEnumerated (charIDToTypeID ('Dcmn'), charIDToTypeID ('Ordn'), charIDToTypeID ('Trgt'));

    desc.putReference (charIDToTypeID ('null'), ref);

    var / / desc = executeAction (charIDToTypeID ('getd'), desc, DialogModes.NO);

    If (desc.hasKey (charIDToTypeID ('points'))) {}

    pointList var = desc.getList (charIDToTypeID ('points'));

    var startPointDesc = pointList.getObjectValue (0);

    points. Start.push (startPointDesc.getUnitDoubleValue (charIDToTypeID ('X')));

    points. Start.push (startPointDesc.getUnitDoubleValue (charIDToTypeID ('Y')));

    var endPointDesc = pointList.getObjectValue (2);

    points.end.push (endPointDesc.getUnitDoubleValue (charIDToTypeID ('X')));

    points.end.push (endPointDesc.getUnitDoubleValue (charIDToTypeID ('Y')));

    var RES = {};

    res.toString = function() {return "RulerTool news" ;};}

    Pointed var = points.start;

    var points.end = b;

    If (pointed [0]

    var a = Math.max(pointA[0],pointB[0]) - Math.min (pointed [0], b [0]);

    var o = Math.max(pointA[1],pointB[1]) - Math.min (pointed [1], b [1]);

    var ang = (180/Math.PI) * Math.atan2(o,a);

    If (pointed [1]< pointb[1]){//negative="">

    Ang = - ang;

    };

    Res.angle = ang.toFixed (1);

    } else {}

    var a = Math.max(pointA[1],pointB[1]) - Math.min (pointed [1], b [1]);

    var o = Math.max(pointA[0],pointB[0]) - Math.min (pointed [0], b [0]);

    var = 180-((180/Math.PI) Ang * Math.atan2 (a, o));

    If (pointed [1]< pointb[1]){//negative="">

    Ang = - ang;

    };

    Res.angle = ang.toFixed (1);

    }

    If (app.preferences.rulerUnits == Units.PERCENT) {}

    Res. Length = "";

    } else {}

    var c = Math.sqrt + ((a*a) (o * o));

    var length = new UnitValue (c, 'px');

    length.baseUnit = new UnitValue((1/app.activeDocument.resolution),'in');

    Switch (app.preferences.rulerUnits) {}

    case Units.PIXELS: res.length = length.as('px').toFixed (2); break;

    case Units.INCHES: res.length = length.as('in').toFixed (3); break;

    case Units.CM: res.length = length.as('cm').toFixed (2); break;

    case Units.MM: res.length = length.as('mm').toFixed (1); break;

    case Units.POINTS: res.length = length.as('pt').toFixed (1); break;

    case Units.PICAS: res.length = length.as('pc').toFixed (2); break;

    }

    }

    return res;

    }

    }

    var getRulerToolLengthAndAngle() = Info;

    If (info! = undefined) alert (' the ruler tool angle is: ' + info.angle +'\nThe length is: ' + info.length);

  • How to apply the "Slate Pro Light" using CSS font?

    Hello

    Could you tell me how to apply the font of "Slate Pro Light" using CSS? I have not found a solution for the 'Light' slate Pro variation selection.

    Thank you.

    I usually use the definition of CSS of police-family at the following address on my html and body elements:

    font-family: "Slate Pro", Slate, "Myriad Pro", "BBAlpha Sans", Helvetica;
    

    Potentially adding "slate Pro Light" should do the trick. Alternatively, you could take advantage of the make-weight property when you need a lighter framework:

    font-weight: normal|bold|bolder|lighter|number|initial|inherit;
    

    In this case, lighter, might do the trick?

  • How to access the modules using the script?

    Hi can someone help me how to link to the module using script if you have ideas to share with the me...

    Thanks in advance

    (There are two ways to load the modules, 1) ModuleLoader class component ModuleManager 2).

    The ModuleLoader component's mxml, so I will not provide an example.

    The ModuleManger class is for loading modules via actionscript.

    Here is a link to resources on the loading of modules as well as the code example.

    http://help.Adobe.com/en_US/Flex/using/WS2db454920e96a9e51e63e3d11c0bf64277-7ffd.html#WS2d b454920e96a9e51e63e3d11c0bf69084 - 7 d 20

    -Darrell

  • How to remove the default calc script in Web Analytics?

    Hello

    Mode of data analysis Web edition, how to show the calc custom scripts only?
    Because users might wrongly apply the script to calc default that calculates the database, some data in the parent members would be rewitten.
    I wonder if the setting is in the Essbase or not?

    Thank you.

    You can change but does not remove the default calculation in Essbase. You can use EAS, ESSCMD or MaxL to change the calculation of the default of another calculation script.

  • How to apply the theme of Oracle Alta UI in ADF

    Hi all

    I use Jdeveloper 11.1.1.1.7.2 release1.

    Can anyone provide your inputs on how to apply the theme of Oracle Alta UI in the ADF.

    For any consultation on Alta IU @ http://www.oracle.com/webfolder/ux/middleware/alta/start-develop.html

    Thank you and best regards,

    Miko Auntie.

    http://www.Oracle.com/WebFolder/UX/middleware/Alta/start-develop.html

    http://www.Oracle.com/WebFolder/UX/middleware/Alta/patterns/PageDesign.html

    http://www.Oracle.com/WebFolder/UX/middleware/Alta/new-dev-w-Alta-skin.html

    Oracle ADF: Customized design

  • How to integrate the police Segoe Script in a saved pdf file?

    When I save a file .psd in .PDF (with Photoshop elements 12), two of the three fonts do appear fine in the .pdf file, but not the third (Segoe Script).  I open the PDF with Adobe Reader XI.

    How to integrate the police Segoe Script in the .pdf file?   (Depending on the printer, it must be there.)

    Thank you.

    Yes you will not be able to use either the distorted text.

    (these kinds of properties do not appear in this font)

    If you want to tilt the text as it would be for the italicized text, you can use Image > transform > Skew.

  • How to apply the filter to a specific column condition, but not to the report?

    Hello

    I'm having a problem in the application of a filter to one of the column condition.
    I have a scheme with the table around 10 dimension tables and a fact. My requirement is to provide a count on the table of facts with associated with some other columns in the dimension tables.

    Lets consider a scenario with tables as sales (Fact), region (Dimension), Year (Dimension), Type of sale (Dimension).

    Now my requirement is to highlight the fields

    City (Region) - city
    Year-
    Sales Count (dirty table) - number of all sales of the fact table
    Sales Count (dirty table) - count of all sales of the fact which type of sale table is 'Cash'

    Here, my question is how to apply the filter condition of Sales Type = 'MONEY in' only on one of the Sales Count column that comes from the fact table. I want to be ordered for the fourth column, the filter condition.

    Can someone let me know how?

    Thank you

    You must do this:

    1) click the button column fx sales. (This procedure does than on fact, not attributes.0

    2) click on the filter button.

    (3) select the size of sales from the left Type "selection list."

    (4) in the filter window, enter CASH, and click OK.

    This will create one filter on sales 'use' size 'type sales' as the filter. It willl filter only to this column.

  • How will I know if my Airport Extreme has the latest firmware?  And (not related) how to change the password used to connect to my network?

    I think I bought the latest version of Airport Extreme.  It is the unit which is rectangular, is about 6 to 7 w., etc.  I have some basic questions that I do not understand:

    1. How will I know if I have the latest firmware for this device?  I read a few posts that make it sound as if it was just automatically updates.  Is this true?

    2. can someone tell me how to change the password used to connect to my wireless network?

    Thank you very much!

    Chris

    If a firmware update is available, AirPort Extreme flashes orange.

    The most up-to-date version of the firmware is 7.7.3.

    You can see what version you currently have the following on your Mac...

    Open Finder > Applications > utilities > AirPort Utility

    Click on the image of the AirPort Extreme

    Look for the Version

    If the new firmware was available, you will see a button update here

    To change the wireless network password...

    Click on edit in the window smaller than you watched just to check the firmware version

    Click on the Wireless tab at the top of the next window

    Go back / change the wireless password and enter a new password

    Do the same thing to check

    Click Update at the bottom right of the window and give the airport a minute full for restart

  • How to change the rendering used for video playback in Windows Media Center Version 6 engine

    I usually use other media players, but I would like to first of all using Windows Media Center. However for the moment video playback is not good because of the weird colors (everything is displayed in black and Red instead of normal colors). When you use other media players, I use the Haali rendering engine which gives good results for video playback.

    Can you tell me how to change the rendering used by Windows Media Center?

    Also, I noticed the same weird color effect in Windows Media Player 11.

    Hi Woobee,

    1. What is the brand and model of the computer?

    2. what graphics card use on the computer?

    If you are using an Nvidia graphics card on the computer, in the Nvidia Desktop Manager, you will find an option for saturation to ensure it is set to 100%.

    And if you are any other graphics card on the computer and search for a similar option for saturation.

    If the previous step fails in Windows media player, so be sure that the hue and Saturation are defined by default.

    1. click on the arrow on the tabplaying , point to enhancements, and then clickcolor picker.

    2. do one of the following:

    1. to return to the default color, click thereset link.

    Also, make sure that the video settings are set by default.

    1. start the playback of a file.

    2. click on the arrow on the tabplaying , point to improvements, and then clickvideo settings.

    3. click onreset.

    Check also in Windows Media Center if the

    1. on theStart screen, go to tasks, click settings, clickgeneral, then Visual and sound effects.

    2. undercolors ensure that Windows media center standard is enabled.

    Turn off Visual and sound effects in Windows Media Center

    http://Windows.Microsoft.com/en-us/Windows-Vista/turn-off-Visual-and-sound-effects-in-Windows-Media-Center

    I hope this helps!

    Halima S - Microsoft technical support.

    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • How to apply the strategy of UCS1.4 collection (1 d)

    Hi all

    I try to collect statistics on the performance of the network. but do not know how to apply the policy to the collection.

    Service profile, I cam see political Stats. But within the political framework of Stats, there are onlu available in config/choice is political threshold.

    Can someone help out me? Thank you very much!

    I think this is what you are looking for?

    UCS stores the past 5 statistics records at the "Reporting Interval" setting;
    There is no configuration to change that number.  You can put this interval out 8 hours but then you only get a snapshot every 8 hours. Trending or history retrieval would require an interval based extraction and storing application that utilizes the UCS XML API.

    This is a link to the UCS XML API information.
    http://www.cisco.com/en/US/docs/unified_computing/ucs/sw/api/ucs_api_book.html

  • How to start the database using CRS to start the database instance

    Dear Experts,

    How to start the database using CRS to start the database instance

    As a solution: remove the write permission on the/etc/oratab user database to prevent update to arrive.

    There is no harmful effects known to CRS / RDBMS operation if this workaround solution is used. This has been discussed in Bug 13028802.

  • How to know the tables used in packages of a schema.

    How to know the tables used in packages of a pattern that I have connected.

    SELECT DISTINCT referenced_owner, referenced_name

    Of all_dependencies

    Owner WHERE = "MY_USER_NAME".

    AND type ('PACKAGE', 'BODY of PACKAGE')

    AND referenced_type = 'TABLE '.

  • How to identify the fonts used in text format?

    How to identify the fonts used in text format?

    Hi DSB.

    Open the document in Reader, go to the menu file-> properties, then click on the tag are. You will see a list of the fonts used in the document.

    Another option is to copy the text and paste it into MS Word, where you can simply move your mouse over the text to display the name of the font.

    Kind regards

    Nicos

  • How to know the database uses pfile or spfile?

    Hi guru

    How to know the database uses pfile or spfile?



    Thank you

    Thank you for this question of doc!
    Please type in sql * show spfile parameter.
    If it is empty, you do not use a spfile.

    --------------
    Sybrand Bakker
    Senior Oracle DBA

Maybe you are looking for