Copy link to clipboard
Copied
Hi,
I'm writing a script to automatically replace the footage inside a Premiere timeline with graded versions of the same footage. Problems arise when multiple instances of the same source file are used in the edit and have recieved different color grades: now the script iterates through the timeline, swapping the footage via changeMediaPath() but changing the filepath for EVERY instance of the original clip, leaving all of them looking the same in the timeline.
I tried importing all graded footage into a new bin to be able to have multiple file path references for every grade, but there doesn't seem to be a function within the Premiere API to replace footage from within a bin.
I found the correct function for AfterEffects (replaceSource()), but I need something similiar to work for Premiere, while keeping all effect properties, masks, transforms and so on in place.
Is there any way to achieve this?
P.S.: A way to copy and paste attributes like it is possible in the GUI but via the API would also work, is there something I missed to do this maybe?
Doesn't simple replacement work? the projectItem of a trackItem is a read/write field. 🙂
Copy link to clipboard
Copied
> Problems arise...
What is the problem?
What is your selection criteria, for "trackItems for which I want to replace the source media"?
If you have new rendered media, why not import it as a new projectItem, instead of changing the path (but not the applied footage interpretation) of the previously-existing media?
Copy link to clipboard
Copied
Thank you for your quick reply!
The entire timeline has been roughly conformed in Baselight, graded and rendered as seperate, untrimmed files.
The script is supposed to swap the footage of every clip in the timeline to the newly generated graded media.
Since some original clips are used multiple times (shot-reverse-shot-sequences) and are sometimes graded very differently (flashback sequences, recaps), not all trackItems that stem from the same original clip can remain linked to the same single projectItem with the same mediaPath.
If i imported the folder with the graded footage into a new bin, is there a way to make the clips in the sequences simply point to these different new projectItems without losing all current effect attributes etc of the trackItem?
Thank you for your help and I apologize if my terminology is unclear or if I didn't fully grasp your idea!
Copy link to clipboard
Copied
What tells you which trackItems referring to a given projectItem need to be replaced (with your new media) and which should remain unmodified?
Copy link to clipboard
Copied
Currently, my script checks if a projectItem exists within the newly created bin with the same name as the trackItem. If so, I'd like to switch the pointer to the new projectItem, if not -> continue
Copy link to clipboard
Copied
Confirming: Are you checking the name of the newly-imported media projectItem against the name of each trackItem, OR the name of the projectItem referenced by each trackItem?
If the editor has renamed the trackItem, you don't want to replace it?
Copy link to clipboard
Copied
The current approach is the former. The editor renaming the trackItem would be an issue at this point, that is a good point.
My script checks for multiple instance of the same name within the trackItems and renames the duplicate trackItems in ascending order ("test_clip_1.mov, "test_clip_2.mov"). Baselight names the multiple grades of the same media in the same way, so there should always be a newly imported projectItem corresponding to every trackItem's name.
I'm still working on the intricacies of the trackItem -> new projectItem matching process, but the main holdup for me currently is the simple redirection of a trackItems reference to a new projectItem, since i'm working on a proof-of-concept for my thesis
Copy link to clipboard
Copied
Doesn't simple replacement work? the projectItem of a trackItem is a read/write field. 🙂
Copy link to clipboard
Copied
I was so hung up with finding some method to call that I never thought of just trying that...
Thank you so much, I think this solves it!
Find more inspiration, events, and resources on the new Adobe Community
Explore Now