loadMaterialSettings()

This function load new settings for a specific material.


Parameters:

  • action: "loadMaterialSettings"
  • materialId: number    - id of the material to apply new settings for
  • settingsId: number    - id of the settings to be applied

Example

<div class="vrxs-embed-wrapper">
  <iframe id="vrxsIframe"
          src="https://viewer.vrxs.de/embedded-model/ModelID?autoplay=true&controls=false&btn_start=false&enable_viewer_api=true"
          frameborder="0" allow="fullscreen" mozallowfullscreen="true" webkitallowfullscreen="true">

  </iframe>
</div>

<script type="text/javascript">
  const iframe = document.getElementById("vrxsIframe").contentWindow;

  function loadMaterialSettings(materialId, settingsId) {
    iframe.postMessage({action: "loadMaterialSettings", materialId: materialId, settingsId: settingsId}, "*");
  }

</script>
<button onclick="loadMaterialSettings(2, 2)">
  Gold
</button>

A side


B side