Adjust display when no geometry exists

We are only showing a generated geometry in our Shapediver viewer, but there can be instances where no geometry is created, either through input error or because one of the inputs (a text input) is empty.

How can we control what is shown when that happens? I think now it just shows the loading image, but not sure if it is still the case in newer versions.

I can’t find the relevant section in the documentation.

Okay, seems like I found what I was looking for here:

Is there also a way to change this for something else?

image

Hello @seltzdesign!

Thank you for your interesting question.

There are a few things that might be of interest for your implementation here:

  • You can display a message which is shown instead of the logo. This message is only shown if the scene is not visible (which would be the case in your application).
  • There is an event that you can listen to which is triggered whenever the session has been customized, but the scene is empty.
  • You can change the logo and the spinner of the viewport to an image of your liking. Please note that both of these options can only be changed on initialization.

I think that what would make the most sense in your case is to display an error message (point 1) whenever no geometry is created. You can choose when to do this either on your own (maybe you already have a structure where you can check the output data for that case) or with the event that is triggered when the scene is empty (point 2).

Cheers, Michael

1 Like