Skip to main content
Participant
November 15, 2018
Question

Replacing multiple different smart objects (or loading objects with predetermined blending modes and opacities)

  • November 15, 2018
  • 1 reply
  • 1594 views

Hi, first time trying photoshop scripting.  I'm at a new job doing renders and really frequently I have to manually replace the contents of a lot of smart layers to use different images with the same blending mode and opacity. 

There's 2 ways I can think to simplify this:

a) Is there any way for a script to replace this smart objects contents with other files? Maybe using the base name and then replacing, something like

replacing render1 with render2, so it would replace render1.alpha for render2.alpha, render1.shadows for render2.shadows, etc

alternatively

b) A script that loads a series of files as smart objects with predetermined blending modes and opacities, like a template for loading the render elements.

I don't know if any of those 2 are possible, but if anyone can help me with either it would change my workflow greatly.

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
November 16, 2018

Scripts can replace the content if Smart Object Layers.  However  the replacement object must be exactly the same size object as the object in the template document exactly the same Aspect Ratio and resolution.   All Smart Object Layers have an associated transform whish is not replace or changed when the smart object later content is replaced.   If the replacement is not exactly the same sized as the object in the template the transform will not work correctly.

When you replace the content of a smart object layer I would think that the Smart Object layers Opacity and Blending mode would not be change like the layers associated transform is not changed.  However the Layers rendered pixel opacity  their transparency can change when objects are image files and the file format  support transparent like layered and png files.

I do not know for sure for I do replace smart object layers object populating templates.   I did not want my scripts to be restricted to same size object images files.   My script instead Place in Images files  then transform the layer to size and mask the smart object layer to shape.

JJMack