Skip to content

Commit

Permalink
fix: renderlayers get updated with stale data from material manager (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
christjt authored May 29, 2024
1 parent e86246f commit f2a2050
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions viewer/packages/cad-model/src/wrappers/CadNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export class CadNode extends Object3D {
this._sourceTransform = new Matrix4().copy(model.modelMatrix);
this._customTransform = new Matrix4();

this.nodeAppearanceProvider.on('changed', this._setModelRenderLayers);
this.materialManager.on('materialsChanged', this._setModelRenderLayers);
}

get needsRedraw(): boolean {
Expand Down Expand Up @@ -210,7 +210,7 @@ export class CadNode extends Object3D {

public dispose(): void {
this.nodeAppearanceProvider.dispose();
this.nodeAppearanceProvider.off('changed', this._setModelRenderLayers);
this.materialManager.off('materialsChanged', this._setModelRenderLayers);
this._sectorRepository.clearCache();
this._materialManager.removeModelMaterials(this._cadModelMetadata.modelIdentifier);
this._geometryBatchingManager?.dispose();
Expand Down

0 comments on commit f2a2050

Please sign in to comment.