Add external renderer layer for generated dancers - #675
Merged
Conversation
mikeharv
marked this pull request as ready for review
September 10, 2025 18:43
mikeharv
requested review from
a team,
breville,
dju90,
sanchitmalhotra126 and
tshaffercodeorg
September 10, 2025 18:50
breville
reviewed
Sep 13, 2025
breville
reviewed
Sep 13, 2025
breville
reviewed
Sep 13, 2025
added 2 commits
September 17, 2025 13:38
breville
reviewed
Oct 1, 2025
breville
reviewed
Oct 1, 2025
breville
reviewed
Oct 1, 2025
sanchitmalhotra126
left a comment
Contributor
There was a problem hiding this comment.
Nice! a few minor things/questions
breville
approved these changes
Oct 2, 2025
breville
left a comment
Member
There was a problem hiding this comment.
Approving so you're not blocked on me. Fantastic work! Thanks for addressing all of my comments.
@sanchitmalhotra126 should approve separately, because he had a lot of other good feedback, before this is merged.
This was referenced Oct 2, 2025
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Introduce a pluggable “external dancer” rendering layer that Dance Party can composite between sprites and foreground effects. This allows the main
code-dot-orgrepo to supply its own renderer (e.g., a Lottie-based dancer preview) without adding that dependency to Dance Party.The external renderer layer is shown below as bull dancer that is provided by a Lottie renderer introduced with code-dot-org/code-dot-org#68250
2025-09-09.15-37-31.2025-09-09.15_38_01.mp4
We have multiple surfaces that need to render the same generated dancer JSON (Dance Party canvas, a Dancer Editor, and a Music Lab view). Centralizing the rendering logic in the main repo keeps Dance Party lean and lets other surfaces reuse the same renderer.
What changed
ExternalDancerLayer(p5 adapter that owns ap5.Graphics bufferand hands its 2D context to an external renderer).DancePartynow accepts an optionalexternalRendererFactory(constructor option). If provided,setup()creates anExternalDancerLayer.setExternalLayerSource(danceMove)informs the render which dancer animation source JSON to use.Behavioral notes
externalRendererFactoryis provided, no behavior change: sprites and effects render as before.Deployment strategy
Pairs with code-dot-org/code-dot-org#68250 (adds the concrete Lottie renderer and passes the factory into DanceParty).
Testing story