question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[QUESTION] About templating

See original GitHub issue

Supposed to have a set of AE animations, is there any way to load them a template engine so that expressions can be handled at run time?

According to the docs I could start using TextLayer.updateDocumentData to update the text at run time: https://github.com/airbnb/lottie-web/wiki/TextLayer.updateDocumentData

So assumed to have a text animation, I would use an expression to change the text, while using the same animation template.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

2reactions
loretoparisicommented, Mar 11, 2020

@bodymovin thank you I was thinking to a common parser api to traverse the animationData instead of modifying “by hand”, so that to avoid any possibile typos or unsupported changes for a certain object type, like modifying a TextLayer manually etc.

I will have a look at the api then. In the meanwhile I have put the ongoing project here: https://github.com/loretoparisi/lottie-adobe-after-effects-json-animation

In this example I would like to change animation speed as well:

anim.renderer.elements[0].updateDocumentData({
            t: 'This is keyframe 0', 
            s: 78, 
            fc: Palette.color() 
        }, 0);
        anim.renderer.elements[0].updateDocumentData({
            t: 'This is keyframe 1', 
            s: 78, 
            fc: Palette.color() 
        }, 1);

(https://github.com/loretoparisi/lottie-adobe-after-effects-json-animation/blob/master/js/app.js#L252)

Using the TextLayer.updateDocumentData I can change the keyframes 💯 , but how about other properties, can do this with the lottie-api?

Thank you!

2reactions
bodymovincommented, Mar 11, 2020

Yes, the best approach is to load the animationData, traverse it to find the properties you want to update, and then pass it to lottie. If you want to update the properties after the animation has been loaded, you can use the lottie-api library https://github.com/bodymovin/lottie-api

Read more comments on GitHub >

github_iconTop Results From Across the Web

What are some examples of 'template questions' on Quora?
“Template questions” are not simply a survey question, rather they are a question where the main subject can be replaced by any number...
Read more >
Template Questions - SurveyPlanet
If you are not sure what questions to ask your participants, you can always use our pre-made templates and save time on typing...
Read more >
Question Templates - WebAssign
These templates provide best practice examples of a wide variety of question types and techniques. After you have added the WebAssign templates as...
Read more >
Defining Question Templates - How Can We Help?
Question templates are associated to specific game types and define the following:
Read more >
Customizing Question Attributes and Templates
This page is an overview of how to hide or display attributes and sections in Question types via the init options. There are...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found