Skip to main content
Known Participant
November 9, 2019
Answered

Possible Bug in getMGTComponent()?

  • November 9, 2019
  • 1 reply
  • 1070 views

I'm re-writing this post (and re-phrasing the title) because my earlier post was marked as spam, I've not heard back as to why, and I'm trying to complete a project I'm working on.

 

I've tested the following code with both an .mogrt that I created and a stock .mogrt from the Essential Graphics panel. With each one the .getMGTComponent() does not return the collection/array of components expected:

 

var oAS = app.project.activeSequence;
var oVtrks = app.project.activeSequence.videoTracks; //V1, V2
var oVCSTwo = oTrks[1].clips; //we want V2
var oAtrks = app.project.activeSequence.audioTracks; //A1, A2, A3
var oACSOne = oAtrks[0].clips; //we want A1

var markers = []; //empty array
for (var i=0; i < oACSOne.numItems; i++){markers.push(oACSOne[i].projectItem.getMarkers());}
var mkOne = markers[0].getFirstMarker(); // get 1st audio marker

//mogrt import params
var tTime = mkOne.start.ticks;
var vTS = mkOne.start.seconds;
var aTS = mkOne.start.seconds;
var mgrt = new File(File.encode("C:\\Program Files\\Adobe\\Adobe Premiere Pro CC 2019\\Essential Graphics\\Basic Title.mogrt"));

// import clobbers V1 if not locked
if (!(oVtrks[0].isLocked())){
    oVtrks[0].setLocked();}

oTrkItem = oAS.importMGT(mgrt.fsName, tTime, vTS, aTS); //import mogrt
var oMC = oTrkItem.getMGTComponent();

 

There is a workaround, but it means writing six additional lines of code and I've not been able to successfully set the .mogrt text using it.  Is there something I'm missing?  

EDIT:  I re-tested after upgrading to the latest PPro version and the problem persists.

This topic has been closed for replies.
Correct answer Bruce Bullis

Bizarre; they work correctly with importMGT, today, at dozens of broadcasters. 

 

Please provide the actual .mogrt in use, your code, and (important!) step-by-step instructions on how to reproduce the behavior. [mailto: b b b at adobe dot com]

1 reply

Bruce Bullis
Community Manager
Community Manager
November 13, 2019

Try a .mogrt created in PPro...?

daviscydAuthor
Known Participant
November 15, 2019

I did (see first post) and I got the same results.

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
November 15, 2019

Bizarre; they work correctly with importMGT, today, at dozens of broadcasters. 

 

Please provide the actual .mogrt in use, your code, and (important!) step-by-step instructions on how to reproduce the behavior. [mailto: b b b at adobe dot com]