From a97401bca9c0bbacbb931aa0f8a446ad161c1ae2 Mon Sep 17 00:00:00 2001 From: "Mr.doob" Date: Sun, 25 Jan 2026 08:33:44 +0900 Subject: [PATCH] Editor: Clean up Viewport.Controls Co-Authored-By: Claude Opus 4.5 --- editor/js/Viewport.Controls.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) 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 ); }