Skip to content

Instantly share code, notes, and snippets.

@lm913
Last active December 23, 2015 15:38
Show Gist options
  • Save lm913/bae57650e4da52a61c58 to your computer and use it in GitHub Desktop.
Save lm913/bae57650e4da52a61c58 to your computer and use it in GitHub Desktop.
Pre-process script for 32020
/**
* ---Required ps functions---
* psNewGroup
* psNewPath
* psNewLayer
* psNewMask
* psAdjColourFill
* psApplyImgMask
* psDuplicate
*/
//currently requires a Background Layer
var doc = activeDocument;
//create the path items
psNewPath("Path 1");
psNewPath("Path 2");
//create the initial layer order
psNewLayer ("Original",false,true,null);
psDuplicate ("Original","masked",true,false,"RvlA")
psAdjColourFill ("background",255,255,255);
psNewLayer ("reflection",null,null,"RvlA");
psAdjColourFill ("shadow",0,0,0);
psApplyImgMask ("Original","shadow");
psNewLayer ("retouch",null,null,"RvlA");
psNewGroup ("shadow / reflection",null,null,"HdAl");
//adjust the layer order
doc.layers.getByName("masked").move(doc.layers.getByName("retouch"), ElementPlacement.PLACEAFTER);
doc.layers.getByName("background").move(doc.layers.getByName("Original"), ElementPlacement.PLACEAFTER);
//adjust the group order
doc.layers.getByName("reflection").move(doc.layerSets.getByName("shadow / reflection"), ElementPlacement.INSIDE);
doc.layers.getByName("shadow").move(doc.layerSets.getByName("shadow / reflection"), ElementPlacement.INSIDE);
doc.layerSets.getByName("shadow / reflection").move(doc.layers.getByName("masked"), ElementPlacement.PLACEAFTER);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment