Look Files (OpScript)
=====================

.. lua:module:: LookFile

.. lua:function:: GetLookFile(string filePath[, string passName])

   Returns a :lua:class:`LookFile` object built loading the specified file
   path. If a *passName* is given, only the attribute for that pass will be
   loaded.

.. lua:function:: GetPassNamesForLookFileAsset(string asset)

   Returns a :lua:class:`StringAttribute` containing all the pass names stored
   in the given asset file.

.. lua:function:: GetSafePath(string asset, boolean includeVersion)

   Returns a location path built according the given asset Id.
   If *includeVersion* is `true`, the asset version will be resolved and
   appended to the resulting location path.

LookFile Objects
----------------

.. lua:class:: LookFile

   Class representing a Look File. Note that this is not instantiable directly
   - instead use :lua:func:`GetLookFile`.

   .. lua:method:: getAttrs(string locationName[, string rootId])

      Returns an :lua:class:`AttrMap` containing the attributes stored at the
      given *locationName* for the given *rootId*.

   .. lua:method:: getMaterial(string name[, boolean global])

      Returns an attribute containing the material definition for the given
      material name. If the *global* parameter is set to `false`, only the
      location defined by the given name will be considered, otherwise the
      first matching upstream material attribute will be returned.

   .. lua:method:: getMaterials()

      Returns an :lua:class:`AttrMap` containing all the materials stored in
      the LookFile.

   .. lua:method:: getMaterialType(string materialName)

      Returns the material type for the specified material name.

   .. lua:method:: getPathsWithOverrides([string rootId])

      Returns a :lua:class:`StringAttribute` containing the list of locations
      with overrides for the given rootId.

   .. lua:method:: getRootIdNames()

      Returns a :lua:class:`StringAttribute` containing the list of root
      locations.

   .. lua:method:: getRootIdType(string rootId)

      Returns the type of the location specified by the given root Id.

   .. lua:method:: getRootOverrides()

      Returns an :lua:class:`AttrMap` containing attribute overrides for the
      root locations stored in LookFile.

AttrMap Objects
---------------

.. lua:class:: AttrMap

   .. lua:method:: getKeys()

      Returns a :lua:class:`StringAttribute` containing the keys for the
      material elements stored in the :lua:class:`AttrMap`.

   .. lua:method:: get(string key)

      Returns an attribute containing the material definition for the given
      key.