activeView
is always null when its camera is undefined
Expected
view.camera
should not affect activeView
, and is set accordingly in onBeforeRender
, runRenderLoop
, onAfterRender
Reproduction
Multiple Canvas Multiple Scene | Babylon.js Playground (babylonjs.com)
Suggestion
this.activeView = view
should be out side of if (camera)
condition
if (camera) {
scene = Array.isArray(camera) ? camera[0].getScene() : camera.getScene();
previewCamera = scene.activeCamera;
previewCameras = scene.activeCameras;
- this.activeView = view;
if (Array.isArray(camera)) {
scene.activeCameras = camera;
} else {
scene.activeCamera = camera;
scene.activeCameras = null;
}
}
+ this.activeView = view;