@@ -80,9 +80,6 @@ class NodeMesh {
8080
8181 this . hasIndex = this . geometry . index != null ;
8282
83- // @ts -ignore: Monkey patching material, workaround for github.com/mrdoob/three.js/issues/12132
84- this . material . version = 0 ;
85-
8683 this . mesh = new T ( geometry , this . material ) ;
8784
8885 // We need to set this to false because we directly play with the position matrix
@@ -140,11 +137,8 @@ class NodeMesh {
140137 this . material . flatShading = true ;
141138 this . material . side = THREE . DoubleSide ;
142139
143- // @ts -ignore
144140 this . material . position = position ;
145- // @ts -ignore
146141 this . material . alpha = alpha ;
147- // @ts -ignore
148142 this . material . color = color ;
149143
150144 // Workaround for https://github.com/mrdoob/three.js/issues/18152
@@ -156,9 +150,6 @@ class NodeMesh {
156150 this . material . alphaTest = 0.1 ;
157151
158152 this . material . build ( ) ;
159-
160- // @ts -ignore
161- this . material . version ++ ;
162153 }
163154
164155 copy ( ) {
@@ -237,7 +228,7 @@ class NodeMesh {
237228 const vertex = this . geometry . getAttribute ( 'position' ) . array ;
238229
239230 let indices : ArrayLike < number > ;
240- if ( this . hasIndex ) {
231+ if ( this . hasIndex && this . geometry . index !== null ) {
241232 indices = this . geometry . index . array ;
242233 } else {
243234 indices = Array . from ( Array ( vertex . length / 3 ) . keys ( ) ) ;
@@ -284,7 +275,7 @@ class NodeMesh {
284275 newIndices [ 3 * i + 2 ] = indices [ 3 * triangleIndex + 2 ]
285276 }
286277
287- if ( this . hasIndex ) {
278+ if ( this . hasIndex && this . geometry . index !== null ) {
288279 this . geometry . index . set ( newIndices ) ;
289280 this . geometry . index . needsUpdate = true ;
290281 } else {
@@ -300,7 +291,7 @@ class NodeMesh {
300291 }
301292
302293 geometry : THREE . BufferGeometry ;
303- material : Nodes . NodeMaterial ;
294+ material : Nodes . StandardNodeMaterial ;
304295 mesh : THREE . Object3D ;
305296 readonly data : Data [ ] ;
306297
0 commit comments