[Vuejs]-Coloring model in Forge viewer gives Cannot read properties of undefined (reading 'setThemingColor')

1👍

From my understanding, It’s because you run setThemingColor before loadDocumentNode finish.

Can you try to put viewer.setThemingColor(...) into the loadDocumentNode()’s callback function ? just to ensure you set the color after the model is fully loaded.

like this :

this.viewer.loadDocumentNode(viewer_document, default_model)
.then(() => {
    //when document node loaded, do...
    this.viewer.setThemingColor(4, new THREE.Vector4(1, 0, 0, 0.5), this.model, true);
})

Leave a comment