You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The GLTF loader (to my understanding) attempts to assign unique names to all nodes it parses.
However I noticed that duplicated names can appear in meshes created for nodes in certain cases. When a GLTF mesh has multiple primitives the GLTF loader will create one THREE.Mesh per mesh primitive under a THREE.Group. When instantiating this GLTF mesh multiple times, the THREE.Group seems to usually receive a unique name, but the meshes under the group have the same names in each instance.
This can be problematic in software that manipulates parts of 3D scenes based on mesh names (e.g. user selected mesh names).
I'm not sure what the intended behaviour from the THREE.js maintainers here is, so apologies if this should have been a feature request.
The text was updated successfully, but these errors were encountered:
Mirei3D
changed the title
GLTFLoader: mesh with multiple primitives and multiple instances have non-unique name
GLTFLoader: meshes with multiple primitives and multiple instances have non-unique name
Dec 10, 2024
Mirei3D
added a commit
to Mirei3D/three.js
that referenced
this issue
Dec 10, 2024
Assigning unique names to each node has been the intention, yes. Originally this was done because animation track assignments would require it. Since then it's become necessary for R3F's gltfjsx and Threlte's gltf as well, although they might have the additional option of pre-processing the model so that names in the source file are already unique and don't require changes from three.js.
Description
The GLTF loader (to my understanding) attempts to assign unique names to all nodes it parses.
However I noticed that duplicated names can appear in meshes created for nodes in certain cases. When a GLTF mesh has multiple primitives the GLTF loader will create one THREE.Mesh per mesh primitive under a THREE.Group. When instantiating this GLTF mesh multiple times, the THREE.Group seems to usually receive a unique name, but the meshes under the group have the same names in each instance.
This can be problematic in software that manipulates parts of 3D scenes based on mesh names (e.g. user selected mesh names).
I'm not sure what the intended behaviour from the THREE.js maintainers here is, so apologies if this should have been a feature request.
Reproduction steps
Cube
andCube001
Code
// code goes here
Live example
Screenshots
Version
r171
Device
No response
Browser
No response
OS
No response
The text was updated successfully, but these errors were encountered: