Page 1 of 1

Replace to layer in Photoshop file

Posted: Sun Sep 06, 2015 5:21 pm
by ernpchan
Via scripting I can replace an image to a separate file. Is it possible to replace to a layer in a Photoshop file? We can import layered Photoshop files. I'm not seeing a way to manually swap out Photoshop layers.

Re: Replace to layer in Photoshop file

Posted: Sun Sep 06, 2015 8:44 pm
by synthsin75
Check out my old Syn_UpdatePSD script to update a psd import (I haven't used it in ages, so no idea if it works with AS11). http://www.kelleytown.com/forum/animato ... PIC_ID=760

You have to parse the psd to determine the layer IDs and hierarchy, then parse the AS document to match these and change the source image using the ID in the psd (line 147):

moho:LayerAsImage(moho.layer):SetSourceImage(path.."*"..id.."*")

Re: Replace to layer in Photoshop file

Posted: Mon Sep 07, 2015 2:37 am
by ernpchan
Thanks! I'll check it out.

Re: Replace to layer in Photoshop file

Posted: Tue Sep 22, 2015 10:15 pm
by ernpchan
synthsin75 wrote:Check out my old Syn_UpdatePSD script to update a psd import (I haven't used it in ages, so no idea if it works with AS11). http://www.kelleytown.com/forum/animato ... PIC_ID=760

You have to parse the psd to determine the layer IDs and hierarchy, then parse the AS document to match these and change the source image using the ID in the psd (line 147):

moho:LayerAsImage(moho.layer):SetSourceImage(path.."*"..id.."*")
Is there a way to get access to this script without having to register with another forum?

Re: Replace to layer in Photoshop file

Posted: Tue Sep 22, 2015 11:53 pm
by synthsin75
Nope, but registration's free and many more scripts are only found there.

Re: Replace to layer in Photoshop file

Posted: Wed Sep 23, 2015 2:08 am
by ernpchan
synthsin75 wrote:Nope, but registration's free and many more scripts are only found there.
Ok, I'll join that forum too.

Just curious but what's the difference between that one and this one?

Re: Replace to layer in Photoshop file

Posted: Wed Sep 23, 2015 3:52 am
by synthsin75
Smaller, more active scripters.