• Plattform
  • Content Creation
  • API
  • Plattform
  • Content Creation
  • API
  • API Documentation
    • Introduction
    • Viewer Parameters
  • Viewer Functions
    • Animations
      • showAnimationTriggers()
      • hideAnimationTriggers()
      • triggerAnimation()
    • Annotations
      • showAnnotationTriggers()
      • hideAnnotationTriggers()
    • Controls
      • startViewer()
      • stopViewer()
    • Camera
      • resetView()
      • moveCamera()

triggerAnimation()

30 views 0

This function triggers an animation.

Parameter

action: “triggerAnimation”
animationId: number    – id of the animation to be triggered

Example

<div class="augmenteers-embed-wrapper">
  <iframe id="augmenteersIframe"
          src="https://viewer.augmenteers.com/embedded-model/b5ee0af5ec2cd3a3d19a373d03b19d0a?autostart=true&controls=false&btn_start=false&viewer_api=true"
          frameborder="0" allow="fullscreen" mozallowfullscreen="true" webkitallowfullscreen="true">
  </iframe>
</div>

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

  function triggerAnimation1() {
    iframe.postMessage({action: "triggerAnimation", animationId: 1}, "*");
  }

  function triggerAnimation2() {
    iframe.postMessage({action: "triggerAnimation", animationId: 2}, "*");
  }
</script>

<button onclick="triggerAnimation1()">
  Play Animation 1
</button>

<button onclick="triggerAnimation2()">
  Play Animation 2
</button>
Play Animation 1
Play Animation 2
Related Articles
  • Viewer Parameters
  • moveCamera()
  • resetView()
  • hideAnimationTriggers()
  • showAnimationTriggers()
  • hideAnnotationTriggers()