Skip to content
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

Animated glTF with no skeletons defined crashes #8175

Closed
OmarShehata opened this issue Sep 18, 2019 · 4 comments · Fixed by #8756
Closed

Animated glTF with no skeletons defined crashes #8175

OmarShehata opened this issue Sep 18, 2019 · 4 comments · Fixed by #8756

Comments

@OmarShehata
Copy link
Contributor

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.

@emackey
Copy link
Contributor

emackey commented Jan 29, 2020

As noted in #8540:

This is a fairly substantial discrepancy between Cesium and glTF's skinning specification. The spec explicitly says that the skeleton is optional, but Cesium treats it as required.

I'm by no means a skinning expert, but it appears very difficult with the current glTF-Blender-IO project to export any kind of skinned mesh from Blender and get it to load correctly in Cesium, even if the model validates correctly and loads into Babylon and ThreeJS without issue.

All of the "working in Cesium" skinned models that I know of appear to have come through COLLADA2GLTF, not Blender.

@emackey
Copy link
Contributor

emackey commented Jan 29, 2020

A good minimal test case is in KhronosGroup/glTF-Sample-Models#243.

@cesium-concierge
Copy link

Congratulations on closing the issue! I found these Cesium forum links in the comments above:

https://groups.google.com/forum/#!topic/cesium-dev/EnrvvKk4qE4

If this issue affects any of these threads, please post a comment like the following:

The issue at #8175 has just been closed and may resolve your issue. Look for the change in the next stable release of Cesium or get it now in the master branch on GitHub https://github.com/AnalyticalGraphicsInc/cesium.

@lilleyse
Copy link
Contributor

The skeleton crash was fixed in #8756 but char.glb still doesn't show up because the armature is really tiny. See #8759.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants