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

Problems to parse multiline text from MOGRT in PPRO 24

Explorer ,
Dec 14, 2023 Dec 14, 2023

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.

TOPICS
SDK
949
Translate
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 , Dec 15, 2023 Dec 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. 🙂

Translate
Explorer ,
Dec 14, 2023 Dec 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.

Translate
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 ,
Dec 15, 2023 Dec 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. 🙂

Translate
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
Explorer ,
Dec 17, 2023 Dec 17, 2023

that's great. And it works.
But now how do I change the font size or the font itself?

Translate
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 ,
Dec 18, 2023 Dec 18, 2023

If those were exposed as adjustable parameters by the .mogrt creator, then those component streams can be manipulated using PPro's API.

Translate
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
Explorer ,
Dec 18, 2023 Dec 18, 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('"', ''));

 

Translate
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 ,
Dec 19, 2023 Dec 19, 2023

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.]

Translate
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
Explorer ,
Dec 21, 2023 Dec 21, 2023
LATEST

I created the Mogrt, I know all the editable parameters. So the text is editable and I can change font size and font itself. but now I can't understand how to change font size and font itself without parsing.

Translate
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