controlling Puppet tool with script ?

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
jm16000
Posts: 4
Joined: April 15th, 2011, 1:31 am

Hello,

I have to use Puppet tools on hundred of pictures... but always with the same parameters.
If I just replace the picture, the Puppet screw up..

It would take days to make each Puppet "by hand" on every pictures... So I try to make a script which could create a Puppet effect with Puppet Pins placed in some coordonates and parameters...

Do you think it's possible ?
I don't find the script command to create Puppet or Pins

Thanks :)
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

I don't think you'll have any luck with this. My suggestion would be to try applying the puppet to a precomp (start with a fully opaque layer so it creates a mesh across the whole frame) then make duplicate precomps and replace the still image inside it.

One problem with scripts trying to create pins is that it doesn't let you set the pin position at the point when you create it, and with PP the initial pin location is important. I've tried this in the past and given up. But if you're curious, here's some example code which shows what you'd have to do to add a Puppet effect and Pin:

Code: Select all

var selectedLayer = app.project.activeItem.selectedLayers[0];

var puppetEffect = selectedLayer.Effects.addProperty("ADBE FreePin3");
var ARAPGroup = puppetEffect.property("ADBE FreePin3 ARAP Group");
var meshGroup = ARAPGroup.property("ADBE FreePin3 Mesh Group");
var meshAtom = meshGroup.addProperty("ADBE FreePin3 Mesh Atom");
var posPins = meshAtom.property("ADBE FreePin3 PosPins");
var pinAtom = posPins.addProperty("ADBE FreePin3 PosPin Atom");
var thePin = pinAtom.property(3);

alert(thePin.value.toString());
jm16000
Posts: 4
Joined: April 15th, 2011, 1:31 am

Thanks a lot Paul! :)
I think I can manage my project with the precomp method (but thanks for the script too)
Post Reply