-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Setting transparency to 3dtiles caused a crash #8394
Comments
Thanks for looking into this and opening the PR @verybigzhouhai ! Are you able to provide a Sandcastle example that reproduces this issue? The better fix may be to get the Model primitive to skip the update step if |
@OmarShehata Ok, you are right. I have noticed the same problem with this code before. I will try to reproduce the problem with a simple model, not in the model I am using now. |
@OmarShehata I reproduce this error, using the following code and the gltf file in the attached file. This gltf file contains the mesh, but does not contain any primitives. I want to add this judgment at the same time when judging whether to display the model update, how do you think?Or at an earlier time? But there seems to be no way to upload the gltf file as an attachment.I sent it to the gmail mailbox I saw in your profile, if you think this is not a good fit, please let me know the other way. Below is the code. This error will be triggered when you click the button. var viewer = new Cesium.Viewer('cesiumContainer', { var position = Cesium.Cartesian3.fromDegrees(-123.0744619, 44.0503706, -1000); var entity; Sandcastle.addToolbarButton('test', function() { |
@verybigzhouhai you can actually host your glTF model on Cesium ion now (https://cesium.com/ion) and then link it in your Sandcastle code. I can see how this empty glTF reproduces the error, but I was hoping to see how this can be reproduced with a non empty 3D Tileset when setting it to transparent with the styling language (is that how you were setting the transparency?) |
@OmarShehata Sorry, is there such a new development in this question? |
@verybigzhouhai This PR might be fixing the issue: #9271 |
@verybigzhouhai sorry that your PR #8395 slipped through the cracks but #9271 was just merged and will hopefully fix this. |
As the title says, I set the color with transparency for my 3dtiles, and then the program crashes at some point during the program browsing. I tracked the error code and thought that the error might come from a gltf containing a mesh, but the mesh does not contain a primitive, so model._nodeCommands.length is 0. This caused the final crash.

So we need to determine if the first item of the array exists before accessing to solve this problem.
if (defined(nodeCommands[0]) && (!defined(nodeCommands[0].translucentCommand) || forceDerive)) { // code }
https://github.com/AnalyticalGraphicsInc/cesium/blob/63e97a531640b9cdd99b4eb20e1686a99d4f0eeb/Source/Scene/Model.js#L4028
The text was updated successfully, but these errors were encountered: