How to automate layer stack creation including layer masks based on filename?

Hi
Can someone help me to create a script that would automate the creation of layers including a layermask, based on filenames.
E.g.
Unwrap_001_diffuse.jpg
Unwrap_001_mask.jpg
Unwrap_002_diffuse.jpg
Unwrap_002_mask.jpg
The image with the suffix "_diffuse" would be the layer and the image with the suffix "_mask" would be the layermask.
In the above example the script would create 1 psd with 2 layers.
If there is no file with the ending "_mask", the script would only create a single layer with no layermask.
Any help would be highly appreciated.
Thank you
Boris
I

For starters the Folder-selection dialog could be used if the images are all in one Folder.
var theFolder = Folder.selectDialog ("select folder");
And then the method getFiles could be used to get the files.
var theFiles1 = theFolder.getFiles("*_diffuse.jpg");
Loading the file as Layers can be done with the ScriptingListener code for File > Place for example and finding the corresponding mask files seems fairly easy.
Are they grayscale or RGB?
But why jpg anyway?
Are those renderings?
If so why not tiffs or some other non destructively compressed file format?

Similar Messages

  • How to automate domain configuration creation for OAM11g

    Hi
    Please let me know is there any way to automate the domain configuration creation for OAM 11g .
    For ex- Using config.sh in silent mode to create the domain.
    Oracle Access Manager - Version 11.1.1.5.0
    Thanks
    Anil

    You probably answered your own question. Yes, you can use silent installation for creation and configuration of OIAM products.
    Ref: Silent Installation
    -Bikash

  • How to Automate Error Stack Analysis   -- How to guide

    I was wondering if anybody has successfully implemented this How to Guide
    "http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/e01c300f-e02f-2c10-46a8-b5ac929bc4ac"
    I am getting errors while saving the code for the Functional Module listed in there, and would like to get the exact working Abap code.
    Thanks.

    Hi,
    pls chk this link it may help you...
    http://help.sap.com/saphelp_nw70/helpdata/en/42/fbd598481e1a61e10000000a422035/content.htm
    rgds,

  • How can I automatically save as a jpg layer groups?(layer group jpg)

    Has created a 10 layer groups in Photoshop (there are multiple layers in the group layer.)
    10 Photoshop layer groups
    I try to save the JPG file to 10.
    How can I batch or automatically save?

    Just so you are aware, jpg does not support layers. However there is a script actually two scripts that can take the layers and create individual files.
    File>Scripts>Layer Comp to Files
    File>Scripts>Export Layers to Files
    The former requires you to use layer comps which is a way of creating sets of layers to create a comp. The latter is just as it says.
    But as I said anything saved as a jpg will be a single layer with no transparency.
    Psd and tiff are the only two that should be used for multiple layers and transparency. There are other formats that support transparency, but is not the scope of this thread. At least for now.

  • Randomise Layer Stacking Order in AE CS3

    Hi,
    I am working on a file with over 100 layers and wondered if anyone knew how to randomise layer stacking order?
    I have seen a plugin that can do it but it costs over $100!
    I cant believe that Adobe would not include this as a standard function within After Effects, seems like it would be really useful to alot of people!
    Anyway, if anybody knows of either a way i can do this or a free plug in that can do this it would be much appreciated!
    Thanks!
    J

    As Jonas mentioned, the KindaSorta script from Jeff Almasol does what you're looking for. A link to this script appears in the
    "Change the stacking order for selected layers" section of After Effects CS3 Help on the Web.
    In fact, many dozens of scripts from Jeff are linked to from the pages of After Effects CS3 Help on the Web.
    Try this Google search:
    almasol site:livedocs.adobe.com
    You'll find a wealth of great material from our scripting master.

  • Batch subfolder images to layer stacks, then to sprites.

    I have tried for nearly a week now to wrap my head around this one but I'm a just too new to java scripting to pick it up soon enough to solve my problem. I found Batch HDR creation script, which was great and close to what I'm looking for but I'm not sure how to put it all together. I'm hoping, no begging for some help.
    Ok....
    So I have animations for a game rendered into png image sequences placed into separate folders that contain customizable armor and weapons that can be added on top of the character upon the gamers selection.
    There are 130 total character animation folders and 209 separate subfolders inside the animation folders containing the custom armor and weapons following the character.
    The original idea was just to give the programer image sequences but it has changed to require sprite sheets now, and that leaves way too many manual conversions to cover in the time I'm allotted.
    I need a script that makes you browse for the top folder(the animation)one time then opens all subfolder images one folder at a time into layer stacks, then converts them to sprite sheets, saves them out as a png with transparency to a separate folder containing all created sprite sheets from the animation folder in one new folder or already created folder on the desktop.
    I mashed some well thought out(not mine) scripts together but couldn't get them to batch open subfolders and the layers to sprite would return an error because some frames are blank.
    I'm using Photoshop CS5 and Mac osx, this is my first forum post anywhere, ever, so exciting. Thanks for any advice or help.
    Dev

    // select folder, create files with the contents of one of the subfolders each as layers and save them to the folder;
    // use it at your own risk;
    #target photoshop
    // select a folder;
    var sourceFolder = Folder.selectDialog("Select folder");
    if (sourceFolder) {
    // the psd options;
    psdOpts = new PhotoshopSaveOptions();
    psdOpts.embedColorProfile = true;
    psdOpts.alphaChannels = false;
    psdOpts.layers = true;
    psdOpts.spotColors = true;
    // get the contents as one array per folder;
    var items = retrieveFiles(sourceFolder, [[]]);
    // iterate through;
    for (var m = 1; m < items.length; m++) {
              var thisArray = items[m];
              var folderName = thisArray[0].parent.name;
    // open file;
              var theImage = app.open(File(thisArray[0]));
              for (var n = 1; n < thisArray.length; n++) {
    // place rest of array;
                        var theLayer = placeScaleFile(thisArray[n], 0, 0, 100);
    // Arrange layers into a sprite sheet.   
    if (documents.length > 0)
              var cols = 5;
              docRef = activeDocument;   
              var activeLayer = docRef.activeLayer;
              numLayers = docRef.artLayers.length;
    //           layertext = "There are " + numLayers + " layers.";
              var rows = Math.ceil(numLayers/cols);
               var spriteX = docRef.width;
               var spriteY = docRef.height;
              // put things in order
              app.preferences.rulerUnits = Units.PIXELS;
              // resize the canvas
               newX = spriteX * cols;
               newY = spriteY * rows;
               docRef.resizeCanvas( newX, newY, AnchorPosition.TOPLEFT );
              // move the layers around
               var rowi = 0;
               var coli = 0;
               for (i=(numLayers - 1); i >= 0; i--)
                         docRef.artLayers[i].visible = 1;
                          var movX = spriteX*coli;
                          var movY = spriteY*rowi;
                         docRef.artLayers[i].translate(movX, movY);
                         coli++;
                         if (coli > (cols - 1))
                                   rowi++;
                                   coli = 0;
    //This is to merge the visible layers/////////
    try{
        activeDocument.mergeVisibleLayers();
        }catch(e){}
    // save the stacked file;
              theImage.saveAs(new File(sourceFolder+"/"+folderName+".psd"),psdOpts,false);
    // close;
              theImage.close(SaveOptions.DONOTSAVECHANGES);
    ////// get from subfolders //////
    function retrieveFiles (theFolder, theFiles) {
              if (!theFiles) {var theFiles = [[]]};
              var theContent = theFolder.getFiles();
              for (var n = 0; n < theContent.length; n++) {
                        var theObject = theContent[n];
                        if (theObject.constructor.name == "Folder") {
                                  theFiles.push(new Array)
                                  retrieveFiles(theObject, theFiles)
                        if (theObject.name.match(new RegExp(/\.(jpe|jpg|jpeg|gif|png|tif|tiff|bmp|psd|dng|pict|eps|raw|rw2|crw|cr2)/i)) != null) {
                                  theFiles[theFiles.length - 1].push(theObject)
              return theFiles
    ////// get psds, tifs and jpgs from files //////
    function getFiles (theFile) {
        if (theFile.name.match(/\.(eps|ai|jpg|tif|psd|pdf|)$/i)) {
            return true
    ////// place //////
    function placeScaleFile (file, xOffset, yOffset, theScale) {
    // =======================================================
    var idPlc = charIDToTypeID( "Plc " );
        var desc5 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
        desc5.putPath( idnull, new File( file ) );
        var idFTcs = charIDToTypeID( "FTcs" );
        var idQCSt = charIDToTypeID( "QCSt" );
        var idQcsa = charIDToTypeID( "Qcsa" );
        desc5.putEnumerated( idFTcs, idQCSt, idQcsa );
        var idOfst = charIDToTypeID( "Ofst" );
            var desc6 = new ActionDescriptor();
            var idHrzn = charIDToTypeID( "Hrzn" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idHrzn, idPxl, xOffset );
            var idVrtc = charIDToTypeID( "Vrtc" );
            var idPxl = charIDToTypeID( "#Pxl" );
            desc6.putUnitDouble( idVrtc, idPxl, yOffset );
        var idOfst = charIDToTypeID( "Ofst" );
        desc5.putObject( idOfst, idOfst, desc6 );
        var idWdth = charIDToTypeID( "Wdth" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idWdth, idPrc, theScale );
        var idHght = charIDToTypeID( "Hght" );
        var idPrc = charIDToTypeID( "#Prc" );
        desc5.putUnitDouble( idHght, idPrc, theScale );
        var idLnkd = charIDToTypeID( "Lnkd" );
        desc5.putBoolean( idLnkd, true );
    executeAction( idPlc, desc5, DialogModes.NO );
    return app.activeDocument.activeLayer;

  • How to transfer (copy/move/paste) group layer to another page or file?

    Hi
    I wanted to transfer a set of group layer to another page in Fireworks CS5, how can I do that?
    When I try to copy paste, it doesnt paste as a group instead paste as layers, then I have to again group it and name it Why Fireworks doesn't understand that I have copied a set of group layer?

    You can share a layer to another page in Fireworks by selecting the layer in the Layers panel, then clicking on the small fly-out menu in the upper-righthand corner of the Layers panel and choosing "Share Layer to Pages". This opens up a two-column dialog, where can select the new page and add it to the right-hand column, "Include layer to page(s)".
    As far as moving a layer into another file, you may need to use a Command like "L - Copy to Next Doc" from John Dunning's Frame and Layer Utilities command set:
    http://johndunning.com/fireworks/about/FrameLayerUtils

  • How do I copy text from one layer to  another?

    I have Googled this but not a single answer seems to work.
    I am using Photoshop CS4 on OS X 10.6.7.
    OK, so  I  have a layer that  has some text in it.  I would like to  be able to  simply copy that  text  from one layer  to  another, but this seems to  be impossible as the Edit Paste menu item is grayed out after I have copied it in to the clipboard.  I can paste it into  the SAME layer, but not into another layer.
    This is how I am trying to  do  this.
    In the layer  with the text, click on the "T" icon to  the left.
    Click on the text, in the layer that I  want to  copy. 
    I select the text (either  by  clicking and dragging or pressing Command-A).
    Next I press Command-C.
    Then I  click on the layer In the Layer Panel) where I want to  paste the text.
    Pressing Command-V is impossible because the Edit-Paste menu option is grayed out!!!!
    WHY??????
    Perhaps more importantly, HOW do I copy text  from one layer to  another?

    First thing you can simply right click on the Text Layer and choose Duplicate Layer.  But that will create a new Text Lay
    er identical to the one you have.
    To answer your question in your case....  Create the Text Layer.   Make a New Layer.  Or have the layer you want to paste into visible.
    Highlight the text layer in the Layer Palette and Ctrl+Click (Win) Cmd+Click(Mac) so that you see marching ants walking around your text.
    Edit>Copy.
    Then highlight your Layer you want to paste into and hit Edit>Paste or Cmd+V / Ctrl+V.

  • How do I move a pattern layer independent of its vector mask?

    I've created a pattern fill layer and assigned a vector mask to it. How do I move the pattern around without affecting the mask? I realize if I want to rotate the pattern I'd need to convert it to a smart object, but if I only need to adjust the pattern location there must be some way to do that without moving the vector mask along with it. A traditional layer shows the vector and raster mask layer with a lock icon, but fill pattern layers are different for some reason. Can someone "fill" me in?

    rcraighead wrote:
    Yes, I understand that. I am working with pattern layers, not layers filled with a bitmap pattern.
    That is not what your showing above in red above your showing a shape layer in CS6 a pattern fill layer with a vector mask is a cs6 shape layer. Even the icon on the layer's content in the layers palette shows its a shape layer.  You can edit the vector mask you can not unlink it. For its a cs6 shape layer.  As you noted you can first convert pattern fill layer into a smart object layer. It then acts like a normal pixel layer with an associated transform to the canvas size. Your no longer dealing with a pattern fill layer. When you rotate it you will have the same problem with the layers corners areas.  CS6 changed shape layers design they have more options then prior  versions of Photoshop and prior versions of Photoshop can not handle CS6 shape layers that used cs6 shape options like stroke, line type, and pattern fills.

  • How to store pdf files in application layer

    Hi friends,
    Can any body tell me how to this.when ever we give a print a spool number will be created.we can give this spool number to rstxpdft4 program and we can convert it into pdf.
    how to put this pdf into application layer as a unix file.is it possible to do that.
    Regards,
    Sasi

    Complete code right from spool request :
    FORM convert_spool_to_pdf.
      IF is_otf IS INITIAL .
    List to PDF
        CALL FUNCTION 'CONVERT_ABAPSPOOLJOB_2_PDF'
             EXPORTING
                  src_spoolid              = p_spool
               dst_device               = 'LOCL'
             IMPORTING
                  pdf_bytecount            = bytes
                  pdf_spoolid              = pdf_spool
                  list_pagecount           = pages
                  btc_jobname              = job_pdf
                  btc_jobcount             = jobcount_pdf
             TABLES
                  pdf                      = i_pdf
             EXCEPTIONS
                  err_no_abap_spooljob     = 1
                  err_no_spooljob          = 2
                  err_no_permission        = 3
                  err_conv_not_possible    = 4
                  err_bad_destdevice       = 5
                  user_cancelled           = 6
                  err_spoolerror           = 7
                  err_temseerror           = 8
                  err_btcjob_open_failed   = 9
                  err_btcjob_submit_failed = 10
                  err_btcjob_close_failed  = 11.
      ELSE .
    OTF ( SAPSCRIPT ) To PDF
        CALL FUNCTION 'CONVERT_OTFSPOOLJOB_2_PDF'
             EXPORTING
                  src_spoolid              = p_spool
                  no_dialog                = ' '
             IMPORTING
                  pdf_bytecount            = bytes
                  pdf_spoolid              = pdf_spool
                  otf_pagecount            = pages
                  btc_jobname              = job_pdf
                  btc_jobcount             = jobcount_pdf
             TABLES
                  pdf                      = i_pdf
             EXCEPTIONS
                  err_no_otf_spooljob      = 1
                  err_no_spooljob          = 2
                  err_no_permission        = 3
                  err_conv_not_possible    = 4
                  err_bad_dstdevice        = 5
                  user_cancelled           = 6
                  err_spoolerror           = 7
                  err_temseerror           = 8
                  err_btcjob_open_failed   = 9
                  err_btcjob_submit_failed = 10
                  err_btcjob_close_failed  = 11.
      ENDIF .
      IF sy-subrc <> 0 OR
         i_pdf[] IS INITIAL .
    Error creating PDF File .
        Message e000.
      ELSE .
    Got PDF Structure . Now transfer to App. Server.
      ENDIF .
    ENDFORM.                    " convert_spool_to_pdf
    FORM send_spool_app.
      OPEN DATASET p_fname FOR OUTPUT IN BINARY MODE .
      IF sy-subrc = 0.
        LOOP AT i_pdf .
          TRANSFER i_pdf TO p_fname.
        ENDLOOP.
        CLOSE DATASET p_fname .
        MESSAGE s000 WITH p_fname.
      ELSE.
        MESSAGE e502(0u) WITH p_fname .
      ENDIF.
    endform.
    This is a working code as we are using the same concept.
    Hope it helped.

  • How to make a selection of a layer delete content and paste another content with Photoshop scripting..?

    how to make a selection of a layer delete content and paste another content with Photoshop scripting..?

    There is a more specific Forum …
    Photoshop Scripting

  • How to synchronize a graphic on one layer with an effect on another

    Hi.  I'd like to use the bulge effect on my main layer to create distortions in the underlying graphic.  I'd also like to synchronize this with the image of a magnifying glass or other lens so that when I mover the lens around, the main image distorts / bulges beneath it.  Not sure if I should place the magnifying glass on its own layer (or the same layer as the main image).  Also not sure how to go about parenting an effect (like bulge) to an object / image (like a magnifying glass).
    Any help would be appreciated.
    Thanks

    Thanks for providing the link.
    As to the Search function, I usually do try to search first because I understand these forums are pretty much run by volunteers who are giving freely of their time and expertise.  That said, I rarely find what I need.  Probably has to do with how the info is indexed, plus my overall lack of familiarity with After Effects at this point.  For instance, I just tried putting in "linking a layer to an effect on another layer" or something like that.  That pulled up a list of 20 or so items.  There were a couple of links to Expressions, and that probably would have tipped me off to the right answer. 
    Anyway, I appreciate the link you provided, and I'll try to work on my searches.

  • Photoshop Elements 13 how to open an image as a layer?

    Hello, I recently received as asked Photoshop Elements 13 for Christmas, and have been using Gimp for about a year now as a substitute. However, when I went to start a project, I couldnt figure out how to open an image as a layer. Any help would be appreciated, thanks!

    Heres an example with 2 images. I want to get the image you see in this picture, and place it in the original image as a layer, not a separate project.

  • How to automate the payment program proposal creation

    Hi Experts,
    Another question, as we have to automate the creation of the payment run and its proposal run and then the list should go to specified person, who will check and then the payment run will be executed manually in the system.
    How to automate this?
    Thanks,
    Atif

    Hi,
    For payment run parameter generation you can use the program SAPF110S and for the proposal run execution you can use the program SAPFPAYM_SCHEDULE.
    Schedule these programs via a batch job on periodic basis in steps and give the intended recipients in the spool recipients.
    Regards,
    Gaurav

  • How to convert a image layer to a text layer any idea? a image looks like a text in layers box

    How to convert a image layer to a text layer any idea? a image looks like a text in layers box

    You can't convert an image into a text layer.  What you can do is clip an image to a text layer so that just the image layer shows up where there is text.  Create a text layer, then above it put your image layer.  Hold down the alt/opt key and click between the two layers to clip them.

Maybe you are looking for