diff --git a/editor/js/Viewport.Controls.js b/editor/js/Viewport.Controls.js index 12c32e54612970..a82f5c503b7f2a 100644 --- a/editor/js/Viewport.Controls.js +++ b/editor/js/Viewport.Controls.js @@ -26,7 +26,7 @@ function ViewportControls( editor ) { if ( object.isCamera ) { - update( false ); + updateCameraList(); } @@ -59,7 +59,7 @@ function ViewportControls( editor ) { // - function update( effect = true ) { + function updateCameraList() { const options = {}; @@ -79,7 +79,15 @@ function ViewportControls( editor ) { : editor.camera; cameraSelect.setValue( selectedCamera.uuid ); - if ( effect ) editor.setViewportCamera( selectedCamera.uuid ); + + return selectedCamera; + + } + + function update() { + + const selectedCamera = updateCameraList(); + editor.setViewportCamera( selectedCamera.uuid ); }