Skip to content

feat(registry): add three-dissolve block — generic 3D dissolve effect#776

Closed
miguel-heygen wants to merge 5 commits into
mainfrom
add-three-dissolve
Closed

feat(registry): add three-dissolve block — generic 3D dissolve effect#776
miguel-heygen wants to merge 5 commits into
mainfrom
add-three-dissolve

Conversation

@miguel-heygen
Copy link
Copy Markdown
Collaborator

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.

  • Rename magic-bookthree-dissolve — the value is the dissolve effect, not a specific model
  • HyperFrames variables for modelUrl, dissolveStart, dissolveEnd, particleColor, bgColor — users swap models via data-variable-values without editing HTML
  • Remove 14MB of bundled binary assets — default model URL points to static.heygen.ai CDN
  • Auto-scale any GLTF model to fit the viewport using bounding-box normalization — no hardcoded scale factors
  • Fix window.__hyperframes_ready readiness signal (was __tailwindReady)
  • Fix seeded random — closure-scoped createSeededRandom() instead of shared module-scope let seed
  • Fix DOM queries for compiled sub-composition inlining (querySelector over getElementById)

Model swap verified

Default (spellbook from CDN):
default

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 lint passes (only pre-existing warnings)
  • Default model renders from CDN (three-dissolve-default.mp4, 2.8 MB)
  • Swapped model renders via data-variable-values (three-dissolve-suzanne.mp4, 5.0 MB)
  • Auto-scaling adapts to different model dimensions
  • Variables: particleColor, bgColor override defaults
  • npx hyperframes add three-dissolve installs correctly (needs registry publish)

Closes #712

LAPTOP-6VBT5D9C\ASUS and others added 5 commits May 11, 2026 18:26
…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.
@mintlify
Copy link
Copy Markdown

mintlify Bot commented May 13, 2026

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
hyperframes 🟢 Ready View Preview May 13, 2026, 2:25 AM

💡 Tip: Enable Workflows to automatically generate PRs for you.

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