Replies: 2 comments 2 replies
-
We have a dedicated screenshot method: https://modelviewer.dev/docs/index.html#entrydocs-loading-methods-toBlob - is there any reason that won't work? |
Beta Was this translation helpful? Give feedback.
-
@elalish It won't work for exact reasons that i've described.
With the content located like that |
Beta Was this translation helpful? Give feedback.
-
It looks like there's a race condition or rather unexpected behavior with the
displayCanvas
and invisible(not in the viewport) multiple models.Lets take example of 2 models side by side. If those models are out of the viewport
multipleScenesVisible
would be set tofalse
since none of the models are in the view port. Because of thatdisplayCanvas
would always usethis.canvas3D
meaning that if you want get access to the canvas that's off the screen you'd get last rendered and not the canvas for that specific scene.The reason
displayCanvas
is to take screenshot, meaning if there's no models in the viewport it's impossible to take a screenshot of it even if it's rendered.What's the easiest and most convenient way to get proper canvas each time?
countVisibleScenes
scene.element[$canvas]
directly - not sure how to do that and what might be an implications of it sincecountVisibleScenes
is used in other places for render as well.Non of the above solutions seems to be proper one for the situation described.
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions