I'm trying to assign the texture from a canvas(fabric.js) to model-viewer's baseColorTexture. But no luck. And the error is Paused on promise rejection. I need guidance. Thanks
var img = new Image();
img.src = document.getElementById('canvas').toDataURL('image/jpeg', 1.0);
const modelViewerTexture = document.querySelector('model-viewer');
modelViewerTexture.model.materials[0].pbrMetallicRoughness['baseColorTexture'].texture.source.setURI(img);
I found the solution already