Skip to content

feat(core): add VRMC_vrm extension models and decoding tests#45

Open
nhiroyasu wants to merge 9 commits into
mainfrom
feat/vrm
Open

feat(core): add VRMC_vrm extension models and decoding tests#45
nhiroyasu wants to merge 9 commits into
mainfrom
feat/vrm

Conversation

@nhiroyasu

@nhiroyasu nhiroyasu commented May 2, 2026

Copy link
Copy Markdown
Owner

Changes

  • Add VRMC_vrm extension models and decoding tests
  • Merge remote-tracking branch 'origin/main' into feat/vrm
  • Add VRM humanoid support and interactive debug HUD
  • Represent VRM humanoid rotations as Euler degrees (SIMD3)
  • Add scroll-adjusting fields, collapsible VRM humanoid panel, and scrollable debug HUD
  • Group humanoid debug HUD into collapsible sections and iterate all bones

Preview

スクリーンショット 2026-05-02 19 47 41

nhiroyasu added 7 commits May 2, 2026 12:57
Add full Codable model support for the VRMC_vrm glTF extension and wire it into GLTFExtensions as "VRMC_vrm". Implement types and enums for VRMCVrm, VRMCVrmMeta, humanoid/bones, firstPerson, lookAt, expressions, morph/material/texture binds, and texture transform defaults. Provide custom decoding fallbacks for meta and expression/default values. Add comprehensive unit tests (VRMCVrmDecodingTests) to verify minimal, optional, and default decoding behavior.
- Add VRM 0.x extension types and decoding to SwiftGLTFCore (VRM0Vrm, VRM0Humanoid, VRM0HumanBone, VRMHumanoidBoneName, node mapping helpers).
- Extend GLTF parser to expose VRM humanoid data via MDLObject (GLTFVRM) and new GLTFAssetPath entries.
- Propagate humanoid node map into mesh pipeline (PBRMeshBundle, PBRMeshLoader) and map to NodeHierarchyOffset.
- Introduce runtime VRM humanoid rotation support: expose vrmHumanoidRotations across GLTFSwiftUIView / GLTFView / RenderingContext and apply rotations in renderer (encodeNodeTransforms) before animation updates.
- Add VRMHumanoidDebugHUDView (iOS/macOS) to inspect/edit bone rotations and hook up UI to update rotations; integrate into GLTFView HUD.
- Add unit tests for VRM0 decoding.
- Minor UI tweak: replace reset button bezelStyle with bezelColor for consistent appearance.
…D3<Float>)

- Change VRM humanoid rotation types from simd_quatf to SIMD3<Float> across SwiftGLTF views, GLTFView, VRMHumanoidDebugHUDView, RenderingContext, and PBRRenderer.
- Remove quaternion/euler utilities from the debug HUD and add quaternion(fromEulerDegrees:) helper in renderer helper.
- Convert Euler-degree vectors to quaternions when applying rotations in PBRRenderer.
- Update debug HUD callbacks and reset logic to emit/use SIMD3<Float> (.zero) instead of simd_quatf.
…l, and scrollable debug HUD

- Add DebugHUDScrollAdjustingTextField (macOS) to support mouse-wheel value adjustments with configurable scrollStep and fractionDigits; use it in CameraDebugHUDView and VRMHumanoidDebugHUDView.
- Wrap debug HUD in scroll views on iOS (UIScrollView) and macOS (NSScrollView) and update layout constraints to use content/frame layout guides.
- Add collapsible VRM Humanoid section with a header toggle and separate body stack on both iOS and macOS.
- Update field creation and widths to match new HUD layout.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0cf732963

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Sources/SwiftGLTFRenderer/Renderer/PBRRenderer.swift
Comment thread Sources/SwiftGLTFCore/Types.swift Outdated
nhiroyasu added 2 commits May 2, 2026 20:30
Map left/right thumb proximal/intermediate/distal to corresponding VRM names (leftThumbProximal → leftThumbMetacarpal, leftThumbIntermediate → leftThumbProximal, leftThumbDistal → leftThumbDistal; same for right). Update unit tests to assert the new mappings and verify humanoid node map.
…ion transforms so animations can override them
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