Skip to main content
Participant
October 1, 2021
質問

Actions records my transformation in percent overrides cm

  • October 1, 2021
  • 返信数 2.
  • 603 ビュー

Hi all,

In my document I have a lot of layers. Each layer has a different height measurement, I want them all to be 21cm high.

When I record the action to transform the height to 21cm, the action overrrides it into percentage, leaving all my layers scaled instead of 21cm high. The layers are cut outs that I pasted from different files so I can't 'image size them seperatly'. They are already pasted in my file and I just want a quick way to get them all 21cm high.

Thank you so much,

Sara

このトピックへの返信は締め切られました。

返信数 2

JJMack
Community Expert
Community Expert
October 1, 2021

You need to be careful recording Transform in Action.  Size change will always be recorded as a relative side percentage change this is normally resizing. However the translate will be recorded in ruler units setting normally  however when I set unite to CM if records as inches it may be due to the document resolution is  set to PPI not PPC.  The position is also recorded in ruler units. Angle of rotation in degrees and if you also warp  in transform the transform step records many point  in pixel values  many points  are recorded  in Pixels not all will be displayed in the action step in the action palette.    Transform is powerful and very complex. You need to read what is recorded to know how the step will work.

 

 

JJMack
sara5ED2作成者
Participant
October 3, 2021

Thank you everybody, the conclusion is, there is no 'quick way' of doing this. By the time I put an action on all layers turning them into smart objects I might as well just do it manually and spend a bit more time on doing that. I don't know anything about script myself so I won't dive into that. Thank you for your replies, I'm surprised I can't be the only one just pasting things into a new document and wanted them the same height? I hope the they add a transform option that just allows this to be done in a quick way. 
I probably should have transformed them 21cm before pasting them in the new file.. ah well..

Thank you for sharing your solutions.

Sara

 

Ps Yes I want them proportionally scaled to 21cm height.

JJMack
Community Expert
Community Expert
October 3, 2021

If you are just tiling images  I made a script for that in my package for populating  templates.  No template is required for pasting  in tiled images.  Images will be scale to for the tile side.  If an Image has a different aspect ratio than the tile size the scaled image will be masked to the tile aspect ratio make it  tile size. The image  will look like a centered aspect ratio crop for the tile aspect ratio.   Paste into is used not Place.  The tiles document will be layer.  So you will be able move masked image to adjust the virtual crop image composition.

PasteImageRoll 

JJMack
Stephen Marsh
Community Expert
Community Expert
October 1, 2021

Are you proportionally scaling or distorting only the height to 21cm?

 

If you turn the layer into a smart object, then edit the smart object, you can use image size or fit image, which does work in px and not %.

 

Or you can duplicate the layer to a new file, resize or fit image, then drag or copy/paste it as a layer.

 

A custom script may be another workaround.

 

 

This script from @jazz-y will create a smart objects from the original top-level layers (perhaps work on a duplicate of your curren doc). Then each SO layer can have an action recorded to open the SO and resize the smart object using image size or fit image, saved and closed to updage the layer content in your layered file.

 

/* convert all top level layers and layer sets to smart objects AM CODE.jsx

by jazz-y (DmitryEgorov)
Smart Objects in separate layers
https://community.adobe.com/t5/photoshop/smart-objects-in-separate-layers/td-p/11137197
*/

#target photoshop

s2t = stringIDToTypeID;
t2s = typeIDToStringID;

(r = new ActionReference()).putProperty(s2t('property'), p = s2t('hasBackgroundLayer'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'))
var indexFrom = executeActionGet(r).getBoolean(p) ? 0 : 1;

(r = new ActionReference()).putProperty(s2t('property'), p = s2t('numberOfLayers'));
r.putEnumerated(s2t('document'), s2t('ordinal'), s2t('targetEnum'))
var indexTo = executeActionGet(r).getInteger(p);

var layers = {}
parseLayerSets(indexFrom, indexTo, layers)

for (o in layers) {
    (r = new ActionReference()).putProperty(s2t('property'), p = s2t('layerKind'));
    r.putIdentifier(s2t("layer"), layers[o].id);
    var kind = executeActionGet(r).getInteger(p)
    if (kind != 2 && kind != 5) {
        (r = new ActionReference()).putIdentifier(s2t("layer"), layers[o].id);
        (d = new ActionDescriptor()).putReference(s2t("null"), r);
        executeAction(s2t("select"), d, DialogModes.NO)
        try {
            executeAction(s2t("newPlacedLayer"), undefined, DialogModes.NO);
        } catch (e) {
            alert(e)
        }
    }
}

function parseLayerSets(from, to, parentObj) {
    for (var i = from; i <= to; i++) {
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('layerSection'));
        r.putIndex(s2t("layer"), i)
        var section = t2s(executeActionGet(r).getEnumerationValue(p))

        if (section == 'layerSectionEnd') {
            i = parseLayerSets(i + 1, to, parentObj[i] = {})
            continue;
        }

        var properties = {};
        (r = new ActionReference()).putProperty(s2t('property'), p = s2t('layerID'));
        r.putIndex(s2t("layer"), i);
        properties.id = executeActionGet(r).getInteger(p);

        if (section == 'layerSectionStart') {
            for (o in properties) {
                parentObj[o] = properties[o]
            }
            return i;
        } else {
            parentObj[i] = properties
        }
    }
}