Group clipping mask
My Layer group has a clipping mask on it and I want to know if it is possble to apply the clipping mask to the layers without flattening the layers in the group. I need it to remain in layers so I can export for Animation
My Layer group has a clipping mask on it and I want to know if it is possble to apply the clipping mask to the layers without flattening the layers in the group. I need it to remain in layers so I can export for Animation
Try this script. YOU HAVE TO HAVE THE GROUP CLIPPING MASK SELECTED! There is no error checking, so it will also clip to any layer, like an adjustment layer, which will just show the entire image of the clipping layer.
#target photoshop
var doc = activeDocument;
var cLay = doc.activeLayer;
selNextLayer ();
var gp = doc.activeLayer;
var layA =[];
for(var i=0;i<gp.layers.length;i++){
layA.push(gp.layers[i]);
};
for(var i=0;i<layA.length;i++){
doc.activeLayer = cLay;
dupe ();
var mLay = doc.activeLayer;
mLay.move (layA[i], ElementPlacement.PLACEBEFORE);
mLay.grouped = true;
}
cLay.remove();
function dupe(){
var idCpTL = charIDToTypeID( "CpTL" );
executeAction( idCpTL, undefined, DialogModes.NO );
}
function selNextLayer(){
var idslct = charIDToTypeID( "slct" );
var desc2 = new ActionDescriptor();
var idnull = charIDToTypeID( "null" );
var ref1 = new ActionReference();
var idLyr = charIDToTypeID( "Lyr " );
var idOrdn = charIDToTypeID( "Ordn" );
var idBckw = charIDToTypeID( "Bckw" );
ref1.putEnumerated( idLyr, idOrdn, idBckw );
desc2.putReference( idnull, ref1 );
var idMkVs = charIDToTypeID( "MkVs" );
desc2.putBoolean( idMkVs, false );
var idLyrI = charIDToTypeID( "LyrI" );
var list1 = new ActionList();
list1.putInteger( 2 );
desc2.putList( idLyrI, list1 );
executeAction( idslct, desc2, DialogModes.NO );
}
Already have an account? Login
Enter your E-mail address. We'll send you an e-mail with instructions to reset your password.