Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Fixed camera name is always 'Camera' when recovering from indexedDB #28309

Merged
merged 2 commits into from
May 7, 2024

Conversation

ycw
Copy link
Contributor

@ycw ycw commented May 7, 2024

The issue: Camera name in viewport camera selector is always 'Camera' (default camera's default name) when recovering from indexedDB, this is a problem when users renamed the default camera; It happens only in a special case that when the scene is empty, since there's no objects in the scene, editor won't dispatch objectChanged nor cameraAdded, while these signals are listened by Viewport.Controls for re-rendering its UI.

The solution: Let Viewport.Controls listens one more signal, cameraResetted, dispatched from editor.fromJSON(), then re-render UI on cameraResetted

To reproduce the issue:

  1. Go to https://raw.githack.com/mrdoob/three.js/dev/editor/index.html
  2. Press File>New
  3. Renames the default camera to 'Camera123'
  4. Refresh the page
  5. You should see 'Camera123' in outliner and 'Camera' in viewport camera selector
@Mugen87 Mugen87 added this to the r165 milestone May 7, 2024
@Mugen87 Mugen87 merged commit 241a542 into mrdoob:dev May 7, 2024
8 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants