Ben Forder
Forum Replies Created
-
I should add, I couldn’t get the workspace duration to work, it would always just try and ram preview the whole 10 minutes of my comps, so I made two little 3 frame duration comps and used the keyframe converter on them, then just got the script to read the results and copy the values to the same properties of the actual longer footage.
-
actually, it worked!!! Thanks so much! Probably because the layer I’m referring to is always the first layer in the comp, it seems to be selected anyway, and I can target any property in it. I attached the bit of the code i used, and part of what I did with it in case anyone stumbling across this thread finds it useful (the whole thing seemed a bit too long, and none of the comp names I’m using probably make any sense anyway!)
app.beginUndoGroup("PleaseBloodyWork");// dan ebberts wrote this function
function convertToKeyframes(theProperty)
{
if ((theProperty.canSetExpression) && (theProperty.expressionEnabled))
{
theProperty.selected = true;
app.executeCommand(app.findMenuCommandId("Convert Expression to Keyframes"));
theProperty.selected = false;
}
}// Convert the expressions to keyframes on the short dummy footage
var presenterComp = app.project.item(2).layer(1);
var ramPresenterComp = app.project.item(2);
var positionerComp = app.project.item(3).layer(1);
var ramPositionerComp = app.project.item(3);
var anchorTarget = presenterComp.property("anchorPoint");
var scaleTarget = presenterComp.property("scale");
var positionTarget = positionerComp.property("position");
ramPositionerComp.ramPreviewTest("",1.0,"");
convertToKeyframes(positionTarget);
ramPresenterComp.ramPreviewTest("",1.0,"");
convertToKeyframes(anchorTarget);
convertToKeyframes(scaleTarget); -
Thanks! I’ll give it a try, even if it doesn’t work, a secret hack is kind of exciting anyway (in a very nerdy way) 😀
-
Hi,
That’s really useful, thanks for posting that. I’m having a problem though – I need to convert expressions to keyframes from more than one comp, all in the same script which is running completely automated inside a programme that opens and shuts after effects automatically with no person there to select a comp for it to work on…Do you know of any way to get a script to select a certain comp as the active comp so that the “convert expression to keyframes” command will work? It only seems to do it if the property or layer to be converted is selected with the mouse first.
Or, if that’s not possible, is there any way a script can look at the output of an expression and use that data to do other things?
Thanks for your time!
-
Ben Forder
February 16, 2011 at 12:25 pm in reply to: Accessing the result of an expression after it’s stoppedThanks for replying so quickly Dan, I appreciate your time.
That’s a shame, not being able to pass data from frame to frame makes what I’m doing quite hard then, but it’s good to know that limitation so I don’t keep banging my head against the wall.
I tried converting it to keyframes, but it still has to do it for every single frame, so it won’t really speed things up when I’m doing massive automated batches in aerender.I’m going to try one last thing before I give up and just let it take hours to render every day. I thought maybe if I apply the expression to a single frame copy of the layer and write the results of the expression to a text file, then maybe the longer version of the layer can just read the values out of the text file, so it doesn’t reprocess the calculations each frame… I’m not sure if that’s even possible, I’m only just starting to teach myself javascript (mostly through creative cow!!)
-
Hi Vince, Thanks for posting that solution, I had the same problem with the audio just disappearing at a certain point in the clip, and had no idea I’d clicked on it while conforming. The adobe help site was useless as usual!
I just wanted to add one more thing that I had to do before the audio came back: I deleted those cache files like you said, but it still didn’t work until I also went to the folder that all my video files were, and deleted the .xmp data files too, then it all reconformed perfectly.
Thanks!