Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Bulk convert expressions into keyframes

Cow Forums : Adobe After Effects Expressions

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Bulk convert expressions into keyframes
by Satya Meka on May 25, 2009 at 9:22:44 pm

Hello,

I have a project with more than 200 layers with a lot of expressions for various transform properties. Is there a way I could convert all the expressions to keyframes at once? (atleast with a script/select all animated properties at a time)

Thank you

regards,
Satya Meka.

Satya Meka,
http://www.gutsblow.com

Respond to this post   •   Return to posts index

Re: Bulk convert expressions into keyframes
by Dan Ebberts on May 26, 2009 at 12:11:32 am

This should get you started. It will convert position, anchorPoint, roation, scale, and opacity expressions to keyframes for each layer in the active comp (if the layer has those properties):


{

function convertToKeyframes(theProperty){
if (theProperty.canSetExpression && theProperty.expressionEnabled){
theProperty.selected = true;
app.executeCommand(app.findMenuCommandId("Convert Expression to Keyframes"));
theProperty.selected = false;
}
}


var myComp = app.project.activeItem;
if (myComp && myComp instanceof CompItem){
var myLayer;
var myProperty;
app.beginUndoGroup("convert expressions");
for (var i = 1; i <= myComp.numLayers; i++){
myLayer = myComp.layer(i);
try{
myProperty = myLayer.property("position");
convertToKeyframes(myProperty);
}catch(err){
}
try{
myProperty = myLayer.property("anchorPoint");
convertToKeyframes(myProperty);
}catch(err){
}
try{
myProperty = myLayer.property("rotation");
convertToKeyframes(myProperty);
}catch(err){
}
try{
myProperty = myLayer.property("scale");
convertToKeyframes(myProperty);
}catch(err){
}
try{
myProperty = myLayer.property("opacity");
convertToKeyframes(myProperty);
}catch(err){
}
}
app.endUndoGroup();
}

}



Dan



Respond to this post   •   Return to posts index

Re: Bulk convert expressions into keyframes
by Satya Meka on May 26, 2009 at 12:24:06 am

Awesome Dan! You just made my day!

Satya Meka,
http://www.gutsblow.com

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]