API

Table of contents
  1. Flair for Maya
    1. Commands
      1. alpha (a)
      2. benchmark (bch)
      3. channels (ch)
      4. cryptomattes (cry)
      5. environment (env)
      6. listOperations (lsO)
      7. listTargets (lsT)
      8. refresh (r)
      9. reloadOperationShaders (rOS)
      10. render (rnd)
      11. renderOperation (rOp)
      12. renderState (rS)
      13. resolution (res)
      14. state (s)
      15. target (t)
      16. version (v)
      17. Examples

The Flair API is divided in the different hosts Flair supports. Below you can find the available entrypoints to interact with Flair.

Flair for Maya

Commands

Long name (short name)

Argument types

Properties

alpha (a)

int

C

Toggles different alpha modes.

  • 0 - No alpha
  • 1 - Linear alpha
  • 2 - Premultiplied alpha

benchmark (bch)

int

C

Performs a benchmark for the amount of frames requested.

channels (ch)

list

C

Enables/disables visualization of RGBA channels in Flair.

Note: enabling alpha (A) channel will override all other channels.

cryptomattes (cry)

bool

C

Toggles rendering of cryptomattes in Flair.

environment (env)

bool, string

C

Returns the path to the Flair environment or to a folder within the Flair environment.

listOperations (lsO)

bool

C

Returns the list of render operations currently in use within Flair.

listTargets (lsT)

bool

C

Returns the list of render targets currently in use within Flair.

refresh (r)

bool

C

Reloads (recompiles) all post-processing shaders in Flair, refreshing the style.

reloadOperationShaders (rOS)

int

C

Reloads (recompiles) the shader used by the specified render operation in Flair.

render (rnd)

string

C

Filepath to render (save) image as.

Use in combination with the target flag to specify what targets to render.

renderOperation (rOp)

int

C

Returns if the specified render operation is enabled or disabled.

Use in combination with the state flag to enable/disable operation.

renderState (rS)

bool

C

Toggles the render state of Flair on/off.
Use in combination with the resolution flag to render at different resolutions.

resolution (res)

list

C Q

In query mode: returns the resolution Flair is rendering in (without render scale).

In combination with the renderState flag: Sets the rendering resolution in Flair.

state (s)

bool

C

Used in combination with the renderOperation flag to enable/disable operation.

target (t)

list

C

Targets to render as an image.

Use in combination with the render flag to render the specified targets.

Note: Only “.exr” image format can store more than one target in a single file. If another file format is used, only the first target specified will be rendered.

version (v)

bool

C

Returns the version of Flair.

Examples

1
2
3
4
5
6
7
8
# get the environment where Flair is installed
cmds.flair(env=True)  # Result: yourdir/flair/maya

# get the "shaders" folder within Flair
cmds.flair(env="shaders")  # Result: yourdir/flair/maya/shaders

# Run a benchmark over 100 frames
cmds.flair(bch=100)