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
Adobe 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
Adobe 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
Adobe Expert
March 17, 2017

Hello JJMack

thanks again for your time and effort. I just still think we don't understand each other right

It seems like the main "issue" you see is the fact that i have 2 documents for which i call one Main/Work doc. and the other Smart Object. I do understand, that my Smart Object is in fact just another .psd file placed/embeded into my my Main/Work document.

So my scripts will have to work with 2 documents at a time and as far as i know this shouldn't be an issue as i can target the opened documents by their names.

Anyway, it seems we go forth and back here and i need to finish this as soon as possible unfortunately. So i think my best option will be to ask for someone with scripting skills to program this as a paid job. Is maybe anyone here interested in that or could lead me to a website where freelancers with ps scripting skills are available ?

Thanks again everyone, i'm sure it can be done somehow and i won't give up by now


Yes you can process all open documents and create layers in them.  You would not be playing with layers visibility as such you would be creating a new visible layer in your main document the  images you want on your tee shirt.  IMO your going about this in a strange way.  I believe it would normally be done using a template file which is populated by some automated process like Photoshop's Data Driven Graphics or some custom Script or Action.  The Images to be populated would be external files not part of the "Main Document" hidden in a smart objects layer object where the object is a layered document with the images in layers with the visibility off so not rendered in the smart object layer pixels.

JJMack