3D model viewer plugin

It’s been a while that I have touched this but I was almost there. I managed to load the model locally with a custom code block, I was even creating a plugin for it but I got stuck.

The problem I’ve come across now, as I have described here is that if the model-viewer leaves the view (scrolling the page) it stops working, probably due to how Obsidian deals with lazy loading the content. It removes parts of the page that are not in view and reinserts them when necessary, unfortunately this breaks model-viewer as it doesn’t automatically reload the model when it’s scrolled into view once again. I’m trying to find a workaraound, if anyone have some tip.

Here’s what I got so far:

ezgif-2-f2974b4383