Add two layers in the same expression?

Community Beginner ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

Hello everyone! I would like to know if it is possible to add two layers in the same expression. When I put this value, it tells me that there is an error:

s=thisComp.layer("example 1")+thisComp.layer("example2")

In fact, I have created a shape whose size changes according to the size of the text. But as the composition is intended for a .mogrt file, I would like to have two different fonts in this shape and that they are modifiable.

Is this possible?

Thanks a lot!

Capture d’écran 2022-01-20 à 11.34.10.png

TOPICS
Error or problem , Expressions

Views

51

Likes

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 Community Professional ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

That makes no sense and you have your logic backwards. Expressions can't even modify the pixel content of a layer, so what you want to do would never work. In your example that wouldn't be needed, anyway. You simply re-use your existing code for the size of the box and add it to the X position of the second layer.

 

Mylenium

Likes

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 ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

Thank you for your answer! I will try this

Likes

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 Community Professional ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

You cannot combine more than one font into a single Text Layer if you intend to send this out to PPro as a MoGRT. You'll have to combine two Text Layersl; each with its own font. HTH

Motion Graphics Brand Guidelines & Motion Graphics Responsive Design Toolkits

Likes

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 ,
Jan 20, 2022 Jan 20, 2022

Copy link to clipboard

Copied

LATEST

Thank you for your answer! I'll do it differently then

Likes

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