Page 1 of 1

replacing footage breaks expressions

Posted: September 21st, 2007, 1:20 pm
by yuppster
I've got a script that replaces footage files. The problem is that I've got expressions linked to those initial footage files and when they are replaced, the expressions break. The expression gets the footage's duration this: footage("video.mov").duration

I thought the newly discovered "autoFixExpressions" might work to fix it, but like nab, I couldn't get it to work. Any ideas?

Posted: September 21st, 2007, 2:05 pm
by yuppster
Hmm replaceSource() and it's fixExpressions parameter might work, but I don't have CS3...

Posted: September 24th, 2007, 5:45 am
by Atomic
You could also try wrapping your expressoin in a try-catch. That way when the duration parameter becomes un available, it will simply go to the catch portion of the expression.

Just guessing, it is worth a try...

Re: replacing footage breaks expressions

Posted: September 27th, 2007, 10:48 pm
by redefinery
yuppster wrote:I've got a script that replaces footage files. The problem is that I've got expressions linked to those initial footage files and when they are replaced, the expressions break. The expression gets the footage's duration this: footage("video.mov").duration
autoFixExpressions() should work if it's a change by your script that causes expressions to break. it seems to work for me for the test i tried, which was a n expression on a layer property that referenced a footage item's duration (such as what you described; named "Bear.wmv" in the example below). doing the following code to replace the footage and auto-fix the expresisons worked:

app.project.item(1).replace(new File("/c/Users/Public/Videos/Sample Videos/Butterfly.wmv"));
app.project.autoFixExpressions("Bear.wmv", "Butterfly.wmv");

if you are still having trouble, please submit a bug report to the After Effects team. you can use the following form:
http://www.adobe.com/cfusion/mmform/ind ... product=57

thanks,
:jeff