Skip to content

Instantly share code, notes, and snippets.

@milesw
Last active April 22, 2022 13:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save milesw/f386067fab2f50798b5c58d84226b6aa to your computer and use it in GitHub Desktop.
Save milesw/f386067fab2f50798b5c58d84226b6aa to your computer and use it in GitHub Desktop.
Specify environment image on Shopify 3D model
{% comment %} Before {% endcomment %}
{{ media | model_viewer_tag: image_size: '1024x', reveal: 'interaction', toggleable: true }}
{% comment %} After {% endcomment %}
{%- assign environment_image = settings.models_environment_image | default: 'neutral' -%}
{{ media | model_viewer_tag: image_size: '1024x', reveal: 'interaction', toggleable: true, environment-image: environment_image }}
{
"name": "3D Models",
"settings": [
{
"label": "Environment image URL",
"type": "url",
"id": "models_environment_image",
"info": "Provide an environment image to set the lighting in the 3D viewer. Image should be in HDR format. If no image URL is provided, the \"neutral\" setting will be used."
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment