Skip to main content
johny roger
Inspiring
March 14, 2017
Question

Select Layers in Smartobject sequentialy and save Mainfile each time

  • March 14, 2017
  • 3 replies
  • 3867 views

Hello All

i am trying to find a solution for the following scenario:

  1. Master File contains a smart object which will be replaced with a action (Name of SO Layer is constant).
  2. The smart objects do have a different amount of layers (i.e. one SO has 10 layers, while another one has 17).
  3. Script executed within the Master File should make each layer in the SO visible, save, return to Master File and save this out to a file containing the name of the visible layer in the Smart Object.

i can do this with actions (except the naming) as long as the Smart Objects have the same amount of layers and the same names for the layers.

Hope my explanation does not sound to complicated. Basically the Smart Objects comtain designs to be placed on apparel (shirts, hoodies) in the Master File. Each placed design should then be saved as a jpg and png with the name of the design/layer in the SO.

thank you everyone for your time and help. I'm happy to give something in return

Have a good day.

Daniel

p.s. Using PS CC 2017 on Mac

This topic has been closed for replies.

3 replies

Participating Frequently
March 19, 2017

Sent you a PM.

Known Participant
March 16, 2017

You can try using the "Unsmart Objects" script to sidestep the whole smartobject thing entirely... it may work or it may not be what you need exactly, but here's the rundown...

1. Go here and get the "Unsmart Objects" script: Magic scripts for Photoshop

2. Add that script to your scripts directory so it will show up in your File->Scripts menu... :

Windows: C:/Program files/Adobe/Photoshop CC [your version]/Presets/Scripts

Mac OS X: Applications/Photoshop CS3/Presets/Scripts  (I think?)

From there you should be able to record an action of "unsmarting" the smart object, which will get you all the layers inside at the scale you want. Then you can export all layers?

johny roger
Inspiring
March 16, 2017

Hello Max

thank you for your answer. I downloaded the script and i can "import" all the visible layers from the smart object.

The only downside is, that i had a distortion map on the smart object, which obviously does not get copied onto the newly created layers. Sure i could re-apply it to all layers, but this would kill my cpu and would probably take forever .

Anyways, if i would go this route:

1. is it possible to run now a script for the imported layers to toggle one after another visible/save and go to the next layer.

2. would the script be able to know, when the last layer from that group has been made visible and saved out?

3. I'd need then to replace the background/T-Shirt with a different color and run these steps again.

Maybe check also my short screencast to understand better what i'm after

Screencast

I know, i'm asking a lot of questions, but i thought as i had it working with actions, it would be easy to do the same with a script.

Thanks again to everyone for your help. It's really appreciated!

JJMack
Community Expert
March 16, 2017

johny_roger wrote

 

I know, i'm asking a lot of questions, but i thought as i had it working with actions, it would be easy to do the same with a script.

 

Thanks again to everyone for your help. It's really appreciated!

Anything an Action can do you can do in a script.  In fact an Action can be converted into script code. It will run slower than the Action and like the action everything is hard codes Photoshop steps. Step step step....

 

Script can use logic your Action also does not has access to your Smart layers object layers.  So it seems you do not need to get at them.

JJMack
JJMack
Community Expert
March 15, 2017

A Smart Object Layer content its object can be replace. The replacement object must be the sames Size  for the Smart object layers associated transform is not replaces. The replacement file can be layer of not it makes no difference for Photoshop renders pixels for the object and uses these as them layer content. These Pixels are locked and can not be change by Photoshop tools like the paint brush, eraser etc. They can only be acted on with smart filters and transform.  The  layers pixels are not changed only its composite view is changed when these Photoshop adjustments are applied. A smart object layer is a single layer its object may be layered the Smart Object layer is a single layer in a Photoshop document. There can be more than one smart object layers and Smart Object Layers cal also share a common object. It an easy way to create a Picture Package. You replace a single object and all the images are changed in the Picture package.

A script could open a smart object layer object and I would think if the Object was a Photoshop object process the work document added to documents.  However if the object is a RAW file ACR wouls oper the RAW temp file users would see  ACR UI. If the object is an AI File AI would be started ant the object would open in AI.

You would need to script this if objects will have different number of layers. Actions can not use logic to get the number of layers and process x number of layers.

JJMack
johny roger
Inspiring
March 15, 2017

Hello JJMack

thank you for your answer and your time. Unfortunately you probably misunderstood my question.

I am aware of replacing smart objects and the sizing of it's content, this is all working as it should.

The "only" thing i need is a script that allows me to make each layer in the SO visible one after another and export a .jpg file from the master file containing the SO each time. If possible, the saved .jpg should contain the name of the corresponding layer in the smart object.

if you could get me into the right direction with the scripting, that would be awesome.

thanks again and have a good evening.

JJMack
Community Expert
March 15, 2017

Did you read the second part of my append I wrote that if the Smart Object Layer's object is and Photoshop object like a bunch of layers or a layered PDF or layer Tiff your Script most likely could have Photoshop open the Smart Object Layer's object in Photoshop and your script could then process the work document opened by Photoshop. Create new document for each layer, save our a jpeg file in the fouler you want with a unique name the includes the master document name smart object layer name the work document's layer name and close this new document. When all layers in the opened work document have been processed you would the close the work document without saving. The Smart Object layer object would not be updated it would remains as it was before your script opened the object in Photoshop.

If the layers object is a RAW file or a placed AI file the object would open in ACR or Illustrator.

JJMack