Referencing image sequence filenames from ae script
Posted: November 11th, 2008, 1:16 pm
Specifically what I'm trying to do is this: I have some heinous renders and we are doing multiple machine rendering. Let's say one of the machine glitches and I have a large number of bad frames. It would be faster to identify them by hand than to rerender the whole thing. So here is my plan:
1 ) bring an image sequence into a new comp.
2 ) scrub through the image sequence and add markers
3 ) have AE delete marked frames from the footage directory
4 ) fix the error and rerender the missing frames to the footage dir
I've accomplished this with a couple of hacks. It requires the target layer to be selected and to have markers. my method is to create an empty text layer, and add an expression with timeToFrames onto the sourceText property. I loop through the markers and use the timeToFrames layer to populate the list of frame #'s. I then move up the footage tree to obtain the source name. I chop up the source name to remove existing number and image suffix, then use that plus the text layer sourceText to construct all the relevant filenames.
The 2 things I can't figure out:
a) how to avoid "hard coding" the starting frame # in the script (my sequence starts at mySeq_[00447-04210]) for example. I think this could be detected with some serious regex skill but I'm not up to it. To make things worse, we usually have numerical dates in our filenames so it'd be more like mySeq_111208_00447.png
b) how to loop through the folder and delete the named files in a script. I've already gotten it working in a hacky way by outputting a huge boolean search string:
which I can then feed into spotlight and delete the files, which is slow and involves an extra step. Not to mention spotlight is not the most reliable technology. Any clues on how to do this in jsx?
If I can get this fixed up and reliable I'll add error checking and all the nice stuff and post it.
Regards,
Andrew
1 ) bring an image sequence into a new comp.
2 ) scrub through the image sequence and add markers
3 ) have AE delete marked frames from the footage directory
4 ) fix the error and rerender the missing frames to the footage dir
I've accomplished this with a couple of hacks. It requires the target layer to be selected and to have markers. my method is to create an empty text layer, and add an expression with timeToFrames onto the sourceText property. I loop through the markers and use the timeToFrames layer to populate the list of frame #'s. I then move up the footage tree to obtain the source name. I chop up the source name to remove existing number and image suffix, then use that plus the text layer sourceText to construct all the relevant filenames.
The 2 things I can't figure out:
a) how to avoid "hard coding" the starting frame # in the script (my sequence starts at mySeq_[00447-04210]) for example. I think this could be detected with some serious regex skill but I'm not up to it. To make things worse, we usually have numerical dates in our filenames so it'd be more like mySeq_111208_00447.png
b) how to loop through the folder and delete the named files in a script. I've already gotten it working in a hacky way by outputting a huge boolean search string:
Code: Select all
titles_111008_00448.png OR titles_111008_00643.png OR titles_111008_00644.png ...
If I can get this fixed up and reliable I'll add error checking and all the nice stuff and post it.
Regards,
Andrew