How to apply Puppet Warp programmatically(via Photoshop Scripting or C++ plugins)?
Copy link to clipboard
Copied
Hello Everyone,
I would like to know how can we apply Puppet Warp programmatically on TIFF images. I'd prefer Photoshop Scripting(Javascript) but also open to C++ plugin.
My requirement is to apply the Puppet Warp as Smart Filters on the selected art layer which is already converted to Smart Object. (Please refer to attached image.)
In other words I want to automate the following manual process:
1. User selects Puppet Warp menu item in Edit menu.
2. Modify Puppet Warp parameters by changing Density to More Points, Expansion to 20 px.
3. Placing some anchor points.
4. Pressing Enter key or clicking check button to commit the Puppet Warp.
This way user has option to enable the Puppet Warp mesh and anchor points again by just double clicking the Puppet Warp in Smart Filters in Photoshop's Layers panel. (Please refer to attached image.)
I've tried to achieve this using Photoshop's Actions and also using Photoshop Javascript Listener plugin.
Using Photoshop's Actions, I recorded the action to apply Puppet Warp(creation of mesh and placing some anchor pins) on the selected art layer but the limitation of this is I cannot play this action on other image/layer. And I think the reason for this is the data generated for the various vertices of mesh and anchor pins are specific to the non transparent image pixel data of the selected art layer at the time of recording.
Using Javascript Listener plugin, a gigantic code is generated(approximately 60K LOC) in my case which is extremely difficult to decipher and reverse engineer to make it usable for my purpose. And executing the same generated code has the same limitation as I described here above in case with using Photoshop's Actions.
Any idea/suggestion/solution is highly appreciated. Also let me know if need some more details or something is unclear. And my duck design is copyright protected :).
Thanks and Regards,
Manish S.
Explore related tutorials & articles
Copy link to clipboard
Copied
It's not about your problem. I'm just curious how you define LOC?
Copy link to clipboard
Copied
Yes I should've used 60K lines of code instead of 60K LOC, as the LOC has specific meaning in Software engineering. And in this case its the enormous amount of data that is occupying the majority in that generated code..
Copy link to clipboard
Copied
Lines of Code 😉 Regarding your request, learn Action Manager, perhpas it helps somehow.
Copy link to clipboard
Copied
Thanks for your suggestion but if you meant to learn following from Adobe Photoshop Scripting Guide pdf documentation then I already know these and using these means I need to dive into that Mariana trench like code(or should I've used Lines Of Code 😉 instead of trench).
Anyway, what do you think about the feasibility of my requirement using a C++ plugin for Photoshop?
Copy link to clipboard
Copied
There is also documentation for C++ to make Photoshop plugin, but I never tried it. I don't know how experienced you are, but have you tried to browse this scripting forum to find samples how to use AM for maybe not exact goal you have but something that's close to?
Copy link to clipboard
Copied
I understand your point. I will look into use of Action Manager in that vast code. There is a well known scripting expert like you, named as Xbytor, I've found his comment here: Scripting "Puppet Warp"

