-
Notifications
You must be signed in to change notification settings - Fork 15
Add external renderer layer for generated dancers #675
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
Conversation
sanchitmalhotra126
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice! a few minor things/questions
breville
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
sanchitmalhotra126
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
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