Skip to content

Conversation

@g-k-s-03
Copy link

@g-k-s-03 g-k-s-03 commented Oct 16, 2025

Fixes #9179 – Implements Multi-Stage Interpolation Chains with Blend Modes

This PR extends Kivy’s Animation system by adding support for multi-stage interpolation chains with configurable blend modes. Previously, Animation only supported single transition functions, which limited complex motion sequences.

Key Changes:

New Methods:

  • chain_interpolators(interpolators, weights=None, blend_mode='linear') → creates a callable for multiple transitions.
  • get_chain_value(progress, interpolators, blend_mode='linear') → evaluates the chain at any progress.
  • validate_chain(interpolators) → validates chain structure, detecting gaps, overlaps, and invalid transitions.

Blend Modes Implemented: linear, weighted, multiplicative, overlay, screen.

Features:

  • Supports chaining of easing functions like elastic, bounce, cubic, sine, quad, etc.
  • Properly clamps progress, handles empty chains, and ensures segment continuity.

Behavior:

  • Complex animations can now be defined by sequencing multiple easing functions with offsets and blending.
  • Gaps in the chain raise ValueError; overlaps use the first matching range.
  • Weighted blending validates that weights sum to 1.0.

Testing:

Added unit tests for:

  • Valid and invalid chains
  • Each blend mode
  • Edge cases for progress outside [0,1]
  • Empty chains

Documentation:

  • Docstrings added for all new functions.
  • Examples provided in Animation docstring.

Maintainer Merge Checklist:

  • Title is descriptive/clear for inclusion in release notes.
  • Applied a Component: Animation label.
  • Applied the api-deprecation or api-break label.
  • Applied the release-highlight label to be highlighted in release notes.
  • Added to the milestone version it was merged into.

@welcome
Copy link

welcome bot commented Oct 16, 2025

Thanks for opening your first pull request here! 💖 Please check out our contributing guidelines.

@g-k-s-03 g-k-s-03 changed the title mplement Multi-Stage Interpolation Chains with Blend Modes for Kivy Implement Multi-Stage Interpolation Chains with Blend Modes for Kivy Oct 16, 2025
@kuzeyron kuzeyron added Component: core-providers kivy/core Component: core-widget properties, eventdispatcher, widget.py, animation labels Oct 17, 2025
@g-k-s-03
Copy link
Author

@kuzeyron Hi, just checking if you need anything from me to move this forward. Thanks!

@kuzeyron kuzeyron requested a review from misl6 October 23, 2025 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: core-providers kivy/core Component: core-widget properties, eventdispatcher, widget.py, animation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Animation Interpolation Chain with Blend Modes

2 participants