Ver Fonte

TSL: Fix `Fn` as parameter (#31214)

sunag há 1 ano atrás
pai
commit
a1db039706
1 ficheiros alterados com 3 adições e 1 exclusões
  1. 3 1
      src/nodes/tsl/TSLCore.js

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

@@ -175,7 +175,7 @@ const ShaderNodeObject = function ( obj, altType = null ) {
 
 	} else if ( type === 'shader' ) {
 
-		return Fn( obj );
+		return obj.isFn ? obj : Fn( obj );
 
 	}
 
@@ -652,6 +652,8 @@ export const Fn = ( jsFunc, layout = null ) => {
 	fn.shaderNode = shaderNode;
 	fn.id = shaderNode.id;
 
+	fn.isFn = true;
+
 	fn.getNodeType = ( ...params ) => shaderNode.getNodeType( ...params );
 	fn.getCacheKey = ( ...params ) => shaderNode.getCacheKey( ...params );
 

粤ICP备19079148号