Skip to main content
Inspiring
December 14, 2023
Answered

Problems to parse multiline text from MOGRT in PPRO 24

  • December 14, 2023
  • 1 reply
  • 963 views

Hi.
The following problem has arisen. exactly in version 24 PPRO.
I have a mogrt with text. if the text is 1 line - it parses without problems (JSON.parse() - everything is fine), but if the text is 2 lines (multistring) - the parsing just fails, not even an error. and only a complete reload of Premiere helps.
There were no such problems in version 23.

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

I'm glad you have something working for your purposes, and...

We provide API access to motion graphics template parameters (see PProPanel) because their implementation details will change; the API will continue to work, regardless of those changes. Accessing that data directly instead signs you up to deal with potential breakages, with each new release forever. 🙂

1 reply

Inspiring
December 14, 2023

This will be useless information now, because I don't understand what's going on.
Tried yesterday on 4 different machines, 2 on mac and 2 on vin. on 1 mac only started everything without problems, in other cases not.
After a bunch of possible variations, where I just tried replacing slashes with something else and back again, I somehow still got it to start on another mac. and today I came to try on the same mac and... no. More errors.

Bruce Bullis
Community Manager
Bruce BullisCommunity ManagerCorrect answer
Community Manager
December 15, 2023

I'm glad you have something working for your purposes, and...

We provide API access to motion graphics template parameters (see PProPanel) because their implementation details will change; the API will continue to work, regardless of those changes. Accessing that data directly instead signs you up to deal with potential breakages, with each new release forever. 🙂

Bruce Bullis
Community Manager
Community Manager
December 19, 2023

Still don't get it. i've tried seemingly every option except parsing.
I have mogrt, editable text and font parameters. how do I change its size through a script?

 

var newObjText = JSON.stringify(newObjText, null, 2);
var grafMGT = mogrt.getMGTComponent(); 
var mogrtText = grafMGT.properties[0];
var getVal = mogrtText.getValue();

// getVal.fontSizeEditValue = [mogrtTextSize];
// mogrtText.fontSizeEditValue = [mogrtTextSize];
// getVal.fontSizeEditValue.setValue([mogrtTextSize], true);
// mogrtText.fontSizeEditValue.setValue([mogrtTextSize], true);
// getVal.fontSizeEditValue.setValue(mogrtTextSize, true);
// mogrtText.fontSizeEditValue.setValue(mogrtTextSize, true);
// getVal.fontSizeEditValue.setValue(mogrtTextSize);
// mogrtText.fontSizeEditValue.setValue(mogrtTextSize);

mogrtText.setValue(newObjText.replace('"', ''));

 


You would find the component parameter stream that corresponds to the font size, and modify that. 

 

[Again, there's no guarantee that the .mogrt creator exposed font size as an editable parameter; if they had, that's how you'd access and modify it.]