alexzhirkevich / compottie

Compose Multiplatform Adobe After Effects Bodymovin (Lottie) animations rendering engine
MIT License
131 stars 2 forks source link

Support foreach dynamic properties manipulation #9

Open Vaibhav2002 opened 2 weeks ago

Vaibhav2002 commented 2 weeks ago

What happened?

Changing color using dynamic properties is not working

This is how i did previously in lottie-android

rememberLottieDynamicProperties(
    rememberLottieDynamicProperty(
        property = LottieProperty.COLOR,
        value = color.toArgb(),
        keyPath = listOf("Layer 1 Outlines 2", "**").toTypedArray()
    )
)

This is how I'm doing it in compottie

rememberLottieDynamicProperties {
    shapeLayer("Layer 1 Outlines 2") {
        fill("**") { color { color } }
    }
}

What Compottie version do you experience the bug on?

2.0.0-beta01

What platforms are you seeing the problem on?

Android, iOS

Does Compottie log anythyng to the stdout / your logger set with Compottie.logger?

No response

alexzhirkevich commented 2 weeks ago

There is no support for ** currently. Only named fills

Vaibhav2002 commented 2 weeks ago

@alexzhirkevich I tried this

layer("Layer 1 Outlines 2") {
    shapeLayer("Group 1"){
        fill("Fill 1") { color { color } }
    }
}

for animation verified.json

But it still did not work

alexzhirkevich commented 2 weeks ago

It must be

rememberLottieDynamicProperties {
    shapeLayer("Layer 1 Outlines 2") {
        fill("Group 1", "Fill 1") { color { Color.Red } }
    }
}
alexzhirkevich commented 2 weeks ago

layer(path) is a path to the layer fill(path) is a path to the fill shape relative to the layer

Vaibhav2002 commented 2 weeks ago

Thanks a lot, this did work Would appreciate some documentation on using dynamic properties in Compottie