소스 검색

Examples: Fix toJSON() methods for certain node classes.

Mugen87 4 년 전
부모
커밋
60306cf826
5개의 변경된 파일8개의 추가작업 그리고 20개의 파일을 삭제
  1. 4 10
      examples/jsm/nodes/utils/TimerNode.js
  2. 4 10
      examples/jsm/nodes/utils/VelocityNode.js
  3. 0 0
      examples/nodes/caustic.json
  4. 0 0
      examples/nodes/displace.json
  5. 0 0
      examples/nodes/wave.json

+ 4 - 10
examples/jsm/nodes/utils/TimerNode.js

@@ -77,18 +77,12 @@ TimerNode.prototype.copy = function ( source ) {
 
 TimerNode.prototype.toJSON = function ( meta ) {
 
-	var data = this.getJSONNode( meta );
+	var data = FloatNode.prototype.toJSON.call( this, meta );
 
-	if ( ! data ) {
+	data.scope = this.scope;
+	data.scale = this.scale;
 
-		data = this.createJSONNode( meta );
-
-		data.scope = this.scope;
-		data.scale = this.scale;
-
-		data.timeScale = this.timeScale;
-
-	}
+	data.timeScale = this.timeScale;
 
 	return data;
 

+ 4 - 10
examples/jsm/nodes/utils/VelocityNode.js

@@ -154,18 +154,12 @@ VelocityNode.prototype.copy = function ( source ) {
 
 VelocityNode.prototype.toJSON = function ( meta ) {
 
-	var data = this.getJSONNode( meta );
+	var data = Vector3Node.prototype.toJSON.call( this, meta );
 
-	if ( ! data ) {
+	if ( this.target ) data.target = this.target.uuid;
 
-		data = this.createJSONNode( meta );
-
-		if ( this.target ) data.target = this.target.uuid;
-
-		// clone params
-		data.params = JSON.parse( JSON.stringify( this.params ) );
-
-	}
+	// clone params
+	data.params = JSON.parse( JSON.stringify( this.params ) );
 
 	return data;
 

파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
examples/nodes/caustic.json


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
examples/nodes/displace.json


파일 크기가 너무 크기때문에 변경 상태를 표시하지 않습니다.
+ 0 - 0
examples/nodes/wave.json


이 변경점에서 너무 많은 파일들이 변경되어 몇몇 파일들은 표시되지 않았습니다.