How do add a mask to a layer?

It may be basic but it seems confusing, please I need help

Assuming that the variable myLayer is a layer object, the collection of all its masks is: myLayer.property("ADBE Mask Parade");
and its children are the actual masks groups (which can be renamed). To add a mask to the collection you do:
var myMask = myLayer.property("ADBE Mask Parade").addProperty("ADBE Mask Atom");
Then you can set its name, color, rotoBezier attributes etc (optionnal):
myMask.name = "My mask";
myMask.color = [1,0,0];
myMask.rotoBezier = false;
myMask.maskMode = MaskMode.ADD;
To set its keyframable properties: the maskPath property has special propertyType (SHAPE).
You need to create a Shape() object like this before setting the value:
var myShape = new Shape();
// set the vertices (coordinates of the vertices in layer coordinates, not comp)
// + the inTangents (coordinates of the incoming Bezier handles with respect to the the corresponding vertices)
// + the outTangents (coordinates of the outcoming Bezier handles with respect to the the corresponding vertices)
// + the closed attributes
var w = myLayer.width, h = myLayer.height;
myShape.vertices = [[w/2, 0], [w,h], [0,h]];            // here: array of 3 "points"
myShape.inTangents = [[0, 0], [0, 0], [0, 0]];        // array of 3 "vectors"
myShape.outTangents = [[0, 0], [0, 0], [0, 0]];        // array of 3 "vectors"
myShape.closed = true;
// now set the value:
myMask.property("ADBE Mask Path").setValue(myShape);
In this example all tangents are 0 which gives a mask with straight contour.
Unless you already have your shape data ready, inserting more complexe values for tangents is not so straighforward.
Xavier.

Similar Messages

  • How to do a mask over a layer

    How to do a mask over a layer. Need the mask to not move. Layer will.
    In other words, something is moving into a shape that is not moving. Thanks

    from the page that I pointed you to:
    "The TrkMat menu shares a column with the blending modes menu. To show the TrkMat menu, make sure that the Modes column is visible. (See Columns.)"

  • How to add a field in the layer

    Hello,
    How can I add a field in the layer? We are in the interaction center and I enchance the the component IUICMD. I already created a atribute but doesn't happen in the screen.
    Best regards,
    Caíque Escaler

    Hi,
    Please check have u added that attribute in enhanced view configuration and check when u r configuring enhanced view u r using correct role configuration key.
    Regards
    Gaurav

  • How to add "edits" to an adjustment layer, corresponding to cuts in a flattened timeline below?

    I have a very complex music video edit. Hundreds of cuts. I'm not a colorist by trade, so I don't really know how much I like the idea of using speedgrade right now... having to export to dpx format, not being able to conveniently make changes after the color correction (which I do every time), learning a new interface, etc.
    So, I want to try to do thigns within premiere if possible. The way I'd like to do this is by throwing my grades on adjustment layers for each edit / clip. However, I do not want to add and trim 500 adjustment layers, one for each edit.
    Is there a way to add one adjustment layer, extend it over the entire timeline, and then just paste in all the edit points somehow? To chop the adjustment layer up exactly as my video is chopped up below it? The footage underneath is flattned and ready to grade.

    I guess I'll just add that I managed to accompolish this, by just over and over using the shortcuts, "add edit to all tracks" and jumping to "next edit" over and over. Took a few minutes, and made a few slices through my video clips that I didn't have before, but it got the job done relatively quickly, albeit in a round-about sort of way.
    Case closed, I guess, unless anyone knows of a better way to do this.

  • How to add text animator to text layer in script?

    Hello,
    I'm a beginner in scripting and trying to create a script to apply set of expression control and text animator.
    I want to add text animator property to selected layer, however I keep having error with the codes below.
    selectedLayers[0].Text.Animators.addProperty("ADBE Text Animator");
    selectedLayers[0].Text.Animators.addProperty("ADBE Text Position");    //error on this line
    What is the correct code?
    Thanks a lot.

    Thanks Dan, that works!
    However, I hit another road block. I tried to add a range selector under the animator group with the codes below and both returned error.
    myAnim.property("ADBE Text Animator Properties").addSelector("ADBE Text Range Selector");
    myAnim.property("ADBE Text Animator Properties").addProperty("ADBE Text Range Selector");
    After reading this post. how to access text proprety
    Its seem text animator has different codes for accessing different properties.
    I've searched on the Adobe scripting guide and couldn't find the exact code for the property (e.g. ADBE Text Position 3D ).
    It would be much appreciated If anyone could recommend a scripting book for After Effects.
    Thanks.

  • How to add layer mask?

    Must add each layer of the document (except the background) mask blank:
    There is such a script:
    if(app.documents.length>0){
        var docRef = activeDocument;
        var layerNum = docRef.layers.length;
        for(var i=0;i<layerNum;i++){
            docRef.activeLayer = docRef.layers[i];
            if(!docRef.activeLayer.isBackgroundLayer){
                try{addMask ()}
                catch(e){}
    else{alert('There are no open files')};
    function addMask(){
        var idMk = charIDToTypeID( "Mk  " );
            var desc2 = new ActionDescriptor();
            var idNw = charIDToTypeID( "Nw  " );
            var idChnl = charIDToTypeID( "Chnl" );
            desc2.putClass( idNw, idChnl );
            var idAt = charIDToTypeID( "At  " );
                var ref1 = new ActionReference();
                var idChnl = charIDToTypeID( "Chnl" );
                var idChnl = charIDToTypeID( "Chnl" );
                var idMsk = charIDToTypeID( "Msk " );
                ref1.putEnumerated( idChnl, idChnl, idMsk );
            desc2.putReference( idAt, ref1 );
            var idUsng = charIDToTypeID( "Usng" );
            var idUsrM = charIDToTypeID( "UsrM" );
            var idHdAl = charIDToTypeID( "HdAl" );
            desc2.putEnumerated( idUsng, idUsrM, idHdAl );
        executeAction( idMk, desc2, DialogModes.NO );
    It runs and adds a mask, but it is filled with black:
    How to change the code to create an empty mask (like in the first picture)?
    Sorry for my english...

    Line 30 you have the actionmanager "HdAl" hide all… Record again using show all…?

  • How do I select a color range like in Photoshop OR copy/move a layer into the mask of another layer?

    Hi there,
    I'm trialling Photoshop Elements and wanting to use a black and white (grey scale) layer that I've made as a mask in another layer and don't know how to do it in Elements.  In Photoshop, I'd do this (there maybe a better way in PS to do it, but I haven't discovered it yet)...
    Click the layer i've created that I intend to use as a mask
    Select All
    Copy
    select layer that I want the mask to be applied to
    click the Add Layer Mask button (at the bottom of the Layers window)
    click the mask icon so it is highlighted (and the image isn't)
    switch to Channels view
    highlith the Layer Mask beneath the R,G,B layers and make it visible
    Paste
    make it invisible again
    switch back to layers.
    This works and retains the full range of transparency for semi transparency and soft edges of the mask etc.
    Alternatively, I can select a Color Range, but that doesn't seem to be available in PS Elements.
    So, how do I achieve the same result in PS Elements?
    Thanks for your help
    Jonno

    Perfect!   Thanks very much R_Kelly.  That does exactly what I was hoping to do.
    Cheers
    Jonno

  • Please help! How do I unlink a mask from a layer in Motion?

    How do I "unlink" a mask from a layer so when the object on the layer moves, the mask stays still?
    (Similar to how you unlink a mask in Photoshop by clicking on the link icon beside the layer thumbnail)ghgh
    This is propably very simple, but I can´t figure this out or find it anywhere searching on the net or in the manual (already wasted almost two hours on this and my deadline is coming uncomfortably close...)
    Hope somebody can help I´m getting desperate now

    Would moving the mask to the Group containing the layer you want to animate give you the result you're looking for?
    Your layers list would look like this:
    If there are other layers in the group, then you would need to nest the masked group so as to not affect the other layers.
    You could also add a shape and use that as an image mask which includes a stencil option.
    Draw your shape
    Select the image you want to mask
    Add Image Mask (shift+command+m) via the object menu
    Drag your shape to the image mask
    Your layer list would look like this:

  • [BUG]PS CC Layer Group add vector mask and disable it,use path selection tool click,always crash!!!

    [Bug] Photoshop CC,Layer Group add vector mask and disable it, use path selection tool click canvas, always crash!!!  Please help me!
    The sample psd file(158KB):
    http://doc.aoyea.com/ps_cc_bug.psd
    My Computer configuration:
    SONY VAIO CA100 Notebook、Intel Core I5 2410 CPU、16GB RAM、AMD Radeon 6600M(1G RAM)、Windows7 x64 SP1(clean)、Scratch disk free space is 100GB
    email: [email protected]

    Hi,
    As far as i know that's a bug that will hopefully be fixed in the next update to photoshop cc.

  • Why doesn't clicking laser mask icon or layer add hide-reveal mask produce a usable mask?

    When I try to add a layer mask either by clicking the icon in layers panel or going layer>add mask I am not getting a usable mask. The layer mask icon in the layers panel is added to the image, but it is still the rectangle with a white circle in it, not an icon with an all white or all black background. Clicking on this icon does not produce a mask to paint, whether white or black. Can anyone help me understand why I am not getting the typical pixel layer mask that can be used to paint and reveal the image beneath?  I must be missing something obvious but I can't figure out what I am doing wrong. Any help would be appreciated.

    Joe333 wrote:
    When I try to add a layer mask either by clicking the icon in layers panel or going layer>add mask I am not getting a usable mask. The layer mask icon in the layers panel is added to the image, but it is still the rectangle with a white circle in it, not an icon with an all white or all black background.
    Sounds like you have "No Thumbnails" set in Layer panel options, which displays mask icons as you describe. Right-click a layer icon (not a mask icon) and pick "Small", "Medium" or "Large" to see thumbnails.
    Clicking on this icon does not produce a mask to paint, whether white or black. Can anyone help me understand why I am not getting the typical pixel layer mask that can be used to paint and reveal the image beneath?  I must be missing something obvious but I can't figure out what I am doing wrong. Any help would be appreciated.
    Clicking on a mask thumbnail/icon should target the mask (you'll see a white border at the corners of the current target's thumbnail/icon) to receive paint, adjustments, etc, but not display it as a grayscale image on the canvas. To see the mask in grayscale as well as target it, Opt/Alt-click its thumbnail/icon. Use Backslash key to toggle rubylith overlay of mask.

  • How to add shape layer in Adobe After Effects Cs2 ???

    How to add shape layer in Adobe After Effects Cs2 ???

    You upgrade. You're too early for shape layers.

  • Add Tracking Mask to PSD or .PNG Layer in AE CC

    Guys, I'm pulling my hair out. Anyway you could give me a quick tip on how to apply a tracking mask to a PSD or .PNG layered on top of a movie file in AE CC? Man i'm going crazy trying to figure this out. Thank you very much in advance.
    I see here: http://tv.adobe.com/watch/learn-after-effects-cc/rigid-mask-tracker-in-afte... how to apply tracking mask to an adjustment layer, but the .PSD layer or .PNG layer mask doesn't offer the "right click > tracking mask" option.
    Please, what am I over looking? I have an AE comp with a PSD file or PNG file which has some bricks for a building, and I need the mask to track as the movie ever so slightly moves.
    Please help me. Thank you.

    Nope, that's not how it's done.  It's a little more compolicated than that:
    Duplicate the car layer.  Put it above the bricks.
    Make a mask around the  car.  Do it just before the car gets in front of the bricks.  Be very careful when masking.  Click the stopwach icon on the mask path property.
    Go forward in time until the car is just past the bricks.  Double click on the mask path you made earlier: a box forms around it.  Drag it back over the car and tweak mask vertices as necessary.
    RAM Preview and adjust the mask path as necessary.
    There you go.

  • How to Manage Several (But Similar) Masks on One Layer

    Hello, in video tutorials i'd like to "sketch-motion" a red circle around relevant areas – several times in one video, around several areas in several sizes, sometimes elliptical and sometimes rounded rectangle. Sometimes i might want to show changes in position and dimensions of the circle. The video tutorial itself is one video layer including audio, already rendered before imported to AE.
    I know how to create a "sketch-motion" effect with a (for instance elliptical) mask and the "Stroke" effect. Now this red circle has various keyframes:
    - At least for "Start" of "Stroke" effect and ended "Opacity" of this circle
    - sometimes more keyframes for position and transform
    I wonder how to best create 6 or 10 such red circles within one video tutorial:
    - Should i do everything with one single "Mask 1", with keyframes for several appearances in several areas and sizes or
    - should i create a new mask for every circle that i want to show (sounds much preferable)?
    I don't want to arrange again the keyframes for each new circle added (build-up time of Stroke effect, fade-out time). Is it possible to save a mask with all keyframes and import it at several points on the time line, with all keyframes intact? (Position and Size would still be adjusted, as well as length of visibility.)
    I searched but didn't find a good solution how to manage a "master mask" or "mask template" or how to show that mask with the "Stroke" effect various times with always similar keyframes for "Start" and "Opacity". If you could hint me at how to manage that, that would be great.
    Thanks!

    Mylenium, thanks for a helpful hint!
    I tried your suggestions and it seems that i have to save
    - mask shape and
    - Stroke effect settings incl. key frames
    as separate things, if i want them in the effects panel.
    When i set the Stroke effect to my preferred look (with custom colours, width, key frames for Start and Opacity) and save this as an effect, i cannot re-apply this to another mask with any of my custom settings still there. When i re-apply the saved custom Stroke effect, all settings like keyframes, custom colours and width are lost and it arrives with default settings and without any keyframes.
    Maybe i do something very wrong here?
    I wondered if i should save the mask with Stroke effect as an AE file and re-import it. But this mask can only be saved together with some footage and i don't see how to bring mask including Stroke effect into an existing composition and which of the File/Import ways to use.
    Thanks again!

  • How to add layer adjustments to workspace?

    If I choose the Photography workspace, I get four mini icons: MiniBridge, Actions, History, and Clone Source. How do customize these icons?  I would like to have Levels, Curves, Add a mask, Saturation, etc, as mini icons. Currently I have the full Adjustments Panel on top of Layers, Channels, and Paths. I'm talking about adding the small icons that appear to the left of this, those icons that change as you choose Essentials, Design, Painting, Photography, etc. Thanks!!

    Hi
    If you've got any panel or panel (tab) group and you want to turn them into small icons (they're actually referred to as 'floating docklets') then all you need to do is click on the small double-arrow at the top right of the panel/group - see the image below..
    If you're talking about splitting the adjustments panel that can't be done as far as I'm aware, although you could create individual panels (for destructive adjustments from the image > adjustments menu) using the Adobe Configurator application: http://labs.adobe.com/technologies/configurator/ (as mentioned above).
    Hope that helps
    Tony

  • Quick tip help. How to add to vector layers using shape tool

    This is something that's bugged me for a few versions and I'm sure someone has a tip for this.
    When I use Shape Layer tool, I get a solid color with a vector mask. The tool always makes a new layer every time I use the tool. So to get around that, I draw my shapes (one per layer) and then use the Path Selection Tool and cut and paste between Shape Layer layers.
    How can I draw another shape on a currently selected Vector Mask? (I want to build compound Pathfinder-like shapes)

    Yes, press the shift key to add to the current shape layer (vector mask).
    MTSTUNER

Maybe you are looking for

  • Unable to open a report from Java SDK

    Hi, I am trying to open a report from the SDK in a java application. Here is the code : package com.metrixware.test; import com.crystaldecisions.sdk.occa.report.application.OpenReportOptions; import com.crystaldecisions.sdk.occa.report.application.Re

  • Need new ATI Radeon 1400 display driver for Satellite A100-788 PSAA9E

    Hello , I search for New drivers for my ATI radeon mobility 1400 because in toshiba.com the last date drivers is 13/09/07. Thx.

  • Can I restore my device to *before* accidental sync?

    To make this question more clear, I'll start at the beginning. Today, I was planning on preparing a party mix for my birthday this weekend. I was going to add some songs to my library and then plug in my iPod touch to transfer the new songs and the m

  • Query for Opening Stock + Purchase Qty + Sales Qty

    Hi , Can anyboday help me by how to develop a query for the following requirement. If any custom query is available please provide me .We are working on SBO 2007B PL 8. The required report structure is      ItemNo ***OpeningStock**** Purchase *******

  • My Skype Number is busy continuously

    I am trying to call up the skype number from my mobile number however it is coming busy continously. Please help. Thanks, [Removed for privacy] Team Post transferred to create its own new thread (topic); Subject/title edited accordingly.