浏览代码

Scene: Fix serialization of background properties. (#25213)

Michael Herzog 2 年之前
父节点
当前提交
d828be1edc
共有 3 个文件被更改,包括 4 次插入2 次删除
  1. 1 0
      editor/js/Editor.js
  2. 1 0
      editor/js/Sidebar.Scene.js
  3. 2 2
      src/scenes/Scene.js

+ 1 - 0
editor/js/Editor.js

@@ -136,6 +136,7 @@ Editor.prototype = {
 		this.scene.background = scene.background;
 		this.scene.environment = scene.environment;
 		this.scene.fog = scene.fog;
+		this.scene.backgroundBlurriness = scene.backgroundBlurriness;
 
 		this.scene.userData = JSON.parse( JSON.stringify( scene.userData ) );
 

+ 1 - 0
editor/js/Sidebar.Scene.js

@@ -395,6 +395,7 @@ function SidebarScene( editor ) {
 
 					backgroundType.setValue( 'Equirectangular' );
 					backgroundEquirectangularTexture.setValue( scene.background );
+					backgroundBlurriness.setValue( scene.backgroundBlurriness );
 
 				} else {
 

+ 2 - 2
src/scenes/Scene.js

@@ -51,8 +51,8 @@ class Scene extends Object3D {
 		const data = super.toJSON( meta );
 
 		if ( this.fog !== null ) data.object.fog = this.fog.toJSON();
-		if ( this.backgroundBlurriness > 0 ) data.backgroundBlurriness = this.backgroundBlurriness;
-		if ( this.backgroundIntensity !== 1 ) data.backgroundIntensity = this.backgroundIntensity;
+		if ( this.backgroundBlurriness > 0 ) data.object.backgroundBlurriness = this.backgroundBlurriness;
+		if ( this.backgroundIntensity !== 1 ) data.object.backgroundIntensity = this.backgroundIntensity;
 
 		return data;