Closed hybridherbst closed 2 years ago
@kaischroeder I looked into this a bit more and while I can hack around and unlink the file plus stop rendering, it's not ideal - I think there's a missing method in the RenderDelegateInterface to clean up, e.g. to remove the meshes it has added into the three scene from the scene again.
It also seems that there's no scene hierarchy preserved from the USDZ right now in the ThreeJsRenderDelegate, it just adds everything as root-level meshes. I think it would be better to (Step 1) parent everything under one named Group (UsdStage?), and (Step 2) preserving the USD hierarchy would be great for future use.
(There's actually a little // FIXME comment in there)
window.scene.add(this._mesh); // FIXME
I changed a couple of things and can now properly unload models by
I also added automatic camera framing when loading models, which makes navigation a lot easier. I think this is a proper PR now and not just a draft, works pretty well on my end - you can test on https://prefrontalcortex.github.io/USD/usd_for_web_demos/test.html
This has been merged as #6
Description of Change(s)
Allows to quickly preview USDZ files and test the capabilities of the web port by dropping files onto the page.
Note that this is a DRAFT: the one piece that's still missing is unloading the existing file. Right now, each dragged file will be added to the scene.