From 9a2bcad3798dbaae8233b7253a358549cbe5cce6 Mon Sep 17 00:00:00 2001 From: Mugen87 Date: Wed, 1 Nov 2023 21:08:40 +0100 Subject: [PATCH] WebGLNodes: Simpify `onBuild()`. --- .../jsm/renderers/webgl-legacy/nodes/WebGLNodes.js | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js b/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js index 9f5f3f842da875..dd9864194dd203 100644 --- a/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js +++ b/examples/jsm/renderers/webgl-legacy/nodes/WebGLNodes.js @@ -10,19 +10,7 @@ Material.prototype.onBuild = function ( object, parameters, renderer ) { const material = this; - if ( Array.isArray( material ) ) { - - for ( const m of material ) { - - if ( m.isNodeMaterial === true ) { - - builders.set( m, new WebGLNodeBuilder( object, renderer, parameters, m ).build() ); - - } - - } - - } else if ( material.isNodeMaterial === true ) { + if ( material.isNodeMaterial === true ) { builders.set( material, new WebGLNodeBuilder( object, renderer, parameters, material ).build() );