Page 1 of 1

Script to replace footage

Posted: November 7th, 2007, 6:05 pm
by philspitler
Hi, I would love a script that can go through an entire project file and replace any QT files with a certain suffix with files with a different suffix.

Ie.

replace shot01_offline.mov with shot01_online.mov

I would love to be able to understand and write this myself but that isn't gonna happen.

Dan gave me a clue that i should use the "replaceSource()" command but i have no idea how to get started.

I would love if somebody could get me started.

Thanks.

Phil

Posted: November 7th, 2007, 9:44 pm
by Dan Ebberts
Hey Phil,

I think the basic flow would go like this:

Loop through the items in the project bin looking for any CompItem.

For each comp, loop through each layer to see if its source is of the type you want to replace.

For each source to be replaced, loop through the items in the project bin looking for the FootageItem with the same source name but with the replacement suffix.

Use sourceReplace() on the layer.

This assumes all your replacement footage is already loaded into the project. If not, there's more work to do. :-)


Dan