Creative COW SIGN IN :: SPONSORS :: ADVERTISING :: ABOUT US :: CONTACT US :: FAQ
Creative COW's LinkedIn GroupCreative COW's Facebook PageCreative COW on TwitterCreative COW's Google+ PageCreative COW on YouTube
ADOBE AFTER EFFECTS:HomeForumBasicsExpressionsTutorialsPodcastsAE TechniquesCreative Cloud DebateFAQ

Speeding up a process via scripting

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook
Gary NodenSpeeding up a process via scripting
by on Apr 11, 2012 at 1:14:17 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.


Return to posts index
Reply   Like  

Dan EbbertsRe: Speeding up a process via scripting
by on Apr 12, 2012 at 1:57:09 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



Return to posts index
Reply   Like  

Gary NodenRe: Speeding up a process via scripting
by on Apr 12, 2012 at 2:12:24 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


Return to posts index
Reply   Like  


Dan EbbertsRe: Speeding up a process via scripting
by on Apr 12, 2012 at 2:48:46 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



Return to posts index
Reply   Like  

Gary NodenRe: Speeding up a process via scripting
by on Apr 12, 2012 at 3:49:43 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


Return to posts index
Reply   Like  

Dan EbbertsRe: Speeding up a process via scripting
by on Apr 12, 2012 at 4:11:55 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



Return to posts index
Reply   Like  


Gary NodenRe: Speeding up a process via scripting
by on Apr 15, 2012 at 8:16:58 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.


Return to posts index
Reply   Like  

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
Share on Facebook


FORUMSTUTORIALSFEATURESVIDEOSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

Creative COW LinkedIn Group Creative COW Facebook Page Creative COW on Twitter
© 2014 CreativeCOW.net All rights are reserved. - Privacy Policy

[Top]