When embedding a ShapeDiver iframe, several options related to the embedding behaviour, the appearance and the parameter widgets are available. The Model pages will soon include an iframe customizer to control those parameters and generate automatically the proper iframe code, but users can already copy and paste those parameters manually in the iframe code and activate the various options.
Setting an option in the iframe code
Let's take a typical ShapeDiver iframe code, before any customization is done:
<iframe id="sdv-iframe" width="100%" height="480" src="//viewer.shapediver.com/v2/2.5.0/iframe/remote.html?modelViewUrl=eu-central-1&ticket=MODEL_TICKET" referrerpolicy="origin" allowfullscreen="" scrolling="no" style="overflow-x: hidden; overflow-y: hidden; border-width: 0;">
One can already play with the DOM-level properties of the iframe such as the id, width and height and styling options for example. In order to define ShapeDiver embedding options, we have to consider the src property of the iframe, which contains the URL to the model that will be embedded. As described above, this url looks as follows:
On your model pages, you will notice that the MODEL_TICKET is usually a very long number that contains all the encrypted information about the model and its permissions. Embedding options can be added right after this number, separeted by a & character. Let's say we want to set an option called 'customOption' to be true, just include it like this:
Now let's review a couple of actual options of the viewer.
Remove the ShapeDiver branding
By default, the ShapeDiver logo is shown at the beginning, while the model is loading. This can be changed by setting the option 'brandedMode' to false.
Show the parameter widget when the viewer is loaded
By default, the viewer loads the 3D scene alone, hiding all control widgets. If one wants to open the model with the ShapeDiver native parameter widget for example, simply set the 'showControlsInitial' option to true:
Note that, of course, several options can be set back to back in the URL.