bodymovin / lottie-api

A library to edit lottie-web animations dynamically
MIT License
181 stars 38 forks source link

Fails to find Keypath #28

Open martirius opened 3 years ago

martirius commented 3 years ago

Hi @bodymovin , we are trying to add a valueCallback to our animation to change color of a gradient fill.

This is our animation : animation

What we tried:

var property = animationAPI.getKeyPath("COCKTAIL_STANDARD,Group 1,Gradient Fill 1")
animationAPI.addValueCallback(property, function(currentValue) {
        console.log("Current Value -", currentValue)
        return [0.1, 0.2, 0.3, 1]
    })

We noticed that the callback is never called, investigating the functiong getKeypath it seems that it can't find the childs of the first Keypath.

Can you please help us? Thanks