
#############################
A3DGlobalGetGraphMaterialData
#############################

.. c:function:: A3DStatus A3DGlobalGetGraphMaterialData(const A3DUns32 uiIndexMaterial, A3DGraphMaterialData *pData)

   .. rst-class:: sig-pretty-signature
   
      | :c:enum:`~A3DStatus` A3DGlobalGetGraphMaterialData(*const* :c:type:`~A3DUns32` **uiIndexMaterial**\ , :c:struct:`~A3DGraphMaterialData`\ \* **pData**\ )
   
   Retrieves an indexed RGB color.
   
   
      2.0
   
   
   HOOPS stores materials in a global state using indexes. When given an index, call ``A3DGlobalGetGraphMaterialData`` to fill in an ``A3DGraphMaterialData`` instance.
   
   .. code-block:: c
   
      // Retrieves the material data at index 3:
      A3DGraphMaterialData material_data = A3D_MAKE_DATA(A3DGraphMaterialData);
      A3DStatus result = A3DGlobalGetGraphMaterialData(3, &material_data);
      assert(result == A3D_SUCCESS);
   
   **Return Values**
   
   
      **A3D_SUCCESS**\ : in case of success.
   
      **A3D_INITIALIZE_NOT_CALLED**\ : if the library is not initialized
   
      **A3D_INVALID_MATERIAL_INDEX**\ : if the material index does not match any existing.
   
      **A3D_INVALID_DATA_STRUCT_NULL**\ : if ``pData`` is null.
   
      **A3D_INVALID_DATA_STRUCT_SIZE**\ : if ``pData`` is incorrectly initialized
   
   
   
      This function allows getting basic material data from its index in the global state. To retrieve the underlying material entity, use ``A3DMiscPointerFromIndexGet`` as stated in the documentation for ``A3DGraphMaterialData``
   
   
   
      ``A3DGlobalInsertGraphMaterial``
   
   
   
      ``A3DGraphMaterialData``
   
   
   
      ``A3DMiscPointerFromIndexGet``
   
   
   **Parameters**
   
   
      **uiIndexMaterial**\ : The index of the material
   
      **pData**\ : The ``A3DGraphMaterialData`` to fill in.
   
   
   **Returns**
   
   
      ``A3D_SUCCESS`` or an error code in case of failure.
   
   




