replacing footage breaks expressions

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
yuppster
Posts: 16
Joined: March 3rd, 2006, 4:01 pm

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?
Last edited by yuppster on September 21st, 2007, 2:38 pm, edited 1 time in total.
yuppster
Posts: 16
Joined: March 3rd, 2006, 4:01 pm

Hmm replaceSource() and it's fixExpressions parameter might work, but I don't have CS3...
User avatar
Atomic
Posts: 157
Joined: April 30th, 2007, 5:55 am
Location: United States, Ohio

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...
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

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
Post Reply