felippenardi/lottie-react-web

AnimationControl - setting text to text layer

Opened this issue · 1 comments

Hi. First of all thanks for providing a method to change running animations, exactly what I was looking for in react.

What I'm trying to do:
I would like to change the string of a text layer.

What happens:
Just nothing. No error. The animations isnt changing its text.

My code (the important snippets):

import Lottie from 'lottie-react-web';
import anim_CpuUsage from './animations/cpuUsage.json'

// stuff

render() {
    // ...
    <Lottie
        options={{
              loop: true,
              autoplay: true,
              animationData: anim_CpuUsage
            }}
            animationControl={{
              // My AfterEffects layer is called "Layer50"!


              'Layer50,Text,Source Text': "10"               
            }}
          />
   // ...
}

What I've tried:
I tried setting different property paths like

  • 'Layer50,Text,Source Text': "10"
  • 'Layer50,Text,SourceText': "10"
  • 'Layer50,Text,Source_Text': "10"
  • 'Layer50,Text,Source-Text': "10"
  • 'Layer50,Text,Source': "10"
  • 'Layer50,Text,Source,Text': "10"
  • 'Text,Text,Source,Text': "10"
  • 'Layer50,Transform,Position': [10, 10], // For troubleshooting, works! So its about text-layers only

Nothing works.

I would appreciate it if you could tell me the right declaration of a text layers text-property. I have attached my very basic animation (for testing purposes) if that helps in any way.
Thank you very much

animation.zip

Ever figure this out??