Skip navigation
Currently Being Moderated

Divide layer into 4 quarters and trouble with marquee tool.

May 12, 2012 2:46 AM

Help, please!!! Because I will be doing this often in the near future, I need to create an action to precisely divide a LAYER into 4 quarters, in order to easily create seamless patterns. I'm having trouble figuring out how to automate the placing of guides limited to the center points of the selected layer dimensions, as opposed to the entire image's dimensions. My second difficulty is in selecting the quarters; using the marquee tool, etc, the selection tool is NOT snapping to the guides, despite what I have the Snap To preferences set to. I need to select the pixels right up to the guide line so that I can select the "Make a new layer via cut" and then move the new layers in position to make a seamless tile. Right now, it is selecting a few pixels off. (Annoying!) So until I can figure out how to address these issues, I can't even begin to record an action. Even if I can't record a general action, due to the problem of different layers having different dimensions, I'd be happy to discover a shortcut to accurately quartering a layer and any advice as to why I'm having trouble managing the marquee tool. Maybe I'll get lucky and some kind soul will have already created and be willing to share something to solve this problem I'm currently trying out the CS6 Beta but usually work in either CS5 or PSE 9. For those of you who respond, thanks in advance!

 
Replies
  • Currently Being Moderated
    May 12, 2012 4:26 AM   in reply to amsb9903

    If you want to give a Script a try, paste the following text into a new file in ExtendScript Toolkit (part of Photoshop’s installation, Applications/Utilities/Adobe Utilities/ExtendScript Toolkit CS4 or /Applications/Utilities/Adobe Utilities-CS5/ExtendScript Toolkit CS5) and save it as a jsx-file into Photoshop’s Presets/Scripts-folder.

    After restarting Photoshop the Script should be available under File > Scripts and can be assigned a Keyboard Shortcut directly, recorded into an Action, (in CS4 and CS5) be used in a Configurator-Panel or started from ExtendScript Toolkit directly.

     

    // make 4 quadrant copiers of selected layer;

    // 2012, use at your own risk;

    #target photoshop

    if (app.documents.length > 0) {

    var myDocument = app.activeDocument;

    var originalUnits = app.preferences.rulerUnits;

    app.preferences.rulerUnits = Units.PIXELS;

    //

    var theLayer = myDocument.activeLayer;

    var theBounds = theLayer.bounds;

    var theWidth = theBounds[2] - theBounds[0];

    var theHeight = theBounds[3] - theBounds[1];

    // operation;

    var hor = 0;

    var ver = 0;

    for (var m = 0; m < 4; m++) {

    myDocument.activeLayer = theLayer;

    // calculate stuff;

    var left = theBounds[0] + (theWidth / 2 * hor);

    var right = left + (theWidth / 2);

    hor++;

    if (hor == 2) {hor = 0};

    var top = theBounds[1] + (theHeight / 2 * ver);

    var bottom = top + (theHeight / 2);

    if (String(m / 2).indexOf(".") != -1) {ver++};

    // make selection;

    var theArray = [[left, top], [right, top], [right, bottom], [left, bottom]];

    myDocument.selection.select(theArray, SelectionType.REPLACE, 0, false);

    // copy to layer;

    var id14 = charIDToTypeID( "CpTL" );

    executeAction( id14, undefined, DialogModes.NO );

    myDocument.activeLayer.name = theLayer.name + "_" + String(m);

    };

    // reset;

    app.preferences.rulerUnits = originalUnits;

    };

     
    |
    Mark as:
  • Currently Being Moderated
    May 12, 2012 8:34 AM   in reply to amsb9903

    amsb9903 wrote:

     

    Help, please!!! Because I will be doing this often in the near future, I need to create an action to precisely divide a LAYER into 4 quarters, in order to easily create seamless patterns...

    If your Photoshop has the 3D capabilities, for seamless patterns, try New Tiled Painting form the 3D menu.

     
    |
    Mark as:
  • Currently Being Moderated
    May 12, 2012 9:12 AM   in reply to amsb9903

    It takes a few seconds to try the New Tiled Painting and you don't need to read anything about it until you don't understand something. Personally I have never read about it - I just tried it when I saw it on that menu and after that have used it many times without a problem.

     

    1 create a new document with the size of the pattern.

    2 choose 3D > New Tile Painting

    3 paint

     
    |
    Mark as:
  • Currently Being Moderated
    May 12, 2012 11:29 AM   in reply to amsb9903

    amsb, did you try the three steps in my previous post? Here's the steps again a little bit more specific,

     

    1. Choose File > New, and in the New dialog, from the Preset menu, choose let's say the Web preset, and press OK.

    2. try choosing 3D > New Tile Painting and let me know if it is still grayed out. If not select it and

    3 pick the brush tool and paint

     

    Let me know if you can do this first and then we will try to figure out why the menu was grayed out.

     
    |
    Mark as:
  • Currently Being Moderated
    May 13, 2012 3:04 AM   in reply to amsb9903

    I thought about the Open GL before I posted my previous reply but I made a test on my computer with Open GL disabled and the New Tile Painting was still available in my 3D menu and everything was still working fine. If it is your video card,  I guess my Quadro fx workstation video card made it work even with Open GL disabled.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points