
################
MeshInstanceData
################

.. js:class:: MeshInstanceData

   Object representing a Mesh instance that will be created by the client at run time. This class allows for the specification of instance specific properties of a mesh.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~MeshInstanceData.constructor`
   
   .. rubric:: Properties
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:data:`~MeshInstanceData.overlayId`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~MeshInstanceData.clear`
   * :js:meth:`~MeshInstanceData.copy`
   * :js:meth:`~MeshInstanceData.getCreationFlags`
   * :js:meth:`~MeshInstanceData.getFaceColor`
   * :js:meth:`~MeshInstanceData.getInstanceName`
   * :js:meth:`~MeshInstanceData.getLineColor`
   * :js:meth:`~MeshInstanceData.getLineOpacity`
   * :js:meth:`~MeshInstanceData.getMatrix`
   * :js:meth:`~MeshInstanceData.getMeshId`
   * :js:meth:`~MeshInstanceData.getOpacity`
   * :js:meth:`~MeshInstanceData.getOverlayIndex`
   * :js:meth:`~MeshInstanceData.getPointColor`
   * :js:meth:`~MeshInstanceData.getPointOpacity`
   * :js:meth:`~MeshInstanceData.setCreationFlags`
   * :js:meth:`~MeshInstanceData.setFaceColor`
   * :js:meth:`~MeshInstanceData.setInstanceName`
   * :js:meth:`~MeshInstanceData.setLineColor`
   * :js:meth:`~MeshInstanceData.setLineOpacity`
   * :js:meth:`~MeshInstanceData.setMatrix`
   * :js:meth:`~MeshInstanceData.setMeshId`
   * :js:meth:`~MeshInstanceData.setOpacity`
   * :js:meth:`~MeshInstanceData.setOverlayIndex`
   * :js:meth:`~MeshInstanceData.setPointColor`
   * :js:meth:`~MeshInstanceData.setPointOpacity`
   
   




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

.. js:method:: MeshInstanceData.constructor

   .. rst-class:: sig-pretty-signature
   
      | MeshInstanceData(**meshId**\ : (*None* \| :js:data:`MeshId <Sc.MeshId>`\ ), **matrix**\ : (*None* \| :js:class:`~Matrix`\ ), **instanceName**\ : (*None* \| *string*\ ), **faceColor**\ : (*None* \| :js:class:`~Color`\ ), **lineColor**\ : (*None* \| :js:class:`~Color`\ ), **pointColor**\ : (*None* \| :js:class:`~Color`\ ), **creationFlags**\ : (*None* \| :js:data:`~MeshInstanceCreationFlags`\ )): :js:class:`~MeshInstanceData`
   
   Creates a new MeshInstanceData object.
   
   **Parameters**
   
      **meshId**\ : (*None* \| :js:data:`MeshId <Sc.MeshId>`\ )
   
         the [[MeshId]] of the mesh to instantiate
   
   
      **matrix**\ : (*None* \| :js:class:`~Matrix`\ )
   
         a matrix that will be applied to this instance
   
   
      **instanceName**\ : (*None* \| *string*\ )
   
         a name that will be visible when querying the model hierarchy
   
   
      **faceColor**\ : (*None* \| :js:class:`~Color`\ )
   
         the color for faces of this instance
   
   
      **lineColor**\ : (*None* \| :js:class:`~Color`\ )
   
         the color for lines of this instance
   
   
      **pointColor**\ : (*None* \| :js:class:`~Color`\ )
   
         the color for points of this instance
   
   
      **creationFlags**\ : (*None* \| :js:data:`~MeshInstanceCreationFlags`\ )
   
         additional options that can be used to alter the behavior of this instance
   
   
   
   **Returns**\ : :js:class:`~MeshInstanceData`
   





Properties
==========

.. js:data:: MeshInstanceData.overlayId

   .. rst-class:: sig-pretty-signature
   
      | overlayId: :js:class:`OverlayId <Sc.OverlayId>`
   
   The overlay for this instance.
   





Methods
=======

.. js:method:: MeshInstanceData.clear

   .. rst-class:: sig-pretty-signature
   
      | clear(): *void*
   
   Resets all fields of this object.
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.copy

   .. rst-class:: sig-pretty-signature
   
      | copy(): :js:class:`~MeshInstanceData`
   
   Creates a copy of this MeshInstanceData.
   
   **Returns**\ : :js:class:`~MeshInstanceData`
   
      Copy of this MeshInstanceData object.
   
   



.. js:method:: MeshInstanceData.getCreationFlags

   .. rst-class:: sig-pretty-signature
   
      | getCreationFlags(): :js:data:`~MeshInstanceCreationFlags`
   
   Gets the mesh instance creation flags (SuppressCameraScale, DoNotExplode, DoNotLight...)
   
   **Returns**\ : :js:data:`~MeshInstanceCreationFlags`
   
      the mesh instance creation flags (null if none set)
   
   



.. js:method:: MeshInstanceData.getFaceColor

   .. rst-class:: sig-pretty-signature
   
      | getFaceColor(): (*None* \| :js:class:`~Color`\ )
   
   Gets the color for face elements in this instance.
   
   **Returns**\ : (*None* \| :js:class:`~Color`\ )
   
      the color for face elements.
   
   



.. js:method:: MeshInstanceData.getInstanceName

   .. rst-class:: sig-pretty-signature
   
      | getInstanceName(): (*None* \| *string*\ )
   
   Gets the name that will be applied to the instance.
   
   **Returns**\ : (*None* \| *string*\ )
   
      the instance name.
   
   



.. js:method:: MeshInstanceData.getLineColor

   .. rst-class:: sig-pretty-signature
   
      | getLineColor(): (*None* \| :js:class:`~Color`\ )
   
   Gets the color for line elements in this instance.
   
   **Returns**\ : (*None* \| :js:class:`~Color`\ )
   
      the color for line elements.
   
   



.. js:method:: MeshInstanceData.getLineOpacity

   .. rst-class:: sig-pretty-signature
   
      | getLineOpacity(): *number*
   
   Gets the line opacity value for this instance.
   
   **Returns**\ : *number*
   
      the line opacity value for this instance.
   
   



.. js:method:: MeshInstanceData.getMatrix

   .. rst-class:: sig-pretty-signature
   
      | getMatrix(): (*None* \| :js:class:`~Matrix`\ )
   
   Gets the matrix to apply to this instance.
   
   **Returns**\ : (*None* \| :js:class:`~Matrix`\ )
   
      the current matrix that will be applied to this instance upon creation.
   
   



.. js:method:: MeshInstanceData.getMeshId

   .. rst-class:: sig-pretty-signature
   
      | getMeshId(): (*None* \| :js:data:`MeshId <Sc.MeshId>`\ )
   
   Gets the [[MeshId]] of the mesh to use for this instance. [[MeshId]]s are created with [[Model.createMesh]] or retrieved with [[Model.getMeshIds]].
   
   **Returns**\ : (*None* \| :js:data:`MeshId <Sc.MeshId>`\ )
   
      the mesh ID to use for this instance.
   
   



.. js:method:: MeshInstanceData.getOpacity

   .. rst-class:: sig-pretty-signature
   
      | getOpacity(): *number*
   
   Gets the face opacity value for this instance.
   
   **Returns**\ : *number*
   
      the face opacity value for this instance.
   
   



.. js:method:: MeshInstanceData.getOverlayIndex

   .. rst-class:: sig-pretty-signature
   
      | getOverlayIndex(): *number*
   
   Gets the overlay index for this instance.
   
   **Deprecated**
   
      use [[overlayId]] instead.
   
   
   **Returns**\ : *number*
   
      the overlay index for this instance, but not the associated view.
   
   



.. js:method:: MeshInstanceData.getPointColor

   .. rst-class:: sig-pretty-signature
   
      | getPointColor(): (*None* \| :js:class:`~Color`\ )
   
   Gets the color for point elements in this instance.
   
   **Returns**\ : (*None* \| :js:class:`~Color`\ )
   
      the color for point elements.
   
   



.. js:method:: MeshInstanceData.getPointOpacity

   .. rst-class:: sig-pretty-signature
   
      | getPointOpacity(): *number*
   
   Gets the point opacity value for this instance.
   
   **Returns**\ : *number*
   
      the point opacity value for this instance.
   
   



.. js:method:: MeshInstanceData.setCreationFlags

   .. rst-class:: sig-pretty-signature
   
      | setCreationFlags(**flags**\ : :js:data:`~MeshInstanceCreationFlags`\ ): *void*
   
   Sets the mesh instance creation flags (SuppressCameraScale, DoNotExplode, DoNotLight...)
   
   **Parameters**
   
      **flags**\ : :js:data:`~MeshInstanceCreationFlags`
   
         creation flags
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setFaceColor

   .. rst-class:: sig-pretty-signature
   
      | setFaceColor(**faceColor**\ : :js:class:`~Color`\ ): *void*
   
   Sets the color for face elements in this instance.
   
   **Parameters**
   
      **faceColor**\ : :js:class:`~Color`
   
         the color to apply to face elements.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setInstanceName

   .. rst-class:: sig-pretty-signature
   
      | setInstanceName(**instanceName**\ : *string*\ ): *void*
   
   Sets the name that will be assigned to this instance. This name will be visible when querying the model hierarchy.
   
   **Parameters**
   
      **instanceName**\ : *string*
   
         the name to assign to this instance.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setLineColor

   .. rst-class:: sig-pretty-signature
   
      | setLineColor(**lineColor**\ : :js:class:`~Color`\ ): *void*
   
   Sets the color for line elements in this instance.
   
   **Parameters**
   
      **lineColor**\ : :js:class:`~Color`
   
         the color to apply to line elements.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setLineOpacity

   .. rst-class:: sig-pretty-signature
   
      | setLineOpacity(**lineOpacity**\ : *number*\ ): *void*
   
   Sets the line opacity for this instance.
   
   **Parameters**
   
      **lineOpacity**\ : *number*
   
         opacity value to set.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setMatrix

   .. rst-class:: sig-pretty-signature
   
      | setMatrix(**matrix**\ : :js:class:`~Matrix`\ ): *void*
   
   Sets the matrix that will be applied to this instance.
   
   **Parameters**
   
      **matrix**\ : :js:class:`~Matrix`
   
         the matrix to apply.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setMeshId

   .. rst-class:: sig-pretty-signature
   
      | setMeshId(**meshId**\ : :js:data:`MeshId <Sc.MeshId>`\ ): *void*
   
   Sets the [[MeshId]] of the mesh to use for the instance. [[MeshId]]s are created with [[Model.createMesh]] or retrieved with [[Model.getMeshIds]].
   
   **Parameters**
   
      **meshId**\ : :js:data:`MeshId <Sc.MeshId>`
   
         the [[MeshId]] to use.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setOpacity

   .. rst-class:: sig-pretty-signature
   
      | setOpacity(**faceOpacity**\ : *number*\ ): *void*
   
   Sets the face opacity for this instance.
   
   **Parameters**
   
      **faceOpacity**\ : *number*
   
         opacity value to set.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setOverlayIndex

   .. rst-class:: sig-pretty-signature
   
      | setOverlayIndex(**overlayIndex**\ : *number*\ ): *void*
   
   Sets the overlay index for this instance but doesn't change the associated view.
   
   **Deprecated**
   
      use [[overlayId]] instead.
   
   
   **Parameters**
   
      **overlayIndex**\ : *number*
   
         overlay index to set.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setPointColor

   .. rst-class:: sig-pretty-signature
   
      | setPointColor(**pointColor**\ : :js:class:`~Color`\ ): *void*
   
   Sets the color for point elements in this instance.
   
   **Parameters**
   
      **pointColor**\ : :js:class:`~Color`
   
         the color to apply to point elements.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: MeshInstanceData.setPointOpacity

   .. rst-class:: sig-pretty-signature
   
      | setPointOpacity(**pointOpacity**\ : *number*\ ): *void*
   
   Sets the point opacity for this instance.
   
   **Parameters**
   
      **pointOpacity**\ : *number*
   
         opacity value to set.
   
   
   
   **Returns**\ : *void*
   





