Share

Python API

The Flame Family Python API is a tool for any Flame, Flare, and Flame Assist user looking to script their workflow and automate tedious tasks.

The Python API is accessed via the Flame Python Console. This console gives you a place to write and execute code while working in Flame.

The Flame module is the core of the Python API. This module contains all that you need to use the Flame Python API.

The Python API uses Python version 3.11.5, since Flame Family 2025.



New to the flame Python API?

Write Your First Python API Script shows a small and basic example to get you started.

The Flame API Code Samples contains code snippets that should give some ideas on the structure of the API, and how to use it. You will also find examples of scripts in /opt/Autodesk/<flame_version>/python_examples.

Note: Some functions and attributes may not be available in Flare or Flame Assist.


What's New in 2026

PyClip

Command Type Description
<PyClip>.shot_name Attribute Used to get or set the Shot Name of a source clip.

A string must be passed as an argument when the shot name is set.
<PyClip>.tokenized_shot_name Attribute Used to get or set the Tokenized Shot Name of a source clip.

Use tokenized_shot_name to get the string with the tokens in use rather than the tokens being resolved.
<PyClip>.dynamic_shot_name Attribute Used to enabled or disable the Dynamic button in the Rename Shot dialog window.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button

Examples

# Set the Shot Name of the selected Clip in the Media Panel
flame.media_panel.selected_entries[0].shot_name = "sh010_<user>"
# Get the Tokenized Shot Name of the selected Clip in the Media Panel
print(flame.media_panel.selected_entries[0].tokenized_shot_name)
# Enable Dynamic in the Rename Shot dialog window
flame.media_panel.selected_entries[0].dynamic_shot_name = True

PyClipNode

Command Type Description
<PyClipNode>.shot_name Attribute Used to get or set the Shot Name of a Clip node. The associated clip must be a source, not a sequence.

A string must be passed as an argument when the shot name is set.
<PyClipNode>.tokenized_shot_name Attribute Used to get or set the Tokenized Shot Name of a Clip node. The associated clip must be a source, not a sequence.

Use tokenized_shot_name to get the string with the tokens in use rather than the tokens being resolved.
<PyClipNode>.dynamic_shot_name Attribute Used to enabled or disable the Dynamic button in the Rename Shot dialog window.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button

Examples

# Set the Shot Name of the selected Clip in the Media Panel
flame.batch.current_node.get_value().shot_name = "sh010_<user>"
# Get the Tokenized Shot Name of the selected Clip in the Media Panel
print(flame.batch.current_node.get_value().tokenized_shot_name)
# Enable Dynamic in the Rename Shot dialog window
flame.flame.batch.current_node.get_value().dynamic_shot_name = True

PyClrMgtNode

Command Type Description
<PyClrMgtNode>.get_context_variables() Function Used to get the OCIO context variables in a dictionary.
<PyClrMgtNode>.set_context_variable() Function Used to set the value for the specified OCIO context variable.
<PyClrMgtNode>.reset_context_variables() Function Used to reset the OCIO context variables to the ones defined at the project level.
<PyClrMgmtNode>.mode Attribute Used to get or set the current colour management mode.

One of the following must be passed as the argument when the attribute is set:
  • Colour Transform
  • Input Transform
  • Tag Only
  • View Transform
<PyClrMgmtNode>.view Attribute Used to get or set the View in View Transform mode.
<PyClrMgmtNode>.tagged_colour_space Attribute Used to get or set the Tagged Colour Space in Tag Only, View Transform, and Colour Transform modes.

Used to get or set the Input Colour Space in Input Transform mode.
<PyClrMgmtNode>.display Attribute Used to get or set the Display in View Transform mode.
<PyClrMgmtNode>.working_space Attribute Used to get or set the Working Space in Input Transform mode.
<PyClrMgmtNode>.bit_depth Attribute Used to get / set the bit depth in all modes.

One of the following must be passed as the argument when the attribute is set:
  • 8
  • 10
  • 12
  • 16
  • 32
<PyClrMgmtNode>.invert Attribute Used to enable/disable the Invert parameter in View Transform, Input Transform, and Colour Transform (Custom) modes.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button
<PyClrMgmtNode>.custom Attribute Used to enable/disable the Custom parameter in Colour Transform mode.

Note: It is not possible to set the values of the rows in Custom mode with the Python API.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button
<PyClrMgmtNode>.context_variables_from_project Attribute Used to enable/disable the From Project parameter for the OCIO Context tab.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button

Example

# Create a Colour Management node and define its different attributes
clr1 = flame.batch.create_node("Colour Mgmt")
clr1.mode = "Input Transform"
clr1.tagged_colour_space = "ACEScct"
clr1.working_space = "ACEScg"
clr1.bit_depth = 32

clr2 = flame.batch.create_node("Colour Mgmt")
clr2.mode = "View Transform"
clr2.display = "sRGB - Display"
clr2.view = "ACES 2.0 - SDR 100 nits (Rec.709)"
clr2.tagged_colour_space = "ACEScg"
clr2.invert = True
clr2.context_variables_from_project = False
clr2.set_context_variable("SHOT", "0004")

PyClrMgmtTimelineFX

Command Type Description
<PyClrMgmtTimelineFX>.get_context_variables() Function Used to get the OCIO context variables in a dictionary.
<PyClrMgmtTimelineFX>.set_context_variable() Function Used to set the value for the specified OCIO context variable.
<PyClrMgmtTimelineFX>.reset_context_variables() Function Used to reset OCIO the context variables to their initial state from the OCIO config.
<PyClrMgmtTimelineFX>.mode Attribute Used to get or set the current colour management mode.

One of the following must be passed as the argument when the attribute is set:
  • Colour Transform
  • Input Transform
  • Tag Only
  • View Transform
<PyClrMgmtTimelineFX>.view Attribute Used to get or set the View in View Transform mode.
<PyClrMgmtTimelineFX>.tagged_colour_space Attribute Used to get or set the Tagged Colour Space in Tag Only, View Transform, and Colour Transform modes.

Used to get or set the Input Colour Space in Input Transform mode.
<PyClrMgmtTimelineFX>.display Attribute Used to get or set the Display in View Transform mode.
<PyClrMgmtTimelineFX>.working_space Attribute Used to get or set the Working Space in Input Transform mode.
<PyClrMgmtTimelineFX>.invert Attribute Used to enable/disable the Invert parameter in View Transform, Input Transform, and Colour Transform (Custom) modes.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button
<PyClrMgmtTimelineFX>.custom Attribute Used to enable/disable the Custom parameter in Colour Transform mode.

Note: It is not possible to set the values of the rows in Custom mode with the Python API.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button
<PyClrMgmtTimelineFX>.context_variables_from_project Attribute Used to enable/disable the From Project parameter for the OCIO Context tab.

One of the following must be passed as the argument when the attribute is set:
  • True to enable the button
  • False to disable the button

Example

# Create a Colour Management Timeline FX on the selected segment and define its different attributes
clr = flame.timeline.current_segment.create_effect("Colour Mgmt")
clr.mode = "Input Transform"
clr.tagged_colour_space = "ACEScct"
clr.working_space = "ACEScg"

PyNode

Command Type Description
<PyNode>.colour_space Read-Only Property Used to get the colour space name of the primary output of a node.
<PyNode>.shot_name Attribute Used to get or set the Shot Name of an OpenFX or a Pybox node.

Example

# Set the Shot Name of the selected Clip in the Media Panel
ofx = flame.batch.create_node("OpenFX")
ofx.shot_name = "Sh0001"

PyProject

Command Type Description
<PyProject>.reload_ocio_config Function Used to reload the OCIO config of the project.

A boolean argument must be passed to set the value for the dialog related to deleting the custom colour spaces, roles, and rules of the project. The default is False.
<PyProject>.project_folder Read-Only Property Used to get the Project Home location of the current project.
<PyProject>.setups_folder Read-Only Property Used to get the Project Setups location of the current project.
<PyProject>.media_folder Read-Only Property Used to get the Project Media Cache location of the current project.
<PyProject>..get_context_variables() Function Used to get the OCIO context variables of the current project as a dictionary.
<PyProject>.set_context_variable() Function Used to set the value of an OCIO context variable of the current project.
<PyProject>.reset_context_variables() Function Used to reset the values of the OCIO context variables of the current project.
<PyProject>.export_ocio_config() Function Used to export the OCIO config of the current project.

The following must be passed as the arguments:
  • Name for the config
  • Destination folder
  • Export as Locked (True or False)
  • Overwrite existing config(True or False)
  • Generate OCIOZ (True or False)
Note: flame.project was changed to flame.projects in the 2020.1 Update version. Both syntaxes are supported for compatibility reasons, but we encourage the use of the latter instead of the former.

Examples

# Reload the OCIO config of the current project
flame.projects.current_project.reload_ocio_config(True)
# Get the OCIO context variables of the current project, as a dictionary
flame.projects.current_project.get_context_variables()
# Set the value of an OCIO context variable for the current project
flame.projects.current_project.set_context_variable("SHOT", "0001")
# Reset the values of the OCIO context variables for the current project
flame.projects.current_project.reset_context_variables()
# Export the OCIO config of the current project
flame.projects.current_project.export_ocio_config("My Config", "/usr/tmp", False, False, False)

# In this example, the last three arguments are, in order, setting the status of the overwrite_existing, export_as_locked, and generate_ocioz attributes to False.
# Get the Project Home, Setups, and Media Cache locations
prj = flame.projects.current_project
print(prj.project_folder)
print(prj.setups_folder)
print(prj.media_folder)

Was this information helpful?