Skip to content

feat(samples): model-viewer — animation playback controls#671

Merged
ThomasGorisse merged 3 commits intomainfrom
feat/model-viewer-animation
Mar 20, 2026
Merged

feat(samples): model-viewer — animation playback controls#671
ThomasGorisse merged 3 commits intomainfrom
feat/model-viewer-animation

Conversation

@ThomasGorisse
Copy link
Contributor

Summary

Adds play/pause and animation cycling to the model-viewer sample.

  • Play/Pause — toggle animation on/off (animationName = null stops, name resumes)
  • Animation name — shows current glTF animation name (falls back to "Animation N")
  • Next — cycles through all animations; only shown when model has > 1 animation
  • Controls auto-hide when the loaded model has no animations
  • Animation state resets when switching models

Demo model: Fox.glb (3 animations: Survey, Walk, Run)

Test plan

  • ./gradlew :samples:model-viewer:assembleDebug
  • Load Fox → Play/Pause/Next visible, animations cycle correctly
  • Load Helmet → controls hidden (no animations)

🤖 Generated with Claude Code

ThomasGorisse and others added 3 commits March 20, 2026 20:01
Interactive demo of four Filament View post-processing effects using the
existing View parameter on Scene {}. No new SceneView API required.

Effects:
- Bloom with lens flare, starburst, chromatic aberration
- Depth of Field (physical, circle-of-confusion)
- Screen-Space Ambient Occlusion with contact shadows
- Atmospheric Fog with IBL colour sampling

Model: Damaged Helmet (CC0, KhronosGroup glTF-Sample-Assets)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add play/pause button, animation name display, and next-animation button
to the model-viewer sample. Controls appear automatically when the loaded
glTF model has animations (Fox.glb) and are hidden for static models
(Helmet). Animation state resets when switching models.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ntation

Plane visualization:
- Change planeRenderer from `anchor == null` to always `true` so
  ARCore's built-in textured grid remains visible even after a model
  is placed, giving users a clear view of all detected surfaces.

Gesture support (was already wired via isEditable, now documented):
- Add inline comments on ModelNode explaining that isEditable = true
  activates three gestures automatically: single-finger drag to move,
  two-finger pinch to scale (clamped by editableScaleRange), and
  two-finger twist to rotate around Y. No additional gesture callbacks
  are needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@ThomasGorisse ThomasGorisse merged commit 02759ef into main Mar 20, 2026
2 checks passed
@ThomasGorisse ThomasGorisse deleted the feat/model-viewer-animation branch March 20, 2026 19:26
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