-
Notifications
You must be signed in to change notification settings - Fork 18
feat: global inputs #435
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
feat: global inputs #435
Conversation
…dded test fixtures
…obal input read support
|
📊 Benchmark Resultsdotlottie-rs
How to interpret these results
Criterion uses statistical analysis to account for noise and provide reliable comparisons. |
…/dotlottie-rs into global-input-actions
This PR adds "Global Inputs" functionality.
Global inputs allow users to declare variables that are able to map on to theme properties and state machine inputs and are modifiable at runtime. This allows for things like moving layers inside a lottie, changing colors and text dynamically and more. It also allows state machines to directly modify the appearance of animations.
PR points of interest:
Manages the different types available as global inputs as well as how they map to theming properties. For example a Color can replace static and animated Colors, but also replace the Color in a gradient's color stop.
Upon calling global_inputs_load, the global inputs file is parsed and the path property used to create
ResolvedThemeBindingobjects so that the slot API can be called directly when a global input changes value.Main entry for the global inputs engine.
DotLottiePlayerContainerwas given control of theGlobalInputsEngine. This was so that it could access theStateMachineEngineto modify its inputs as well as get access to theLottieRendererfrom theRuntime.Notes:
gradient_animated_global_input_testis currently ignored due to the test being flaky, gradients are available as a demo and work correctly