Ops and Proxies
===============

Deferred Ops
------------

The effect of certain nodes and operations can be deferred until render time.
This is done by adding an ``ops`` attribute group to the target scene graph
location, specifying the operations to run. Nodes that support deferred
evaluation include :kat:node:`OpScript` and :kat:node:`GenericOp`. Deferred
operations are run by the :kat:node:`OpResolve` node/op, which is part of the
implicit resolver chain.

.. list-table::
    :header-rows: 1
    :widths: 5 20 75

    - * Type
      * Attribute
      * Description

    - * :kat:type:`group`
      * :kat:attr:`ops.<modifier>`
      * A group specifying a single Op to run. The modifier name is
        user-chosen and has no special meaning.

    - * :kat:type:`string`
      * :kat:attr:`ops.<modifier>.opType`
      * The type of Op to run.

    - * :kat:type:`group`
      * :kat:attr:`ops.<modifier>.opArgs`
      * The arguments to the Op. Varies by Op type.

    - * :kat:type:`float`
        :kat:type:`float`
        :kat:type:`float`
        :kat:type:`int`
      * :kat:attr:`ops.<modifier>.opArgs.system.timeSlice.currentTime`
        :kat:attr:`ops.<modifier>.opArgs.system.timeSlice.shutterOpen`
        :kat:attr:`ops.<modifier>.opArgs.system.timeSlice.shutterClose`
        :kat:attr:`ops.<modifier>.opArgs.system.timeSlice.numSamples`
      * Referred to as *System Op Args*, these arguments are used by some Ops.

    - * :kat:type:`string[]`
      * :kat:attr:`ops.<modifier>.resolveIds`
      * List of *resolve IDs*. These are arbitrary string tags that are matched
        against the resolve IDs passed to :kat:node:`OpResolve`. Two resolve
        IDs - ``lookfileresolve`` and ``implicit_preprocess`` - are processed
        at the beginning of the implicit resolver chain.

    - * :kat:type:`int`
      * :kat:attr:`ops.<modifier>.recursiveEnable`
      * If ``1``, the deferred Op is also run against descendant locations.
        When this attribute is encountered at a descendant location with a
        value of ``0``, recursion does not continue below that location.

.. _deferred-material-ops:

Deferred Material Ops
---------------------

Ops can also be run at material resolve time. The attribute convention is the
same as above, except that ops are nested under a ``material.ops`` group,
rather than ``ops``.

Viewer Proxy Ops
----------------

A similar convention can also be used to specify viewer proxies for scene graph
locations.

.. list-table::
    :header-rows: 1
    :widths: 5 20 75

    - * Type
      * Attribute
      * Description

    - * :kat:type:`int`
      * :kat:attr:`proxies.viewer.currentFrame`
        :kat:attr:`proxies.viewer.firstFrame`
        :kat:attr:`proxies.viewer.lastFrame`
      * Sets the frame range for which the proxy is active.

    - * :kat:type:`int`
      * :kat:attr:`proxies.viewer.static`
      * If set to ``1``, the proxy is considered non-animated.

    - * :kat:type:`group`
      * :kat:attr:`proxies.viewer.<modifier>`
      * A group specifying a single Op to use for a proxy. See above for
        further details.