Skip to content

Animated glTF with no skeletons defined crashes #8175

@OmarShehata

Description

@OmarShehata

Reported in this forum thread. Loading this glTF in CesiumJS produces the following crash:

char.glb.zip

TypeError: Cannot read property 'parents' of undefined
TypeError: Cannot read property 'parents' of undefined
    at createRuntimeNodes (http://localhost:8080/Source/Scene/Model.js:3649:33)
    at createResources (http://localhost:8080/Source/Scene/Model.js:3805:9)
    at Model.update (http://localhost:8080/Source/Scene/Model.js:4709:21)
    at PrimitiveCollection.update (http://localhost:8080/Source/Scene/PrimitiveCollection.js:384:27)
    at updateAndRenderPrimitives (http://localhost:8080/Source/Scene/Scene.js:2993:27)
    at executeCommandsInViewport (http://localhost:8080/Source/Scene/Scene.js:2832:13)
    at updateAndExecuteCommands (http://localhost:8080/Source/Scene/Scene.js:2640:13)
    at render (http://localhost:8080/Source/Scene/Scene.js:3291:9)
    at tryAndCatchError (http://localhost:8080/Source/Scene/Scene.js:3311:13)
    at Scene.render (http://localhost:8080/Source/Scene/Scene.js:3382:13)

This model is a valid glTF according to the Khronos validator and displays correctly in ThreeJS.

The problem seems to be that this model doesn't have any skeletons defined (which is optional according to the spec). So when it attempts to map joint names here:

https://github.com/AnalyticalGraphicsInc/cesium/blob/a355439140f37af904f47082e00612c90c6b7715/Source/Scene/Model.js#L2825-L2833

The returned mappedJointNames is an empty object, which causes it to push undefined nodes into skinnedNode.joints.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions