Skip to content

Commit a97401b

Browse files
mrdoobclaude
andcommitted
Editor: Clean up Viewport.Controls
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent f5b2dba commit a97401b

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

editor/js/Viewport.Controls.js

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ function ViewportControls( editor ) {
2626

2727
if ( object.isCamera ) {
2828

29-
update( false );
29+
updateCameraList();
3030

3131
}
3232

@@ -59,7 +59,7 @@ function ViewportControls( editor ) {
5959

6060
//
6161

62-
function update( effect = true ) {
62+
function updateCameraList() {
6363

6464
const options = {};
6565

@@ -79,7 +79,15 @@ function ViewportControls( editor ) {
7979
: editor.camera;
8080

8181
cameraSelect.setValue( selectedCamera.uuid );
82-
if ( effect ) editor.setViewportCamera( selectedCamera.uuid );
82+
83+
return selectedCamera;
84+
85+
}
86+
87+
function update() {
88+
89+
const selectedCamera = updateCameraList();
90+
editor.setViewportCamera( selectedCamera.uuid );
8391

8492
}
8593

0 commit comments

Comments
 (0)