Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: renderlayers get updated with stale data from material manager #4550

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading