Skip to main content

model

A 3D model uploaded as product media.


Tip

Use the model_viewer_tag filter to output a Google model viewer component for the model.


Properties

The alt text of the model.

The ID of the model.

The media type of the model. Always returns model.

Example
Filter for media of a specific type

You can use the media_type property with the where filter to filter the product.media array for all media of a desired type.

{% assign models = product.media | where: 'media_type', 'model' %}

{% for model in models %}
{{- model | model_viewer_tag }}
{% endfor %}

Output

<model-viewer src="//polinas-potent-potions.myshopify.com/cdn/shop/3d/models/o/eb9388299ce0557c/WaterBottle.glb?v=0" camera-controls="true" style="--poster-color: transparent;" data-shopify-feature="1.12" alt="Potion bottle" poster="//polinas-potent-potions.myshopify.com/cdn/shop/products/WaterBottle_small.jpg?v=1655189057"></model-viewer>

The position of the model in the product.media array.

Anchor to
preview_image

A preview image for the model.

Anchor to
sources
array of model_source

The source files for the model.

{
"alt": "Potion bottle",
"id": 22064203137089,
"media_type": "model",
"position": 1,
"preview_image": {},
"sources": []
}
Was this section helpful?