Browse Source

ShaderNode: Remove `.isArrayInput` (#29205)

* Remove isArrayInput

* Add build files

* Revert "Add build files"

This reverts commit 49106b53573b871ec79072cff639f7faf1934b94.
William Candillon 1 year ago
parent
commit
91c5b8da71
2 changed files with 14 additions and 23 deletions
  1. 14 17
      src/nodes/core/NodeBuilder.js
  2. 0 6
      src/nodes/shadernode/ShaderNode.js

+ 14 - 17
src/nodes/core/NodeBuilder.js

@@ -995,27 +995,24 @@ class NodeBuilder {
 
 		const layout = shaderNode.layout;
 
-		let inputs;
-
-		if ( shaderNode.isArrayInput ) {
-
-			inputs = [];
-
-			for ( const input of layout.inputs ) {
-
-				inputs.push( new ParameterNode( input.type, input.name ) );
+		const inputs = {
+			[ Symbol.iterator ]() {
+
+				let index = 0;
+				const values = Object.values( this );
+				return {
+					next: () => ( {
+						value: values[ index ],
+						done: index ++ >= values.length
+					} )
+				};
 
 			}
+		};
 
-		} else {
-
-			inputs = {};
-
-			for ( const input of layout.inputs ) {
-
-				inputs[ input.name ] = new ParameterNode( input.type, input.name );
+		for ( const input of layout.inputs ) {
 
-			}
+			inputs[ input.name ] = new ParameterNode( input.type, input.name );
 
 		}
 

+ 0 - 6
src/nodes/shadernode/ShaderNode.js

@@ -376,12 +376,6 @@ class ShaderNodeInternal extends Node {
 
 	}
 
-	get isArrayInput() {
-
-		return /^\((\s+)?\[/.test( this.jsFunc.toString() );
-
-	}
-
 	setLayout( layout ) {
 
 		this.layout = layout;

粤ICP备19079148号