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

1 PreComp with text animation (duplicate multiple time), In a Comp with changed sourceText keyframed

Explorer ,
Mar 10, 2024 Mar 10, 2024

Hi everybody,

 

Hard to explain but very simple:

I made a composition where I animated a text.

I put this Comp in another one. I duplicate it multiple time.

I add a sourceText in it. I change the sourceText during time.

I would like my duplicated comp to change its text too.

 

I have this but it doesn't work:

"

thisCompLayer = comp("CompNAME").layer("LayerNAME");
NewTime = thisCompLayer.time + thisCompLayer.startTime;

comp("CompNAME").layer("SourceTextLayerNAME").text.sourceText.valueAtTime(NewTime)"

TOPICS
Expressions
605
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
Advocate ,
Mar 10, 2024 Mar 10, 2024

 

this expression should be enough:

comp("CompNAME").layer("SourceTextLayerNAME").text.sourceText.valueAtTime(time)

 

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

Thank You for your answer but it doesn't work. I already tried it.

As you can see, the PreComp is duplicated several times and shifted in time.

The Source Text is keyframed.

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
Advocate ,
Mar 11, 2024 Mar 11, 2024

You must name things correctly.

screenshot.png

 

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

I got you. I made this screenshot to show you the structure of my Comp + Precomp but the names are correct.

With the expression you provided, I have the right text at the beginning but it doesn't change with the keyframes. It keeps the 1st sourceText at frame 0 unfortunately.

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
Advocate ,
Mar 11, 2024 Mar 11, 2024

What's wrong?

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

As you can see I created a PreComp with a text animation.

Then, I put it into another Comp where I created a Text as a source.

I keyframed this text layer to change the sourceText each time the precomp plays.

For example, it says "ONE", then "TWO", then "THREE" etc...I want this text animation to play each time with this new text.

For the moment, I have the text "ONE" but it doesn't change during the animation.

Hard to explain (by being French in addition 😉

 

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
Advocate ,
Mar 11, 2024 Mar 11, 2024

La précomposition 1 doit afficher le mot de l'image clé 1,

La précomposition 2 doit afficher le mot de l'image clé 2

et ainsi de suite?

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

Exactement!!! 

Merci merci merci!!!

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
Advocate ,
Mar 11, 2024 Mar 11, 2024

OK, il faut ajouter cette expression:

// Calque qui a les images clés
target = comp('Main Composition').layer(1).text.sourceText;
// Pour cibler la composition dupliquée
precomp = comp('Main Composition').layer(thisComp.name);

target.valueAtTime(precomp.startTime)

dupliquer la composition dans le project panel pour que les compositions aient des noms uniques.

 

screenshot.png

 

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

Merci pour ta réponse, elle règle un des problèmes. En revanche, si je dois dupliquer la preComp, alors cela entame l'intérêt de créer ce genre d'expression. D'après toi, il est impossible donc de créer une expression qui permettrait d'obtenir le résultat souhaité sans avoir à créer de multiples PreComp? 

Merci encore pour ton aide!

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
Advocate ,
Mar 12, 2024 Mar 12, 2024

Bah ouais, si dans ta précomp, tu as juste un calque de texte animé, ça ne sert à rien d'utiliser une précomp, tu as meilleurs temps de mettre ton calque de texte animé directement dans ta composition principale et d'y mettre une expression du genre:

 

// Calque qui a les images clés
target = thisComp.layer(1).text.sourceText;
target.valueAtTime(startTime)

Et ensuite, tu dupliques ton calque à volonté.

 

Sinon, si tu ne veux pas t'emmerder à aligner tes calques dans la timeline, tu peux nommer tes calques de texte (1, 2, 3, 4, 5....) et ensuite utiliser le nom des calques pour l'affecter à une image clé:

// Calque qui a les images clés
target = thisComp.layer(1).text.sourceText;
target.key(name).value

 

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 ,
Mar 18, 2024 Mar 18, 2024
LATEST

Top! Merciiiii'

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