Hi, I’m having an issue regarding creating the screenshot of the scene from the babylonjs viewer.
I’m using babylonjs viewer besides with inspector. When I take the screenshot from the inspector it’s not giving me the model in the screenshot. What I get is blank png of 2,3 KB.
Also, I’m using this in my code to generate the screenshot of the scene in which my model is being shown. But , It’s also giving me 2-3 KB blank png.
if (viewer.sceneManager.scene.activeCamera) {
Tools.CreateScreenshot(
viewer.sceneManager.scene.getEngine(),
viewer.sceneManager.scene.activeCamera,
{ width: 600, height: 400 },
function (data) {
window.open(data, "_blank");
}
);
}
But I have no idea where I’m wrong in it. Because, besides code, inspector is also not picking up the screenshot of model (giving me blank png)
My Questions are
How I can take screenshots of the scene from babylonjs viewer?
Is there any compatibility issue between inspector and viewer in the matter of screenshot? (it’s a bug to me, because at least it should work)
This has been assigned to @RaananW who is in vacation until the 4th of January. @Evgeni_Popov and myself will be alone from the core team until then on the forum so you might have a bit of delay with the answers.
Ok, I think the buttons were there but I needed to scroll the page to see them.
As it is working in BabylonJS Viewer - Basic usage, I wonder if there’s something special that Vue is doing with the canvas…
Could you try using the latest version of Babylon (5.0)? We changed a bit how a screenshot is handled, and more precisely when it is done during the processing of a frame. Hopefully it could make it work…