Hi I am copying a section of my image and pasting it as a new layer. I am stuck on how do I flip the layer ?
The only flip I can find in the documentation is flipCanvas(). This is no use as it flips the whole image.
If I have to use script listener then I will, but I can't believe something this fundamental is not native to JSX
I just want to flip a layer vertically
-
Paul MR
I just want to flip a layer vertically
Yup, scriptlistener....
Code: Select allflipLayer(0); //Flip Horizontal
flipLayer(1); //Flip Vertical
function flipLayer(type) {
if(type == 0) pos ='Hrzn';
if(type == 1) pos ='Vrtc';
var desc = new ActionDescriptor();
desc.putEnumerated( charIDToTypeID('Axis'), charIDToTypeID('Ornt'), charIDToTypeID(pos) );
executeAction( charIDToTypeID('Flip'), desc, DialogModes.NO );
};
Code: Select allflipLayer(0); //Flip Horizontal
flipLayer(1); //Flip Vertical
function flipLayer(type) {
if(type == 0) pos ='Hrzn';
if(type == 1) pos ='Vrtc';
var desc = new ActionDescriptor();
desc.putEnumerated( charIDToTypeID('Axis'), charIDToTypeID('Ornt'), charIDToTypeID(pos) );
executeAction( charIDToTypeID('Flip'), desc, DialogModes.NO );
};
-
My old boots
I just want to flip a layer vertically
Thanks.
I wonder why they don't have that as an artLayer method.
I wonder why they don't have that as an artLayer method.
-
Mike Hale
I just want to flip a layer vertically
I don't think that there is anything 'wrong' with using Action Manager(scriptlistener). Often it is the only way to script some tasks and I think that it's closer to Photoshop's native code than the scripting languages.
But in this case you can use the DOM.
Code: Select allapp.activeDocument.activeLayer.resize(new UnitValue(100,'%'),new UnitValue(-100,'%'));
But in this case you can use the DOM.
Code: Select allapp.activeDocument.activeLayer.resize(new UnitValue(100,'%'),new UnitValue(-100,'%'));
-
My old boots
I just want to flip a layer vertically
LOL I'd never have thought to size it by -100% vertically.
Thanks again
Thanks again
-
applezap
I just want to flip a layer vertically
Sorry to revive an old thread. This works great to flip vertically, but what if I wanted to flip horizontally. I get the -100 thing, but how would you specify that it should be in x instead of y?
Thanks
Thanks
-
Mike Hale
I just want to flip a layer vertically
The first argument in layer.resize is width, the second height. To flip horizontally
Code: Select allapp.activeDocument.activeLayer.resize(new UnitValue(-100,'%'),new UnitValue(100,'%'));
Code: Select allapp.activeDocument.activeLayer.resize(new UnitValue(-100,'%'),new UnitValue(100,'%'));
-
applezap
I just want to flip a layer vertically
It seems so obvious now that you say it. Thank you!