.. role:: ts-api-decorator

#########
Animation
#########

.. js:module:: Animation
   :noindex:

.. container:: ts-api-section

   .. js:class:: Animation

      Structure encapsulating a specific animation



.. container:: api-index-section

   .. rubric:: Constructors

   .. rst-class:: api-index-list-item api-kind-constructor api-parent-kind-class

   * :js:meth:`~Animation.Animation.constructor`



.. container:: api-index-section

   .. rubric:: Properties

   .. rst-class:: api-index-list-item api-kind-property api-parent-kind-class

   * :js:attr:`~Animation.Animation.cameraChannels`
   * :js:attr:`~Animation.Animation.name`
   * :js:attr:`~Animation.Animation.nodeChannels`
   * :js:attr:`~Animation.Animation.pivotPoints`



.. container:: api-index-section

   .. rubric:: Methods

   .. rst-class:: api-index-list-item api-kind-method api-parent-kind-class

   * :js:meth:`~Animation.Animation.createCameraChannel`
   * :js:meth:`~Animation.Animation.createNodeChannel`
   * :js:meth:`~Animation.Animation.deleteChannel`





------------

Constructors
============

.. container:: ts-api-section

   .. js:function:: Animation.constructor( name)

      :param name: friendly name for the animation
      :type name: string


      Creates a new, empty Animation


      :rtype: Animation



Properties
==========

.. container:: ts-api-section

   .. js:attribute:: Animation.cameraChannels

      :type: [CameraChannel]





.. container:: ts-api-section

   .. js:attribute:: Animation.name

      :type: string

      friendly name for the animation



.. container:: ts-api-section

   .. js:attribute:: Animation.nodeChannels

      :type: [NodeChannel]





.. container:: ts-api-section

   .. js:attribute:: Animation.pivotPoints

      :type: Map <number, Point3>





Methods
=======

.. rst-class:: ts-api-section

createCameraChannel
-------------------

.. js:method:: Animation.createCameraChannel( name, property, sampler)

   :param name: friendly name for the channel.
   :type name: string
   :param property: the property that will be animated by this channel.
   :type property: CameraProperty
   :param sampler: sampler describing the buffer and interpolation type used.
   :type sampler: Sampler


   Creates a new camera animation channel.


   :rtype: CameraChannel

.. rst-class:: ts-api-section

createNodeChannel
-----------------

.. js:method:: Animation.createNodeChannel( name, target, property, sampler)

   :param name: friendly name for the channel.
   :type name: string
   :param target: id of node that will receive interpolated values.
   :type target: number
   :param property: the node property that will be animated.
   :type property: NodeProperty
   :param sampler: sampler describing the buffer and interpolation type.
   :type sampler: Sampler


   Creates a new node animation channel.


   :rtype: NodeChannel

.. rst-class:: ts-api-section

deleteChannel
-------------

.. js:method:: Animation.deleteChannel( channel)

   :param channel: None
   :type channel: NodeChannel | CameraChannel


   Removes a channel from this animation.

   Call [[Player.reload]] on any players that are referencing this animation.


   :rtype: void

