feat(registry): add three-dissolve block — generic 3D dissolve effect#776
Closed
miguel-heygen wants to merge 5 commits into
Closed
feat(registry): add three-dissolve block — generic 3D dissolve effect#776miguel-heygen wants to merge 5 commits into
miguel-heygen wants to merge 5 commits into
Conversation
…or model swapping
- Rename block from magic-book to three-dissolve — the value is the
dissolve effect, not the specific spellbook model
- Add HyperFrames variables: modelUrl, dissolveStart, dissolveEnd,
particleColor, bgColor — users can now swap the GLTF model and
customize colors without editing the HTML
- Remove bundled binary assets (14MB of GLTF + textures) from the
repo; default model URL now points to static.heygen.ai CDN
- Fix readiness signal: replace window.__tailwindReady with
window.__hyperframes_ready
- Fix seeded random: use closure-scoped createSeededRandom() instead
of module-scope let seed to prevent shared state across instances
- Remove debug globals (window.__magicBookDebug, window.seekMagicBook)
- Use querySelector('[data-composition-id]') instead of getElementById
for compatibility with HyperFrames compiler inlining
- Add model-swapping documentation with data-var-modelUrl examples
Read variables from window.__hfVariablesByComp[compositionId] which is what the HyperFrames compiler populates from data-variable-values. Update docs to use data-variable-values (JSON) instead of data-var-*.
The HyperFrames runtime doesn't always populate __hfVariablesByComp before sub-composition scripts run. Fall back to reading data-variable-values directly from the composition's DOM element, which the compiler preserves.
Replace hardcoded root.scale.setScalar(0.34) (tuned for the spellbook) with bounding-box-based auto-scaling that centers the model and scales it to 32% of the camera's visible height. Any GLTF model now fills the frame consistently regardless of its native dimensions.
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
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
Builds on @MrSunOcean's work in #712 (magic-book block) and restructures it into a generic, model-swappable catalog block per the review feedback.
magic-book→three-dissolve— the value is the dissolve effect, not a specific modelmodelUrl,dissolveStart,dissolveEnd,particleColor,bgColor— users swap models viadata-variable-valueswithout editing HTMLstatic.heygen.aiCDNwindow.__hyperframes_readyreadiness signal (was__tailwindReady)createSeededRandom()instead of shared module-scopelet seedquerySelectorovergetElementById)Model swap verified
Default (spellbook from CDN):

Swapped (Suzanne monkey head, orange particles, dark background):
Rendered successfully at 5.0 MB / 1920x1080 / 24fps with
data-variable-values='{"modelUrl":"...suzanne.gltf","particleColor":"#ff4400","bgColor":"#0a0a1a"}'Test plan
npx hyperframes lintpasses (only pre-existing warnings)three-dissolve-default.mp4, 2.8 MB)data-variable-values(three-dissolve-suzanne.mp4, 5.0 MB)particleColor,bgColoroverride defaultsnpx hyperframes add three-dissolveinstalls correctly (needs registry publish)Closes #712