Skip to content

Conversation

@samuelOsborne
Copy link
Member

@samuelOsborne samuelOsborne commented Dec 6, 2025

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:

  • dotlottie-rs/src/global_inputs_engine/[type]_path.rs

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 ResolvedThemeBinding objects so that the slot API can be called directly when a global input changes value.

  • dotlottie-rs/src/global_inputs_engine/mod.rs

Main entry for the global inputs engine.

  • Changes to dotlottie-rs/src/dotlottie_player.rs

DotLottiePlayerContainer was given control of the GlobalInputsEngine. This was so that it could access the StateMachineEngine to modify its inputs as well as get access to the LottieRenderer from the Runtime.

Notes: gradient_animated_global_input_test is currently ignored due to the test being flaky, gradients are available as a demo and work correctly

@changeset-bot
Copy link

changeset-bot bot commented Dec 6, 2025

⚠️ No Changeset found

Latest commit: abfdceb

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@github-actions
Copy link
Contributor

github-actions bot commented Dec 6, 2025

📊 Benchmark Results

dotlottie-rs

Benchmark Change Confidence Interval Status
animation_loop_frame_interpolation +1.89% [-0.85%, +4.64%] ✅ No change
load_dotlottie_data +0.72% [+0.17%, +1.31%] ✅ No change
load_animation_data +0.29% [-1.88%, +1.56%] ✅ No change
animation_loop_no_frame_interpolation +0.24% [-2.42%, +2.89%] ✅ No change
set_theme -0.03% [-0.15%, +0.07%] ✅ No change
state_machine_load_data -0.48% [-0.76%, -0.01%] ✅ No change
state_machine_load -0.49% [-0.89%, -0.09%] ✅ No change
load_animation_path -0.53% [-0.89%, -0.07%] ✅ No change
How to interpret these results
  • Change: Estimated performance difference (negative = faster, positive = slower)
  • Confidence Interval: 95% confidence bounds for the change
  • Regression: Lower bound > +5% (confidently slower)
  • Improvement: Upper bound < -5% (confidently faster)

Criterion uses statistical analysis to account for noise and provide reliable comparisons.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant