Copy link to clipboard
Copied
MOGRT inserts at the start of timeline, 0 seconds, despite passing the string (in ticks) of 3 seconds into the time argument. Fwiw, I am using python wrapper package called pymiere and sublime text. In the event this is the issue (and I'm debugging blind), what scenarios *might* cause the importMGT function to fail in this way, and say, default to 0 seconds for the time arg?
Any ideas?
import pymiere
TICKS_PER_SECOND = 254016000000
project = pymiere.objects.app.project
active_sequence = project.activeSequence
timeline_in_Time = pymiere.Time()
timeline_in_Time.ticks = str(3*TICKS_PER_SECOND)
mogrt_file_path = "<path_to_mogrt>"
mgt_clip = active_sequence.importMGT(path=mogrt_file_path,
time=timeline_in_Time.ticks,
videoTrackIndex=1,
audioTrackIndex=0)
Related: does the importMGT documentation need some cleanup? The red text for the function suggests it is a method of the track object, while it is actually a method of the sequence object. ... right?
Follow up: I got it to work. I believe the documentation is wrong. The insertMGT method wants INTEGER SECONDS as an input, *not* STRING TICKS, as indicated in the documentation.
For reference, the docs I am using are here: https://ppro-scripting.docsforadobe.dev/sequence/sequence.html#sequence-importmgt
I'm glad you got it to work, but I'm not sure how you did. 🙂
PProPanel's usage of importMGT() works correctly, when passed ticks.
var newTrackItem = activeSeq.importMGT( mogrtToImport.fsName,
targetTime.ticks,
vidTrackOffset,
audTrackOffset);
Copy link to clipboard
Copied
I'm glad you got it to work, but I'm not sure how you did. 🙂
PProPanel's usage of importMGT() works correctly, when passed ticks.
var newTrackItem = activeSeq.importMGT( mogrtToImport.fsName,
targetTime.ticks,
vidTrackOffset,
audTrackOffset);
Copy link to clipboard
Copied
I see that. Is it meant to *only* work when passed ticks? Because I am now getting as-expected results passing the integer 3. The easy explanation is to chalk it up to Pymiere, but unfortunately, that doesn't get me any closer to understanding.
This now works:
mgt_clip = active_sequence.importMGT(path=mogrt_file_path,
time=3,
videoTrackIndex=1,
audioTrackIndex=0)
Edit: pymiere seems to also "want" ticks too. Strange!
https://github.com/qmasingarbe/pymiere/blob/master/pymiere/objects/premiere_objects.py#L1326
Copy link to clipboard
Copied
>Is it meant to *only* work when passed ticks?
Yes.