Shopify / screenshot-glb

A command line utility for taking screenshots of glTF 2.0 Binary 3D model files
121 stars 28 forks source link

Made model viewer load from cdn #70

Closed mikkoh closed 2 years ago

mikkoh commented 2 years ago

This PR makes it so that Model Viewer is always loaded from the CDN.

What this means is that we never need to update Model Viewer in this package but rather just update our CDN distribution.

By default Screenshot GLB will use the "latest" version of Model Viewer which is distributed on our CDN: https://cdn.shopify.com/shopifycloud/model-viewer/model-viewer.js

However the user can pass in a version using the cli params -@ or --model_viewer_version.

I've made it so that you can pass version strings in the following forms:

Before rendering I also check the file exists on our CDN. So if you pass 1.0 an exception will be thrown.

mikkoh commented 2 years ago

@sleroux that's what I'm thinking. 3D Service is next.

The downside of is that we're creating one failure point. So let's say that model-viewer.js doesn't build properly then everything breaks. But the most volatile part is the screenshots and we'll have the ability to regenerate those if there is a failure.

We might want to add some sort of alarms around our SSIM tests to catch it quick.