Skip to content

Editor: Fixed ghost viewport camera#28277

Merged
Mugen87 merged 3 commits intomrdoob:devfrom
ycw:editor-viewport-controls-cameras
May 6, 2024
Merged

Editor: Fixed ghost viewport camera#28277
Mugen87 merged 3 commits intomrdoob:devfrom
ycw:editor-viewport-controls-cameras

Conversation

@ycw
Copy link
Copy Markdown
Contributor

@ycw ycw commented May 4, 2024

The issue: When a non-default active viewportCamera is removed, the viewport doesn't update its view:

ghost.cam.view.1.mp4

File>New has the same issue, viewport will select ghost camera if previous file's active viewportCamera isn't default camera:

ghost.cam.view.2.mp4

This PR fixed them all by checking if old viewportCamera is gone, then set default camera as viewportCamera.

Preview: https://raw.githack.com/ycw/three.js/editor-viewport-controls-cameras/editor/index.html

Comment thread editor/js/Viewport.Controls.js Outdated
@ycw ycw requested a review from Mugen87 May 6, 2024 11:03
Comment thread editor/js/Viewport.Controls.js Outdated
@ycw ycw requested a review from Mugen87 May 6, 2024 11:38
@Mugen87 Mugen87 added this to the r165 milestone May 6, 2024
@Mugen87 Mugen87 merged commit f17e262 into mrdoob:dev May 6, 2024
@ycw ycw deleted the editor-viewport-controls-cameras branch January 14, 2025 10:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants