Преглед изворни кода

TSL: Show an error message if no stack defined for assign operation (#31756)

sunag пре 4 месеци
родитељ
комит
105a9940bd
1 измењених фајлова са 9 додато и 1 уклоњено
  1. 9 1
      src/nodes/tsl/TSLCore.js

+ 9 - 1
src/nodes/tsl/TSLCore.js

@@ -59,7 +59,15 @@ Node.prototype.assign = function ( ...params ) {
 
 	if ( this.isStackNode !== true ) {
 
-		currentStack.assign( this, ...params );
+		if ( currentStack !== null ) {
+
+			currentStack.assign( this, ...params );
+
+		} else {
+
+			console.error( 'THREE.TSL: No stack defined for assign operation. Make sure the assign is inside a Fn().' );
+
+		}
 
 		return this;
 

粤ICP备19079148号