Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Speeding up a process via scripting

  • Speeding up a process via scripting

    Posted by Gary Noden on April 11, 2012 at 1:14 pm

    Hi there,

    I was wondering if any scripting guru out there could help me out.

    I want to make a script that will speed up a process of attaching paint clones to tracking attach points, to help clean up reference markers off a character’s face. I’m doing it a lot!

    I know what I want to accomplish, but just have no idea what the scripting syntax would be. I am used to creating intermediate level Maya mel scripts, but am a bit at sea with scripting in After Effects

    All help gratefully received.

    Gary Noden replied 14 years, 1 month ago 2 Members · 6 Replies
  • 6 Replies
  • Dan Ebberts

    April 12, 2012 at 1:57 pm

    The key to scripting something like this is describing your workflow in a way that can be converted to an algorithm that can be scripted. For example, how will the script know which paint clones get attached to which tracking points?

    Dan

  • Gary Noden

    April 12, 2012 at 2:12 pm

    Well, in every instance there are four tracked points that need removing on the character’s face so I’m using an expression which makes clone1’s clone position come from tracker1 trackpoint1 plus its offset and the clone’s position comes from tracker1 trackpoint1

    The expression for clone1’s position is:
    motionTracker(“Tracker 1”) (“Track Point 1”).attachPoint

    The one for the clone source is similar with:
    + motionTracker(“Tracker 1”) (“Track Point 1”).attachPointOffset

    on the end so I can twiddle the source of the clone to not be the dot I am removing.

    I just want a quick way to create and link up the clone’s to the tracking points via a script, as I have so many to do.

    motionTracker("Tracker 1") ("Track Point 1").attachPoint
    motionTracker("Tracker 1") ("Track Point 1").attachPoint
    + motionTracker("Tracker 1") ("Track Point 1").attachPointOffset

  • Dan Ebberts

    April 12, 2012 at 2:48 pm

    I don’t know if it helps, but if there is a one-to-one relationship, you could use the same expression for each clone, calculating the name of the appropriate tracker from the name of the clone brush, like this:

    n = thisProperty.propertyGroup(2).name.split(” “)[1];
    motionTracker(“Tracker 1”) (“Track Point ” + n).attachPoint

    Creating a script that would go through and attach all the clones to corresponding tracking points via expressions wouldn’t be hard to do, just a little time consuming to set up.

    Dan

  • Gary Noden

    April 12, 2012 at 3:49 pm

    Yep, JavaScript is still very new, if not non-existent. 🙂

    Is there a way in After Effects to see code in action as you perform a function like you can with Mel script in Maya?

    I think I’m going to sit down with the scripting stuff from Adobe and start with it’s equivalent to “Hello World”

    Thanks so far, Dan. It’s much appreciated.

    n = thisProperty.propertyGroup(2).name.split(" ")[1];
    motionTracker("Tracker " +n) ("Track Point 1").attachPoint

  • Dan Ebberts

    April 12, 2012 at 4:11 pm

    No, unfortunately there isn’t anything like that in AE. The best you can do is develop/test your code in the ExtendScript editor where you can set breakpoints and examine your variables.

    // Hello World:

    alert(“Hello World”);

    😉

    Dan

  • Gary Noden

    April 15, 2012 at 8:16 am

    lol

    Yep, gotten that far now.

    Actually, I’m getting the hang of it thanks to your website!

    You’re a clever guy

    So, I’ve got the undoGroup, the check for a layer being selected, I can add a paint effect to the layer, but I don’t know how to add a clone stroke.

    I’ll get there.

    Thanks again for your time.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy