• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

insertMGT inserts mogrts at start of timeline, with no regard for "time" argument.

Contributor ,
Mar 20, 2023 Mar 20, 2023

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

 

TOPICS
Error or problem , SDK

Views

206

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Adobe Employee , Mar 20, 2023 Mar 20, 2023

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);



Votes

Translate

Translate
Adobe Employee ,
Mar 20, 2023 Mar 20, 2023

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);



Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Mar 20, 2023 Mar 20, 2023

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe Employee ,
Mar 20, 2023 Mar 20, 2023

Copy link to clipboard

Copied

LATEST

>Is it meant to *only* work when passed ticks?

Yes.


Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines