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

Mogrt set text quirks in Extendscript

Community Beginner ,
Apr 29, 2020 Apr 29, 2020

Copy link to clipboard

Copied

This is a continuation of my last question Mogrt getValue returns JSON in Extendscript  

 

Although I was succesfull in setting a new text into the Mogrt template I have noticed a quirk.

 

The Mogrt template I created in Premier Pro was a simple text with a rectagle background, the text had the string "This is a sample test" in it.  The string length is 21 characters.

 

In extendscript I load the template onto the timeline using "seq.importMGT()".

 

However I noticed that if I set a new text into the Mogrt longer than the 21 characters the text just vanishes.

I am able to set texts below the 21 character limit.

I also played around with the "start" and "end" properties of the text component but to no avail.

Is there a way around to this?

I am thing of creating a new template and placing a long string into it, lets say 255 chars that would probably suffice for my needs, hopefull that mitigates this issue.

In the meanwhile I hope the more experienced folks over here share their experiences if any that can resolve this without resorting to a template with extremely long text.

TOPICS
SDK

Views

802

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 , Apr 30, 2020 Apr 30, 2020

There is currently no way to circumvent that limitation, but such circumvention has been requested (DVAPR-4212165); I've added your vote.

Votes

Translate

Translate
Community Beginner ,
Apr 29, 2020 Apr 29, 2020

Copy link to clipboard

Copied

So I did a test, with another template, I created a new Mogrt and add a text into it with around 255 characters. Now I save this as a template. And I can use strings as long as 255 characters to set new text into it.

This seems to work for now, but just wondering what the character limit is for and whether we can send some commands to the Mogrt to circumvent it.

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 ,
Apr 30, 2020 Apr 30, 2020

Copy link to clipboard

Copied

There is currently no way to circumvent that limitation, but such circumvention has been requested (DVAPR-4212165); I've added your vote.

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
Community Beginner ,
Mar 14, 2024 Mar 14, 2024

Copy link to clipboard

Copied

hellow sir i am also going through the same issue and found that you have found a workaround for setting text to mogart created in premere pro , as i am a non coder but have a bit of knowledge of runing scripts via vscode - can you help me debuging  this script as it  is giving me error "21 null is not an object"  = 

var seq = app.project.activeSequence;
var jsonVal = seq.videoTracks[0].clips[0].components[2].properties.getParamForDisplayName("Source Text").getValue();
var jsonObjPart = jsonVal.substring(0, 4);
var jsonObj = JSON.parse(jsonVal.substring(4));
jsonObj.mTextParam.mStyleSheet.mText = "This is a new text";
var jsonOutstr = JSON.stringify(jsonObj);
var jsonOutstr = jsonObjPart + jsonOutstr;
seq.videoTracks[0].clips[0].components[2].properties.getParamForDisplayName("Source Text").setValue(jsonOutstr, true);
 

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
Community Beginner ,
Mar 14, 2024 Mar 14, 2024

Copy link to clipboard

Copied

var seq = app.project.activeSequence;
var jsonVal = seq.videoTracks[0].clips[0].components[2].properties.getParamForDisplayName("Source Text").getValue();
var jsonObjPart = jsonVal.substring(0, 4);
var jsonObj = JSON.parse(jsonVal.substring(4));
jsonObj.mTextParam.mStyleSheet.mText = "This is a new text";
var jsonOutstr = JSON.stringify(jsonObj);
var jsonOutstr = jsonObjPart + jsonOutstr;
seq.videoTracks[0].clips[0].components[2].properties.getParamForDisplayName("Source Text").setValue(jsonOutstr, true);

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 14, 2024 Mar 14, 2024

Copy link to clipboard

Copied

LATEST

Manipulation of a .mogrt's JSON is completely unsupported, and not recommended.

Which line in that code, results in the error?

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