Skip to content

Commit

Permalink
Use setDataLibrary in Web Viewer (#2138)
Browse files Browse the repository at this point in the history
This changelist updates the Web Viewer to use Document::setDataLibrary rather than Document::importLibrary, improving the efficiency of document loading.
  • Loading branch information
jstone-lucasfilm authored Dec 10, 2024
1 parent 31d8240 commit bc2466e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions javascript/MaterialXView/source/viewer.js
Original file line number Diff line number Diff line change
Expand Up @@ -606,7 +606,7 @@ export class Material
// Re-initialize document
var startDocTime = performance.now();
var doc = mx.createDocument();
doc.importLibrary(viewer.getLibrary());
doc.setDataLibrary(viewer.getLibrary());
viewer.setDocument(doc);

const fileloader = viewer.getFileLoader();
Expand Down Expand Up @@ -1491,7 +1491,7 @@ export class Viewer

this.document = this.mx.createDocument();
this.stdlib = this.mx.loadStandardLibraries(this.genContext);
this.document.importLibrary(this.stdlib);
this.document.setDataLibrary(this.stdlib);

this.initializeLighting(renderer, radianceTexture, irradianceTexture, lightRigXml);

Expand Down

0 comments on commit bc2466e

Please sign in to comment.