How do I update multiple smart object layers at the same time
code:
using (PsdImage image = (PsdImage)Image.Load(filePath))
{
for (int i = 0; i < image.Layers.Count(); i++)
{
if (image.Layers[i].GetType().Name.Contains("SmartObjectLayer"))
{
SmartObjectLayer smartObjectLayer = (SmartObjectLayer)image.Layers[i];
smartObjectLayer.ReplaceContents(newContentPath);
}
}
image.Save(pngOutputPath, new PngOptions() { ColorType = PngColorType.TruecolorWithAlpha });
image.Save(psdOutputPath, new PsdOptions(image));
}