Skip to content

Commit

Permalink
recovers camera with UUID
Browse files Browse the repository at this point in the history
  • Loading branch information
ycw committed May 11, 2024
1 parent 4ec57f5 commit a564aa9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,12 @@ Editor.prototype = {
var loader = new THREE.ObjectLoader();
var camera = await loader.parseAsync( json.camera );

const existingUuid = this.camera.uuid;
const incomingUuid = camera.uuid;
this.camera.copy( camera );
this.camera.uuid = incomingUuid;
delete this.cameras[ existingUuid ];
this.cameras[ incomingUuid ] = this.camera;
this.signals.cameraResetted.dispatch();

this.history.fromJSON( json.history );
Expand Down

0 comments on commit a564aa9

Please sign in to comment.