Skip to content

Preserve all glTF joint attachments - #3038

Merged
riccardobl merged 1 commit into
jMonkeyEngine:masterfrom
riccardobl:gltfattc
Nov 3, 2026
Merged

riccardobl merged 1 commit into
jMonkeyEngine:masterfrom
riccardobl:gltfattc

Conversation

@riccardobl

Copy link
Copy Markdown
Member

This PR improves the gltf loader to support more than one attachment per bone

@jaime-jmebot jaime-jmebot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hi @riccardobl, thanks for submitting this pull request!

Overview

This change resolves an issue in GltfLoader where glTF joint nodes containing multiple attached child spatials would only retain the last attached spatial, discarding any preceding ones.

Technical Discussion

  • GltfLoader: Converting the single attachedSpatial field on JointWrapper into a List<Spatial> (attachedSpatials) allows findChildren() to accumulate all non-joint child spatials attached to a bone. During setupControls(), all attached spatials are iterated over and safely added to the corresponding AttachmentsNode on the SkinControl.
  • Test Coverage: The added unit test (keepsEverySpatialAttachedToTheSameJoint) along with JointAttachments.gltf verifies that multiple attachment nodes on a single joint survive glTF import and remain reachable via scene traversal.

Everything is neatly structured, correct, and well-tested. Great improvement for glTF support!

@riccardobl
riccardobl merged commit 341e518 into jMonkeyEngine:master Nov 3, 2026
13 checks passed
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.

2 participants