Skip to content

Commit edc26d4

Browse files
authored
NodeMaterialObserver: Detect geometry exchange. (#30409)
1 parent d188114 commit edc26d4

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/materials/nodes/manager/NodeMaterialObserver.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ class NodeMaterialObserver {
143143
data = {
144144
material: this.getMaterialData( material ),
145145
geometry: {
146+
id: geometry.id,
146147
attributes: this.getAttributesData( geometry.attributes ),
147148
indexVersion: geometry.index ? geometry.index.version : null,
148149
drawRange: { start: geometry.drawRange.start, count: geometry.drawRange.count }
@@ -362,6 +363,13 @@ class NodeMaterialObserver {
362363
const storedAttributeNames = Object.keys( storedAttributes );
363364
const currentAttributeNames = Object.keys( attributes );
364365

366+
if ( storedGeometryData.id !== geometry.id ) {
367+
368+
storedGeometryData.id = geometry.id;
369+
return false;
370+
371+
}
372+
365373
if ( storedAttributeNames.length !== currentAttributeNames.length ) {
366374

367375
renderObjectData.geometry.attributes = this.getAttributesData( attributes );

0 commit comments

Comments
 (0)