Keep Shapediver iframe link when updating model

Any time a model is updated (which requires a new upload), a new iframe is generated. How do I manually define the iframe, so that I can keep the link? This way, since we are embedding the iframe in a website, I wouldn’t have to constantly change the link with every model update.

We are planning to improve model versioning in the future, but this is already possible using a couple of steps: if you look at your iframe embedding code, you will noticed that is just points to the URL of your model on the ShapeDiver platform, for example:

<iframe id="sdv-iframe" width="100%" height="480" src="https://www.shapediver.com/app/iframe/MODEL_SLUG?primaryColor=%23317DD4&secondaryColor=%23393A45&surfaceColor=%23FFFFFF&backgroundColor=%23F8F8F8&showControls=1&showZoomButton=1&showFullscreenButton=1&showToggleControlsButton=1&hideDataOutputsIframe=1&hideAttributeVisualizationIframe=1&parametersDisable=1&parametersValidation=0" referrerpolicy="origin" allowfullscreen style="overflow-x: hidden; overflow-y: hidden; border-width: 0;">
    <p>Your browser does not support iframes.</p>
</iframe>

The MODEL_SLUG in the code above can be edited for each of your ShapeDiver models. Therefore you could do the following:

  • Upload your new model to ShapeDiver.
  • Change the slug of the old version of the model to something else (for example MODEL_SLUG_old)
  • Then, change the slug of the new version you just uploaded to MODEL_SLUG

If you then reload your website, it should point to the new model without having to change the embedding code there.

Let me know if this solution works for you.