Skip to content

clone node associations in GLTFLoader #31051

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

nkrajina
Copy link

@nkrajina nkrajina commented May 5, 2025

Description

GLTFLoader doesn't correctly assign the nodes association when multiple
nodes reference the same mesh. The problem occurs in _loadNodeShallow
where nodes property is added to the shared object describing the node/mesh
association.

For example, in the CesiumMilkTruck model nodes 0 (Wheels) and 2 (Wheels.001)
reference the same mesh 0, but resulting associations for both three.js meshes are
{meshes: 0, primitives: 0, nodes: 2}.

A simple solution is to clone the association object if there are multiple references to
the same mesh.

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