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
I was testing a glTF model that contains no scene or scenes property. GltfLoader is supposed to resolve this by picking the first node in the nodes array. However, the code results in attempting to access an undefined node.
I have narrowed it down to some weird behavior in loadScene. The function getSceneNodeIds is called before it, and it's supposed to substitutde the nodes array if no scenes exist. This is successfully chosen. It is the following line that results in an undefined node being added to the scene:
This is most easily reproduced in locally-built CesiumJS.
Open Apps/SampleData/Models/BoxUnlit/BoxUnlit.gltf in a text editor like VSCode.
Delete the scene and scenes properties from the file.
Navigate to the "3D Models" sandcastle. Select "Unlit Box" from the dropdown. You'll get this error:
An error occurred while rendering. Rendering has stopped.
TypeError: Cannot read properties of undefined (reading 'matrix')
TypeError: Cannot read properties of undefined (reading 'matrix')
at ModelUtility.getNodeTransform (http://localhost:8080/Build/CesiumUnminified/index.js:72701:28)
at traverseAndCreateSceneGraph (http://localhost:8080/Build/CesiumUnminified/index.js:100266:43)
at initialize14 (http://localhost:8080/Build/CesiumUnminified/index.js:100182:27)
at new ModelSceneGraph (http://localhost:8080/Build/CesiumUnminified/index.js:100098:3)
at Model.update (http://localhost:8080/Build/CesiumUnminified/index.js:103316:24)
at PrimitiveCollection.update (http://localhost:8080/Build/CesiumUnminified/index.js:141598:19)
at updateAndRenderPrimitives (http://localhost:8080/Build/CesiumUnminified/index.js:241846:21)
at executeCommandsInViewport (http://localhost:8080/Build/CesiumUnminified/index.js:241697:3)
at Scene4.updateAndExecuteCommands (http://localhost:8080/Build/CesiumUnminified/index.js:241519:5)
at render (http://localhost:8080/Build/CesiumUnminified/index.js:242270:9)
What happened?
I was testing a glTF model that contains no
scene
orscenes
property.GltfLoader
is supposed to resolve this by picking the first node in thenodes
array. However, the code results in attempting to access anundefined
node.I have narrowed it down to some weird behavior in
loadScene
. The functiongetSceneNodeIds
is called before it, and it's supposed to substitutde thenodes
array if noscenes
exist. This is successfully chosen. It is the following line that results in anundefined
node being added to the scene:Reproduction steps
This is most easily reproduced in locally-built CesiumJS.
Apps/SampleData/Models/BoxUnlit/BoxUnlit.gltf
in a text editor like VSCode.scene
andscenes
properties from the file.Sandcastle example
http://localhost:8080/Apps/Sandcastle/index.html?src=3D%20Models.html
Environment
Browser: Google Chrome 131.0.6778.265
CesiumJS Version: 1.124
Operating System: Windows
The text was updated successfully, but these errors were encountered: