Skip to content

Commit

Permalink
NodeMaterialObserver: Detect geometry exchange. (#30409)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Jan 27, 2025
1 parent d188114 commit edc26d4
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/materials/nodes/manager/NodeMaterialObserver.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ class NodeMaterialObserver {
data = {
material: this.getMaterialData( material ),
geometry: {
id: geometry.id,
attributes: this.getAttributesData( geometry.attributes ),
indexVersion: geometry.index ? geometry.index.version : null,
drawRange: { start: geometry.drawRange.start, count: geometry.drawRange.count }
Expand Down Expand Up @@ -362,6 +363,13 @@ class NodeMaterialObserver {
const storedAttributeNames = Object.keys( storedAttributes );
const currentAttributeNames = Object.keys( attributes );

if ( storedGeometryData.id !== geometry.id ) {

storedGeometryData.id = geometry.id;
return false;

}

if ( storedAttributeNames.length !== currentAttributeNames.length ) {

renderObjectData.geometry.attributes = this.getAttributesData( attributes );
Expand Down

0 comments on commit edc26d4

Please sign in to comment.