Copy Footage Source and replace

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
JohnBoy
Posts: 2
Joined: May 19th, 2006, 4:01 am
Location: UK

I have a script that is running through a composition firstly replacing text in certain layers (Thanks to Dan Ebberts). I now want to be able to replace the image in that comp. The only way I have found to do this is to use the FootageItem replace() method.

The problem I have is that I don't want to lose the original footage item as I need to put this in a while loop and keep going replacing with a different graphic on each one.

Is there a way to easily create a copy of a footage item (I am using a tiff) without losing the original?

Thanks in advance

John Williamson
User avatar
redefinery
Posts: 112
Joined: April 1st, 2005, 8:16 pm
Location: CA
Contact:

Hi JohnBoy,

For disk-based footage items, I suppose you can re-import the file using app.project.importFile(), using the footage item's file.fsName or file.fullName value. Of course, you'd have to re-apply any footage item settings (e.g., Interpret Footage type of stuff).

Jeff
JohnBoy
Posts: 2
Joined: May 19th, 2006, 4:01 am
Location: UK

Thanks Jeff,

My problem is that the graphics designer needs to do a replace() on the footage item so that in the comp the layer retains all settings , effects and transforms that are already there.

so far I have got to this point.

Code: Select all

var afile = myFile.readln(); //read the file path from my text file

//import the file into the project
var tempavitem = app.project.importFile(new ImportOptions(File(afile)));

//replace the file being used in the comp
app.project.item(3).replace(File (afile));
My problem is that without the replace method, the the image file is never updated in the comp, but with the replace, the original comp that I duplicated also points to the new image whereas I want to retain an individual image in each new duplicated comp.

Would be very easy to do outside of script. just import a new image and alt and drag over the image file.

Thanks
Post Reply