Skip to content

feat: slots, bezier paths, asset resolver and state machine parity with dotlottie-rs - #155

Merged
theashraf merged 4 commits into
feat/audiofrom
feat/dotlottie-rs-parity
Nov 11, 2026
Merged

theashraf merged 4 commits into
feat/audiofrom
feat/dotlottie-rs-parity

Conversation

@theashraf

@theashraf theashraf commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Stacked on #154. Wraps the parts of the dotlottie-rs C API that Swift could not reach, and moves the core to dotlottie-rs main (e5356051).

Core

  • deps/dotlottie-rs bumped from 02a61130 to e5356051 (feat: state machine override, input reset and input listing in the C API dotlottie-rs#625, which adds state machine override, input reset and input listing to the C API). The xcframeworks are rebuilt with make apple.
  • ThorVG is unchanged at v1.1.3 (ce12cdd0e).
  • The CocoaPods copy under Sources/DotLottieCore/cocoapods is refreshed with ./cocoapods-release.sh. make apple does not update it, so it was still the 02a61130 build and did not export the new state machine functions.
  • The frameworks were built from 1fd64fec, the PR commit before the squash merge. Its tree is identical to e5356051.

New API on DotLottieAnimation

  • Slots: getSlotIds(), getSlotType(slotId:), getSlot(slotId:), getSlots(), setSlot(slotId:json:), resetSlot(slotId:), resetSlots().
  • setBezierPathSlot(slotId:vertices:closed:inTangents:outTangents:): replaces the geometry of a path slot. Nil tangents mean straight segments.
  • State machine: stateMachineOverrideCurrentState(_:immediate:), stateMachineResetInput(key:), stateMachineSetSeed(_:) and stateMachineStatus().
  • Playback: setLoopCount(_:). The bridge had it; the public class could only set the loop count at creation.
  • AnimationConfig.assetResolver: supplies Data for assets the player cannot load itself, such as an image referenced by a remote URL.

Fix: markers()

  • Marker.duration held the marker's end frame, because the C API returns start and end. It now holds end - start.
  • This changes the value for any marker that does not start at frame 0. DotLottiePlayerUIView already computed the end as time + duration, so its marker ranges were too long before and are right now.
  • The existing test only checked a marker starting at 0. It now also checks one starting at frame 22.

Asset resolver notes

  • The core calls it synchronously on the thread that loads or renders.
  • The core can keep calling a replaced resolver until its next load, so DotLottiePlayer keeps every resolver box alive until deinit.
  • It is a property on AnimationConfig rather than an initializer argument, to leave both existing initializers untouched.

Tests

  • SlotsAndAssetResolverTests covers the new calls. swift test: 119 tests, 0 failures, against the rebuilt frameworks.

Not included

Counterparts: LottieFiles/dotlottie-web#997, LottieFiles/dotlottie-android#149.

Bring the Swift API up to the dotlottie-rs C API at 02a61130:

- getSlotIds, getSlotType, getSlot, getSlots, setSlot, resetSlot and
  resetSlots
- setBezierPathSlot
- an assetResolver on AnimationConfig for assets the player cannot load
  itself
- stateMachineSetSeed and stateMachineStatus

No xcframework rebuild: the binaries are already dotlottie-rs 02a61130
with ThorVG v1.1.3.
@changeset-bot

changeset-bot Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 4b8582e

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

The bridge already had it, but the public class could only set the loop
count through AnimationConfig at creation.
Bump deps/dotlottie-rs to e5356051 (LottieFiles/dotlottie-rs#625), which
adds override, input reset and input listing to the C API, and rebuild
the xcframeworks. ThorVG is unchanged at v1.1.3.

Wrap them as stateMachineOverrideCurrentState and
stateMachineResetInput.

markers() put the marker's end frame in Marker.duration. It now holds
the duration, so a marker that does not start at frame 0 is right.
@theashraf theashraf changed the title feat: slot introspection, bezier path slots and an asset resolver feat: slots, bezier paths, asset resolver and state machine parity with dotlottie-rs Nov 11, 2026
make apple does not update Sources/DotLottieCore/cocoapods, so the
CocoaPods copy was still the 02a61130 build and did not export the
state machine functions the Swift layer now calls.
@theashraf
theashraf marked this pull request as ready for review November 11, 2026 05:47
@theashraf
theashraf merged commit 8c400db into feat/audio Nov 11, 2026
2 checks passed
theashraf added a commit that referenced this pull request Nov 11, 2026
…th dotlottie-rs (#155) (#156)

* feat: slot introspection, bezier path slots and an asset resolver

Bring the Swift API up to the dotlottie-rs C API at 02a61130:

- getSlotIds, getSlotType, getSlot, getSlots, setSlot, resetSlot and
  resetSlots
- setBezierPathSlot
- an assetResolver on AnimationConfig for assets the player cannot load
  itself
- stateMachineSetSeed and stateMachineStatus

No xcframework rebuild: the binaries are already dotlottie-rs 02a61130
with ThorVG v1.1.3.

* feat: setLoopCount on DotLottieAnimation

The bridge already had it, but the public class could only set the loop
count through AnimationConfig at creation.

* feat: state machine override and input reset, fix marker duration

Bump deps/dotlottie-rs to e5356051 (LottieFiles/dotlottie-rs#625), which
adds override, input reset and input listing to the C API, and rebuild
the xcframeworks. ThorVG is unchanged at v1.1.3.

Wrap them as stateMachineOverrideCurrentState and
stateMachineResetInput.

markers() put the marker's end frame in Marker.duration. It now holds
the duration, so a marker that does not start at frame 0 is right.

* chore: refresh the CocoaPods xcframework copy

make apple does not update Sources/DotLottieCore/cocoapods, so the
CocoaPods copy was still the 02a61130 build and did not export the
state machine functions the Swift layer now calls.
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