Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

How To Resize A Layer's Dimensions During A Script

New Here ,
Feb 22, 2025 Feb 22, 2025

Copy link to clipboard

Copied

Hey everyone, I don't know if I'm using the proper terminology or explaining this correctly but I have a Loom attached so you can see what I'm talking about if the following question(s) are unclear.

1. I'm running one of the legendary JJMack's mockup scripts and I need to know how to resize a smart object layer so the image in it comes out to specific measurements.

To further clarify, I'm not talking about the image itself, I can do that with CMD+T, I'm talking about the actual canvas dimensions itself, that the image goes onto. 

TOPICS
Actions and scripting , macOS

Views

103
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Community Expert ,
Feb 23, 2025 Feb 23, 2025

Copy link to clipboard

Copied

Question #1:

 

2025-02-23_20-08-45.png

 

I am not sure if this needs to happen every time the mockup script is run, or if you only need to set up the layers correctly beforehand.

 

If it only needs to happen once to the template before it is used to populate mockups, then just dupe the layer move it and then reset the clipped layers back as they were.

 

If this needs to happen each time the script is run, then you will need to automate the steps.

 

There might be a way to script this using the internal layers structures that mark the beginning and end of clipped layers, however, that is beyond my scripting abilities.

 

Although the following can be scripted or possibly put into an action, I will detail the manual steps:

 

1) Copy the base layer to the clipboard

 

2) The base layer of the clipping mask and the clipped layers need to be protected, encapsulated in either a group or as a smart  object.

 

3) Paste in place the copied base layer so that it is placed at the top of the layer stack.

 

Optionally, you can ungroup or convert the smart object back to a layer group and then ungroup if you wish to have the clipped ayers back as they were.

 

It's also possible to duplicate the base layer to a new document, then duplicate the layer back to the original document rather than copy/paste in place.

 

 

Question #2:

 

Smart object sizing uses the PPI resolution value of the smart object image vs. the parent containing document's PPI value. So start by comparing the PPI resolution values of the parent document and the edited smart object document. At the same time, compare the height in pixels of the parent containing document's layer compared to the edited smart object height in pixels.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2025 Feb 23, 2025

Copy link to clipboard

Copied

Another way for Question #1 without using groups or smart objects to protect the existing clipping relationship:

 

1) Select/target the clipping base layer

 

2) Ctrl/Cmd + J to dupe the layer

 

3) Select the previous original clipped layer Alt/Opt + [

 

4) Ctrl/Cmd + Shift + ] to move the layer to the top of the stack

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 23, 2025 Feb 23, 2025

Copy link to clipboard

Copied

Thank you so much for your timely response. I'm still having the issue which I can show you here. I think it's one of two issues:

1. I don't understand the instructions and I'm making a mistake.
2. I'm skipping or misreading the instructions and making a mistake.

Also, here's the link to the PSDs because maybe there's a mistake in them? 

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 23, 2025 Feb 23, 2025

Copy link to clipboard

Copied

LATEST

@AnimeApparelStore 

 

Does moving the smart object to the top layer need to happen every time the mockup script is run?

 

Or can you set this up correctly beforehand and save it into the template?

 

I have requested access to the linked PSDs.

 

Edit: I have downloaded the files, please answer the two questions above to help me to better understand the issue.

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines