Replace to layer in Photoshop file

Moho allows users to write new tools and plugins. Discuss scripting ideas and problems here.

Moderators: Víctor Paredes, Belgarath, slowtiger

Post Reply
ernpchan
Posts: 154
Joined: Thu Aug 13, 2015 7:18 pm
Contact:

Replace to layer in Photoshop file

Post 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.
My opinions and comments do not represent those of my employer.
http://www.ernestpchan.com
http://www.zazzle.com/gopuggo
User avatar
synthsin75
Posts: 9964
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Replace to layer in Photoshop file

Post 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.."*")
ernpchan
Posts: 154
Joined: Thu Aug 13, 2015 7:18 pm
Contact:

Re: Replace to layer in Photoshop file

Post by ernpchan »

Thanks! I'll check it out.
My opinions and comments do not represent those of my employer.
http://www.ernestpchan.com
http://www.zazzle.com/gopuggo
ernpchan
Posts: 154
Joined: Thu Aug 13, 2015 7:18 pm
Contact:

Re: Replace to layer in Photoshop file

Post 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?
My opinions and comments do not represent those of my employer.
http://www.ernestpchan.com
http://www.zazzle.com/gopuggo
User avatar
synthsin75
Posts: 9964
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Replace to layer in Photoshop file

Post by synthsin75 »

Nope, but registration's free and many more scripts are only found there.
ernpchan
Posts: 154
Joined: Thu Aug 13, 2015 7:18 pm
Contact:

Re: Replace to layer in Photoshop file

Post 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?
My opinions and comments do not represent those of my employer.
http://www.ernestpchan.com
http://www.zazzle.com/gopuggo
User avatar
synthsin75
Posts: 9964
Joined: Mon Jan 14, 2008 11:20 pm
Location: Oklahoma
Contact:

Re: Replace to layer in Photoshop file

Post by synthsin75 »

Smaller, more active scripters.
Post Reply