This topic covers updates to the Python API, by release.
<PyMorphNode>.interpolation<PyMorphNode>.rendering_platform (Rocky Linux only)<PyMorphNode>.ml_engine_cache (Rocky Linux only)<PyMorphNode>.use_16_bit_fp (Rocky Linux only)<PyMorphNode>.motion_analysis_quality<PyMorphNode>.motion_blur<PyMorphNode>.samples<PyMorphNode>.shutter<PyMorphNode>.reference<PyMorphNode>.reference_colour
<PyMorphNode>.reference_position_x<PyMorphNode>.reference_position_y<PyMorphNode>.range_mode<PyMorphNode>.range_first_frame<PyMorphNode>.range_last_frame<PyMorphNode>.mix<PyMorphNode>.freeze_first_frame<PyMorphNode>.freeze_last_frame<PyMorphNode>.set_mix_to_range()<PyClip>.tags
<PyBatch>.tags<PyDesktop>.tags<PyFolder>.tags<PyLibrary>.tags<PyReel>.tags<PyReelGroup>.tags<PySequence>.tags<PyWorkspace>.tags<PyClip>.colour_label
<PyBatch>.colour_label<PyDesktop>.colour_label<PyFolder>.colour_label<PyLibrary>.colour_label<PyReel>.colour_label<PyReelGroup>.colour_label<PySequence>.colour_label<PyWorkspace>.colour_label<PyBatchGroup>.clear_colour()<PyDesktop>.clear()<PyNode>.framing_mode<PyNode>.data_window_min_x<PyNode>.data_window_min_y<PyNode>.data_window_max_x<PyNode>.data_window_max_y<PyNode>.display_window_min_x<PyNode>.display_window_min_y<PyNode>.display_window_max_x<PyNode>.display_window_max_y<PyNode>.offset_x<PyNode>.offset_y<PyNode>.repeat_mode<PyNode>.filter_mode<PyNode>.mode
<PyNode>.colour
<PyNode>.luminance
<PyNode>.bars_softness
<PyNode>.gradient_mode
<PyNode>.gradient_direction_mode
<PyNode>.gradient_circular_mode
<PyNode>.bi_gradient_colour_one, <PyNode>.bi_gradient_colour_two
<PyNode>.quad_gradient_colour_top_left, <PyNode>.quad_gradient_colour_top_right, <PyNode>.quad_gradient_colour_bottom_left, <PyNode>.quad_gradient_colour_bottom_right
<PySequence>. import_subtitles_file()
<PySequence>.subtitles
<PySequence>. subtitles_track
<PySubtitleTrack>.parent
<PySequence>. create_subtitle()
<PySubtitle>.name
<PySubtitleTrack>. segments
<PySegment>. create_effect("Subtitle")
flame.delete (PySubtitleTrack)
<PySubtitleTrack>. export_as_srt_file()
All controls of the Morph tool can be set using the Python API.
<PyMorphNode>.interpolationType: Attribute
Description: Used to set or get the Frame Interpolation mode. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.rendering_platform (Rocky Linux only)Type: Attribute
Description: Used to set or get the Rendering Platform option. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.ml_engine_cache (Rocky Linux only)Type: Attribute
Description: Used to set or get the status of the ML Engine Cache button. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.use_16_bit_fp (Rocky Linux only)Type: Attribute
Description: Used to set or get the bit depth value at which the Machine Learning model runs. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.motion_analysis_qualityType: Attribute
Description: Used to set or get the Motion Vector's Motion Analysis mode. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.motion_blurType: Attribute
Description: Used to set or get the status of the Motion Blur button. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.samplesType: Attribute
Description: Used to set or get the Samples value. An integer value between 3 and 25 must be passed as the argument.
<PyMorphNode>.shutterType: Attribute
Description: Used to set or get the Shutter value. A float value between 0.05 and 10.00 must be passed as the argument.
<PyMorphNode>.referenceType: Attribute
Description: Used to set or get the status of the Reference button. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.reference_colourType: Attribute
Description: Used to set or get the colour of the Reference widget. A tuple containing three colour values between 0.0 and 1.0 must be passed as the argument.
# Set the Reference colour of a Morph node to Green
m = flame.batch.create_node("Morph")
m.reference_colour = (0.0, 1.0, 0.0)
<PyMorphNode>.reference_position_xType: Attribute
Description: Used to set or get the Reference X Position value. An integer value between 0 and 10 000 must be passed as the argument.
<PyMorphNode>.reference_position_yType: Attribute
Description: Used to set or get the Reference Y Position value. An integer value between 0 and 10 000 must be passed as the argument.
<PyMorphNode>.range_modeType: Attribute
Description: Used to set or get the Range mode. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.range_first_frameType: Attribute
Description: Used to set or get the Range's First Frame value. An integer value between the Batch Group's start frame and end frame must be passed as an argument when the attribute is set.
<PyMorphNode>.range_last_frameType: Attribute
Description: Used to set or get the Range's Last Frame value. An integer value between the Batch Group's start frame and end frame must be passed as an argument when the attribute is set.
<PyMorphNode>.mixType: Attribute
Description: Used to set or get the Morphing Mix value. A float value between 0.0 and 100.00 must be passed as the argument.
<PyMorphNode>.freeze_first_frameType: Attribute
Description: Used to set or get the status of the First Frame's freeze button. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.freeze_last_frameType: Attribute
Description: Used to set or get the status of the Last Frame's freeze button. One of the following must be passed as an argument when the attribute is set:
<PyMorphNode>.set_mix_to_range()Type: Function
Description: Used to execute a Set Mix to Range operation.
The status of the Apply Colour Coding button and Tags can be set through the Python API.
<PyRenderNode>.apply_colour_codingType: Attribute
Description: Used to set or get the status of the Apply Colour Coding. One of the following must be passed as the argument when the attribute is set:
<PyRenderNode>.tagsType: Attribute
Description: Used to set tags on a clip originating from a Render node. To add a tag, a list of strings must be passed as an argument.
The following examples show how to set tags on a Render node.
# Add Tags on a Render node.
r = flame.batch.create_node("Render")
r.tags = ["TagA","TagB"]
# Append a Tag to existing Tags.
all_tags = <PyNode>.tags.get_value()
all_tags.append("TagC")
<PyNode>.tags = all_tags
# Clear all Tags on a Render node.
<PyNode>.tags = []
The status of the Apply Colour Coding button can be set through the Python API.
<PyWriteFileNode>.apply_colour_codingType: Attribute
Description: Used to set or get the status of the Apply Colour Coding. One of the following must be passed as the argument when the attribute is set:
The colour coding of a node can be set through the Python API.
<PyNode>.schematic_colourType: Attribute
Description: Used to set or get the colour of a Schematic node using RGB values. A tuple containing three colour values between 0.0 and 1.0 must be passed as the argument.
# Set the colour of the current Schematic node to Red
flame.batch.current_node.get_value().schematic_colour = (0.6, 0.0, 0.0)
<PyNode>.schematic_colour_labelType: Attribute
Description: Used to set or get the colour of a node using a colour label. A string must be passed as the argument when the attribute is set.
# Set the colour of the current Schematic node to a colour associated to a label.
flame.batch.current_node.get_value().schematic_colour_label = "In Progress"
<PyNode>.clear_schematic_colour()Type: Function
Description: Used to clear the colour of a Schematic node.
# Clear the colour of all Schematic node in the current Batch Group
for node in flame.batch.nodes:
node.clear_schematic_colour()
<PyActionNode>.create_node()Type: Function
Description: A new input_colour_space argument can be set to convert the texture to the Action working space. A valid colour space must be set as an argument. The argument is optional and resolves to "From Files or Rules" by default.
<PyActionNode>.import_psd()Type: Function
Description: A new input_colour_space argument can be set to convert the texture to the Action working space. A valid colour space must be set as an argument. The argument is optional and resolves to "From Files or Rules" by default.
<PyActionNode>.import_fbx()Type: Function
Description: A new input_colour_space argument can be set to convert the texture to the Action working space. A valid colour space must be set as an argument. The argument is optional and resolves to "From Files or Rules" by default.
<PyActionNode>.read_fbx()Type: Function
Description: A new input_colour_space argument can be set to convert the texture to the Action working space. A valid colour space must be set as an argument. The argument is optional and resolves to "From Files or Rules" by default.
<PyBatch>.create_node()Type: Function
Description: The path to the model can be passed as an additional argument when an Inference node is created.
# Create an Inference node with a specific model
flame.batch.create_node("Inference", "/var/tmp/model.onnx")
<PyNode>.separationType: Attribute
Description: Used to get or set the Separation Mode. One of the following must be passed as an argument when the attribute is set:
<PyNode>.blur_mode_lowType: Attribute
Description: Used to get or set the Low Blur Mode. One of the following must be passed as an argument when the attribute is set:
<PyNode>.blur_width_lowType: Attribute
Description: Used to get or set the Low Blur Width. A float value between 0.0 and 1000.00 must be passed as an argument when the attribute is set.
<PyNode>.blur_height_lowType: Attribute
Description: Used to get or set the Low Blur Height. A float value between 0.0 and 1000.00 must be passed as an argument when the attribute is set.
<PyNode>.blur_mode_midType: Attribute
Description: Used to get or set the Mid Blur Mode. One of the following must be passed as an argument when the attribute is set:
<PyNode>.blur_width_midType: Attribute
Description: Used to get or set the Mid Blur Width. A float value between 0.0 and 1000.00 must be passed as an argument when the attribute is set.
<PyNode>.blur_height_midType: Attribute
Description: Used to get or set the Mid Blur Height. A float value between 0.0 and 1000.00 must be passed as an argument when the attribute is set.
<PyNode>.centre_scaleType: Attribute
Description: Used to get or set the status of the Centre & Scale button. One of the following must be passed as an argument when the attribute is set:
<PyNode>.model_nameType: Read-Only Property
Description: Used to get the name of the current model loaded in the Inference node.
<PyNode>.import_lens_distortion()Type: Function
Description: Used to import a compatible lens distortion JSON file created from a third-party application. The complete file path to the file must be set as an argument.
# Import a compatible Lens Distortion file generated from another application.
ld = flame.batch.create_node("Lens Distortion")
ld.import_lens_distortion("/var/tmp/file.json")
<PyClip>.tagsType: Attribute
Description: Used to get or set tags on a Clip. To add a tag, a list of strings must be passed as an argument.
The following examples show how to use tags on clips. The same examples apply to all object listed in the Media Panel section.
# Add Tags on a Clip.
<PyClip>.tags = ["TagA","TagB"]
# Append a Tag to existing Tags.
all_tags = <PyClip>.tags.get_value()
all_tags.append("TagC")
<PyClip>.tags = all_tags
# Clear all Tags on a Clip.
<PyClip>.tags = []
# Get the Tags of a Clip.
for tag in <PyClip>.tags:
print(tag)
<PyBatch>.tagsType: Attribute
Description: Used to get or set tags on a Batch Group. To add a tag, a list of strings must be passed as an argument.
<PyDesktop>.tagsType: Attribute
Description: Used to get or set tags on a Desktop. To add a tag, a list of strings must be passed as an argument.
<PyFolder>.tagsType: Attribute
Description: Used to get or set tags on a Folder. To add a tag, a list of strings must be passed as an argument.
<PyLibrary>.tagsType: Attribute
Description: Used to get or set tags on a Library. To add a tag, a list of strings must be passed as an argument.
<PyReel>.tagsType: Attribute
Description: Used to get or set tags on a Reel. To add a tag, a list of strings must be passed as an argument.
<PyReelGroup>.tagsType: Attribute
Description: Used to get or set tags on a Reel Group. To add a tag, a list of strings must be passed as an argument.
<PySequence>.tagsType: Attribute
Description: Used to get or set tags on a Sequence. To add a tag, a list of strings must be passed as an argument.
<PyWorkspace>.tagsType: Attribute
Description: Used to get or set tags on a Workspace. To add a tag, a list of strings must be passed as an argument.
<PyClip>.colour_labelType: Attribute
Description: Used to set or get the colour of a Clip using a colour label. A string must be passed as the argument when the attribute is set.
The following example show how to set a colour on a clip using a label. The same example applies to all object listed in the Media Panel section.
# Set the colour of the selected clip in the Media Panel.
clip = flame.media_panel.selected_entries[0]
clip.colour_label = "Approved"
<PyBatch>.colour_labelType: Attribute
Description: Used to set or get the colour of a Batch Group using a colour label. A string must be passed as the argument when the attribute is set.
<PyDesktop>.colour_labelType: Attribute
Description: Used to set or get the colour of a Desktop using a colour label. A string must be passed as the argument when the attribute is set.
<PyFolder>.colour_labelType: Attribute
Description: Used to set or get the colour of a Folder using a colour label. A string must be passed as the argument when the attribute is set.
<PyLibrary>.colour_labelType: Attribute
Description: Used to set or get the colour of a Library using a colour label. A string must be passed as the argument when the attribute is set.
<PyReel>.colour_labelType: Attribute
Description: Used to set or get the colour of a Reel using a colour label. A string must be passed as the argument when the attribute is set.
<PyReelGroup>.colour_labelType: Attribute
Description: Used to set or get the colour of a Reel Group using a colour label. A string must be passed as the argument when the attribute is set.
<PySequence>.colour_labelType: Attribute
Description: Used to set or get the colour of a Sequence using a colour label. A string must be passed as the argument when the attribute is set.
<PyWorkspace>.colour_labelType: Attribute
Description: Used to set or get the colour of a Workspace using a colour label. A string must be passed as the argument when the attribute is set.
<PyBatchGroup>.clear_colour()Type: Function
Description: Used to clear the colour of a Batch Group.
<PyDesktop>.clear()Type: Function
Description: Used to clear the content of the current Desktop.
<PyMarker>.colour_labelType: Attribute
Description: Used to set or get the colour of a Marker using a colour label. A string must be passed as the argument when the attribute is set.
The following example show how to set a colour on a marker using a label.
# Create a Marker in the clip opened in the Timeline and set its colour using a label.
marker = flame.media_panel.selected_entries[0].create_marker(10)
marker.colour_label = "To Review"
<PyMarker>.locked_locationType: Attribute
Description: Used to lock or unlock a marker's location. One of the following must be passed as an argument:
<PyProject>.working_colour_spaceType: Attribute
Description: Used to get or set the working colour space of the project.
<PyProject>.action_colour_spacType: Attribute
Description: Used to get or set the working colour space of the project.
<PyProject>.get_available_colour_spaces()Type: Function
Description: Used to get or set the working colour space of the project.
<PySegment>.tagsType: Attribute
Description: Used to get or set tags on a Timeline segment. To add a tag, a list of strings must be passed as an argument.
# Add Tags on a Timeline segment.
<PySegment>>.tags = ["TagA","TagB"]
# Append a Tag to existing Tags.
all_tags = <PySegment>.tags.get_value()
all_tags.append("TagC")
<PySegment>.tags = all_tags
# Clear all Tags on a Timeline segment.
<PySegment>.tags = []
# Get the Tags of a Timeline segment.
for tag in <PySegment>.tags:
print(tag)
<PySegment>.source_frame_rateType: Read-Only Property
Description: Used to get the source frame rate of a timeline segment.
The version of PySide used by Flame Family products has been upgraded to PySide6 and any script using PySide2 will no longer work as expected.
If you plan to use your scripts with multiple version of Flame Family products, make sure to modify your scripts to either test for the current version of PySide or use the flame.get_version() function.
Here is an example of an existing script converted to be used in older versions of the application as well as in the 2025 version:
from PySide2 import QtWidgets, QtCore, QtGui
resolution = QtWidgets.QDesktopWidget().screenGeometry()
some_action = QtWidgets.QAction("some action")
vbox = QtWidgets.QVBoxLayout()
vbox.setMargin(10)
try:
from PySide6 import QtWidgets, QtCore, QtGui
except ImportError:
from PySide2 import QtWidgets, QtCore, QtGui
if QtGui.__version_info__[0] < 6:
mainWindow = QtWidgets.QDesktopWidget()
QAction = QtWidgets.QAction
else:
mainWindow = QtGui.QGuiApplication.primaryScreen()
QAction = QtGui.QAction
resolution = mainWindow.screenGeometry()
some_action = QAction("some action")
vbox = QtWidgets.QVBoxLayout()
vbox.setContentsMargins(10, 10, 10, 10)
For more information, please visit the Qt PySide documentation.
<PyNode>.min_clampType: Attribute
Description: Used to enable or disable set the Minimum Clamp button. One of the following must be passed as an argument:
<PyNode>.max_clampType: Attribute
Description: Used to enable or disable set the Maximum Clamp button. One of the following must be passed as an argument:
<PyNode>.min_valueType: Attribute
Description: Used to get or set the value for the Minimum Clamp button. A float value must be passed as an argument.
<PyNode>.max_valueType: Attribute
Description: Used to get or set the value for the Maximum Clamp button. A float value must be passed as an argument.
flame.users.current_user.shortcuts_profileType: Attribute
Description: Used to get or set the keyboard shortcuts profile. One of the following must be passed as an argument:
<PyNode>.framing_modeType: Attribute
Description: Used to get or set the framing mode. One of the following must be passed as an argument when the mode is set:
<PyNode>.data_window_min_xType: Attribute
Description: Used to get or set the Data Window Min X value. One of the following must be passed as an argument when a value is set:
<PyNode>.data_window_min_yType: Attribute
Description: Used to get or set the Data Window Min Y value. One of the following must be passed as an argument when a value is set:
<PyNode>.data_window_max_xType: Attribute
Description: Used to get or set the Data Window Max X value. One of the following must be passed as an argument when a value is set:
<PyNode>.data_window_max_yType: Attribute
Description: Used to get or set the Data Window Max Y value. One of the following must be passed as an argument when a value is set:
<PyNode>.display_window_min_xType: Attribute
Description: Used to get or set the Display Window Min X value. One of the following must be passed as an argument when a value is set:
<PyNode>.display_window_min_yType: Attribute
Description: Used to get or set the Display Window Min Y value. One of the following must be passed as an argument when a value is set:
<PyNode>.display_window_max_xType: Attribute
Description: Used to get or set the Display Window Max X value. One of the following must be passed as an argument when a value is set:
<PyNode>.display_window_max_yType: Attribute
Description: Used to get or set the Display Window Max Y value. One of the following must be passed as an argument when a value is set:
<PyNode>.offset_xType: Attribute
Description: Used to get or set the Offset X value. A float number included between the negative and positive values of the STMap clip width resolution but be passed as an argument.
<PyNode>.offset_yType: Attribute
Description: Used to get or set the Offset Y value. A float number included between the negative and positive values of the STMap clip height resolution but be passed as an argument.
<PyNode>.repeat_modeType: Attribute
Description: Used to get or set the repeat mode. One of the following must be passed as an argument when the mode is set:
<PyNode>.filter_modeType: Attribute
Description: Used to get or set the framing mode. One of the following must be passed as an argument when the mode is set:
A new PyObject named PyResolution can be used to get and set the resolution of a node.
flame.PyResolution()Type: Constructor
Description: Used to define a resolution unit.
The following arguments can be passed:
resolution One of the following values must be set:
width An integer value must be set.
height An integer value must be set.
bit_depth One of the following must be set:
frame_ratio A float value must be set.
scan_mode One of the following must be set:
It is not possible to set only the desired parameters directly in the constructor. One of three predefined constructors must be used.
flame.PyResolution() In this scenario, the individual attributes can be set afterward. If no attributes are set the Project Resolution is used.flame.PyResolution(resolution)flame.PyResolution(width, height, bit_depth, frame_ratio, scan_mode)<PyNode>.resolutionType: Attribute
Description: Used to get or set the resolution of a node in Batch, Batch FX, and Modular Keyer.
# Print the resolution of a node
print(flame.batch.get_node("resize78").resolution.get_value().resolution)
# Copy the resolution settings between nodes
res = flame.batch.get_node("col78").resolution.get_value()
flame.batch.get_node("col83").resolution = res
# Set the resolution of a node using a preset
res = flame.PyResolution("HD 1080 16:9 (1920 x 1080")
resize = flame.batch.get_node("resize01")
resize.resolution = res
# Set the resolution of a node using individual values
res = flame.PyResolution()
res.width = 1920
res.height = 1080
res.bit_depth = 16
res.frame_ratio = 1.778
res.scan_mode = "P"
resize = flame.batch.get_node("resize01")
resize.resolution = res
Attributes have been added to the PyExport Object to control how to deal with the Subtitles of a clip.
flame.PyExporter.include_subtitlesType: Attribute
Description: Used to set if the Subtitles must be included in an exported clip. One of the following values must be set:
flame.PyExporter.export_subtitles_as_filesType: Attribute
Description: Used to select the Subtitles Export mode between Export as Files and Burn in Image. One of the following values must be set:
flame.PyExporter.export_all_subtitlesType: Attribute
Description: Used to select if a file will be created for the current Subtitle track or all Subtitle tracks. One of the following values must be set:
Most settings in the Colour Source nodes are now available as attributes in the Python API.
<PyNode>.modeType: Attribute
Description: Used to get or set the mode in the Colour Source node. One of the following values must be passed as a string to set the mode:
# Set the mode of a Colour Source node to Gradient
cs = flame.batch.create_node("Colour Source") cs.mode = "Gradient"
<PyNode>.colourType: Attribute
Description: Used to get or set the colour in the Colour Source node. The colour is used in the Colour mode.
A tuple with three values (Red, Green, and Blue) must be passed to set the colour.
# Set the colour of a Colour Source node to black
cs = flame.batch.create_node("Colour Source")
cs.mode = "Colour"
cs.colour = (0.0, 0.0, 0.0)
<PyNode>.luminanceType: Attribute
Description: Used to get or set the luminance in the Colour Source node. The luminance is used in all modes but Gradient. One of the following values must be passed as an argument to set the luminance:
# Set the luminance of a Colour Source node to 75%
cs = flame.batch.create_node("Colour Source")
cs.luminance = 75
<PyNode>.bars_softnessType: Attribute
Description: Used to get or set the bars softness in the Colour Source node. The luminance is used in the SMPTE Bars and PAL Bars mode. An int value between 0 and 100 must be passed as an argument to set the bars softness.
# Set the colour bars softness of a Colour Source node to 3
cs = flame.batch.create_node("Colour Source")
cs.mode = "SMPTE Bars"
cs.bars_softness = 3
<PyNode>.gradient_modeType: Attribute
Description: Used to get or set the gradient mode in the Colour Source node. The gradient mode is used in the Gradient mode. One of the following values must be passed as a string to set the gradient mode:
# Set the gradient mode of a Colour Source node to 4 Pots.
cs = flame.batch.create_node("Colour Source")
cs.mode = "Gradient"
cs.gradient_mode = 4
<PyNode>.gradient_direction_modeType: Attribute
Description: Used to get or set the gradient direction in the Colour Source node. The gradient direction is used in the Gradient mode. One of the following values must be passed as a string to set the gradient direction mode:
# Set the gradient direction mode of a Colour Source node to Vertical.
cs = flame.batch.create_node("Colour Source")
cs.mode = "Gradient"
cs.gradient_direction_mode = "Vertical"
<PyNode>.gradient_circular_modeType: Attribute
Description: Used to get or set the gradient circular mode in the Colour Source node. The gradient circular mode is used in the Gradient mode. One of the following values must be passed as a string to set the gradient circular mode:
# Set the gradient circular mode of a Colour Source node to Height.
cs = flame.batch.create_node("Colour Source")
cs.mode = "Gradient"
cs.gradient_direction_mode = "Circular"
cs.gradient_circual_mode = "Height"
<PyNode>.bi_gradient_colour_one, <PyNode>.bi_gradient_colour_twoType: Attribute
Description: Used to get or set the gradient colours in the Colour Source node. The colours are used in the Gradient mode set to 2 Pots. A tuple of three values (Red, Green, and Blue) must be passed to set a colour.
# Set the colours of a Colour Source node's bi-gradient.
cs = flame.batch.create_node("Colour Source")
cs.mode = "Gradient"
cs.gradient_mode = 2
cs.bi_gradient_colour_one = (1.0, 0.0, 0.0)
cs.bi_gradient_colour_one = (0.0, 1.0, 0.0)
<PyNode>.quad_gradient_colour_top_left, <PyNode>.quad_gradient_colour_top_right, <PyNode>.quad_gradient_colour_bottom_left, <PyNode>.quad_gradient_colour_bottom_rightType: Attribute
Description: Used to get or set the gradient colours in the Colour Source node. The colours are used in the Gradient mode set to 4 Pots. A tuple of three values (Red, Green, and Blue) must be passed to set a colour.
# Set the colours of a Colour Source node's bi-gradient.
cs = flame.batch.create_node("Colour Source")
cs.mode = "Gradient"
cs.gradient_mode = 4
cs.quad_gradient_colour_top_left = (1.0, 0.0, 0.0)
cs.quad_gradient_colour_top_right = (0.0, 1.0, 0.0)
cs.quad_gradient_colour_bottom_left = (1.0, 0.0, 1.0)
cs.quad_gradient_colour_bottom_right = (1.0, 1.0, 1.0)
The Resolution List, Adaptive, and Scaling Presets resizing modes can be set on the following nodes: Action, Colour Source, Clip, Gradient, Matchbox, Pybox, Render, Resize, Text, and Write File.
<PyNode>.resolution_modeType: Attribute
Description: Used to get or set the resolution mode. One of the following must be passed as a string to set the mode:
# Set the Resolution mode of a node
resize = flame.batch.create_node("Resize")
resize.resolution_mode = "Scaling Presets"
<PyNode>.scaling_presets_valueType: Attribute
Description: Used to get or set the Scaling Presets value. A float must be passed as an argument to set the value. The value represents the scaling percentage.
# Set the Scaling Presets value of a node
resize = flame.batch.create_node("Resize")
resize.resolution_mode = "Scaling Presets"
resize.scaling_presets_value = 50.0
<PyNode>.adaptive_modeType: Attribute
Description: Used to get or set the Adaptive mode. One of the following must be passed as a string to set the mode:
# Set the Resolution of a node using the Adaptive mode
res = flame.PyResolution()
res.width = 1920
res.frame_ratio = 1.778
resize = flame.batch.create_node("Resize")
resize.resolution_mode = "Adaptive"
resize.adaptive_mode = "Height based on Ratio"
resize.resolution = res
A PySubtitleTrack object has been added, allowing subtitles to be imported or exported and the Timeline FX to be created. The following functions were already available, but updated for PySubtitleTrack.
The <subtitles name> token can be used in the file_name argument of the export_as_srt_file() function.
<PySequence>. import_subtitles_file()Type: Function
Description: Used to import a Subtitles file in a Sequence. The following arguments must be passed:
file_name (mandatory) The path and name of the file to import.
file_type The file type must be specified for files that do not have the .srt or .txt extension.
align_first_event_to_clip_start Force the first event to be aligned with the clip start. True or False must be passed.
convert_from_frame_rate The frame rate of the imported file (for txt files only).
# Import a Subtitle file to the current sequence
seq = flame.timeline.clip
seq.import_subtitles_file(file_name = "/tmp/mySubtitleFile.srt")
<PySequence>.subtitlesType: Read-Only Property
Description: Return a list of PySubtitleTrack object.
# Return how many Subtitles tracks a sequence has
print(len(flame.media_panel.selected_entries[0].subtitles))
<PySequence>. subtitles_trackType: Attribute
Description: Used to get or set the current Subtitles track of a Sequence. A PySubtitleTrack object must be passed to the attribute to set it as current.
None can be passed to disable the visibility of all Subtitles track.
# Set the Subtitles visibility to the Subtitles 1 track
flame.timeline.clip.subtitles_track = flame.timeline.clip.subtitles[0]
# Disable the visibility of all Subtitles tracks
flame.timeline.clip.subtitles_track = None
<PySubtitleTrack>.parentType: Read-Only Property
Description: Return the parent object of a Subtitles track. The parent object is always a PyClip or PySequence.
# Get the parent object of a Subtitle track
parent = flame.timeline.clip.subtitles[0].parent
<PySequence>. create_subtitle()Type: Function
Description: Used to create a Subtitles track.
# Create a Subtitles track
flame.timeline.clip.create_subtitle()
<PySubtitle>.nameType: Attribute
Description: Used to get or set the name of a Subtitles Track. A string must be passed to the attribute to change the name.
# Change the name of a Subtitles track
flame.timeline.clip.subtitles[0].name = "New Name"
<PySubtitleTrack>. segmentsType: Read-Only Property
Description: Return a list of PySegments located on a Subtitles track.
# Return how many segments a Subtitles track has
print(len(flame.media_panel.selected_entries[0].subtitles[0].segments))
<PySegment>. create_effect("Subtitle")Type: Function
Description: Used to add a Subtitle Timeline FX to a Timeline Segment. "Subtitle" must be passed as the argument to the function.
# Create a Subtitle FX on the currently selected segment.
flame.timeline.current_segment.create_effect("Subtitle")
flame.delete (PySubtitleTrack)Type: Function
Description: Used to delete a PySubtitleTrack. A <PySubtitleTrack> object must be passed as the argument to the function.
# Delete the first Subtitles track in the current Sequence.
flame.delete(flame.timeline.clip.subtitles[0])
<PySubtitleTrack>. export_as_srt_file()Type: Function
Description: Used to export a Subtitles Track as a file. The following arguments must be passed:
file_name (mandatory) The path and name of the file to write. A string must be passed.
character_based_attributes Export the bold, italic, and underline attributes information. True of False must be passed
export_colours Export the text colours information. True of False must be passed.
exclude_colour Specify a colour to ignore. A CSS colour or value in hex must be passed as a string.
use_original_colours Reuse the hexadecimal or CSS colour names from the imported file. True of False mut be passed.
use_original_alignment Reuse the alignment tokens from the imported file. True of False must be passed.
export_alignments Export the alignment information. True of False must be passed.
alignment_type Set the alignment style tokens. a or an must be passed as a string.
exclude_alignment Specify an alignment to ignore. One of the default alignments must be passed as a string.
# Export the current Subtitles track from the current sequence
for subtitle_track in flame.timeline.clip.subtitles:
subtitle_track.export_as_srt_file(file_name = "/tmp/<subtitles name>.srt", character_based_attributes = True, export_colours = False)
Now that you can burn a Metadata Overlay on media exported by a Batch Write File node, you can also enable and disable it using the Python API. For more details on Metadata Overlay in Batch, see the What's New in 2024.1.
| Command | Type | Description |
|---|---|---|
<PyWriteFileNode>.metadata_overlay |
Attribute | Used to enable or disable the Overlay button of a Write File node. One of the following must be passed as an argument:
Enable the Metadata Overlay for a Write File node:
|
<PyWriteFileNode>.metadata_overlay_context |
Attribute | Used to select the node that provides the information for the Metadata Overlay. One of the following must be passed as an argument:
Enable the Metadata Overlay for a Write File node:
|
The Start Frame information is now available in Python Hooks as startFrame.
| Command | Type | Description |
|---|---|---|
![]() <PyNode>.smart_replace |
Attribute | Used to get or set the status of the Smart Replace setting in the Render and Write File nodes. |
These new properties and functions allow control over the start frame.
| Command | Type | Description |
|---|---|---|
<PySegment>.start_frame<PyClip>.start_frame |
Read-Only Property | Used to get the Start Frame information of a PyClip or PySegment. Get the Start Frame information from a Clip
|
<PySegment>.change_start_frame()<PyClip>.change_start_frame() |
Function | Used to set the Start Frame information of a PyClip or PySegment. The following attributes can be passed:
Set the Start Frame information of a clip
|
The new directory /opt/Autodesk/<version>/python_utilities replaces the old /opt/Autodesk/<version>/python_examples directory. It contains a scripts directory for useful custom actions, and an examples directory for examples of python API uses.
You now have more control over the placement of custom actions in context menus.
You can now place custom actions at the first level of a context menu or inside a submenu hierarchy.
You can now set the order attribute on a submenu or an action set the order in which they are displayed. Custom actions that do not have an order attribute are sorted alphabetically.
Use the separator attribute to add a separator between custom actions or submenus. Make sure to set the above or below attribute for each separator.You can find a custom layout example in /opt/Autodesk/<version>/python_utilities/examples.
minimumVersion attribute to 2023.2.0.0 on your actions so the new structure only applies to this version and not previous releases.You can now pass a directory as an argument to flame.import_clips().
flame.batch.create_group()You no longer have to set the duration argument for the flame.batch.create_group() function.
| Command | Type | Description |
|---|---|---|
<PyWriteFileNode>.add_to_workspace |
Attribute | Used to enable or disable the new Add to Workspace button available in the Write File node. One of the following must be set as an argument:
Enable the Add to Workspace option in a Write File node
|
![]() <PyRenderNode>.in_mark![]() <PyRenderNode>.out_mark |
Attribute | Used to set the in_mark and out_mark on a Render node. A frame or timecode information must be passed as an argument. This can be done by passing the information from another node or using a PyTime. Set the Render node In Mark based on a Clip's In Mark Set the Render node Out Mark using a PyTime
|
![]() <PyBatch>.current_iteration_number![]() <PyBatchIteration>.iteration_number |
Read-Only Property | Used to get only the number part of a Batch Iteration name. Get the current iteration number of the current Batch Group
|
![]() <PyWriteFileNode>.get_resolved_media_path() |
Function | Used to get the media path of a write file node with resolved tokens. Three arguments can be set:
Get the system disk path set in a selected Write File node
|
<PyNode>.set_channel_name() |
Function | Used to set the name of a channel in the Render and Write File nodes. The following must be passed as arguments:
Change the first two channels of a Write File node
Change the first two channels of a Render node
|
<PyNode>.channels |
Read-Only Property | Used to print a tuple of the current channels present in a Render and Write File nodes. Print the name of channels present in a Write File node
|
You can now use the Python API to display Flame browser for users to select files. The PyBrowser object is used to set a file selection and settings as variables to be used by other functions like flame.import_clips(). The advantage of using a PyBrowser over a Qt dialog box is user interface consistency and access to features such as bookmarks.
Flame Family includes updates to the API in the following components:
| Command | Type | Description |
|---|---|---|
![]() flame.messages.show_in_dialog() |
Function | Used to open a message dialog box and offer options to users. The following arguments can be passed:
Example: Display a Dialog offering default colours for a new Reel. |
flame.messages.show_in_console() |
Function |
An example of how to use these functions are available in /opt/Autodesk/<version>/python_examples. |
flame.messages.clear_console() |
Function | Used to clear the content of the message console. |
| Command | Type | Description |
|---|---|---|
flame.batch.import_clips() |
Function | Allow to import multiple clips at once, as opposed to flame.batch.import_clip() which always imports the frames found in a path as a single clip node. |
You can now use the Python API to open a Flame file browser for users to select files. The PyBrowser object itself is only used to set a file selection and settings as variables that can be used by other functions like flame.import_clips(). The advantage of using a PyBrowser over a Qt dialog box is user interface consistency and access to features such as the Flame bookmarks.
| Command | Type | Description |
|---|---|---|
flame.browser.show() |
Function | Used to open a <PyBrowser> window. The Resolution dropdown is set to Same as Source by default. The Width, Height, and Ratio settings are disabled when the resolution is set to Same as Source. In this scenario None is returned for Width, Height, and Ratio. The following arguments can be passed:
|
flame.browser.selection |
Read-Only Property | Returns a list of the selected files/directories. |
flame.browser.resolution |
Read-Only Property | Returns a resolution preset name. |
flame.browser.width |
Read-Only Property | Returns the width set in the Resolution controls. |
flame.browser.height |
Read-Only Property | Returns the height set in the Resolution controls. |
flame.browser.bit_depth |
Read-Only Property | Returns the bit depth set in the Resolution controls. |
flame.browser.frame_ratio |
Read-Only Property | Returns the frame ratio set in the Resolution controls. |
flame.browser.scan_mode |
Read-Only Property | Returns the scan mode set in the Resolution controls. |
flame.browser.colour_space |
Read-Only Property | Returns the colour space set in the Resolution controls. |
flame.browser.resize_mode |
Read-Only Property | Returns the resizing mode set in the Resolution controls. |
flame.browser.resize_filter |
Read-Only Property | Returns the resizing filter set in the Resolution controls. |
flame.browser.sequence_mode |
Read-Only Property | Returns the state of the Sequences / Frames button in the file browser. |
| Command | Type | Description |
|---|---|---|
flame.mediahub.files.options.set_tagged_colour_space |
Attribute | Used to set the MediaHub's Colour Space to Tag Only with the defined colour space. |
flame.mediahub.files.options.resize_mode |
Attribute |
Used to get or set the MediaHub's Resizing mode. One of the following value must be passed as an argument when the attribute is set:
|
flame.mediahub.files.options.resize_filter |
Attribute |
Used to get or set the MediaHub's Resizing filter. One of the following value must be passed as an argument when the attribute is set:
|
flame.mediahub.files.options.resolution |
Attribute |
Used to get or set the MediaHub's Resolution. One of the following value must be passed as an argument when the attribute is set:
|
flame.mediahub.files.options.width |
Attribute | Used to get or set the MediaHub's Resolution width. An integer value between 24 and 16384 must be passed when the attribute is set. |
flame.mediahub.files.options.height |
Attribute | Used to get or set the MediaHub's Resolution height. An integer value between 24 and 16384 must be passed when the attribute is set. |
flame.mediahub.files.options.frame_ratio |
Attribute | Used to get or set the MediaHub's frame ratio. A float value between 0.01 and 100.00 must be passed when the attribute is set. |
flame.mediahub.files.options.pixel_ratio |
Attribute | Used to get or set the MediaHub's pixel ratio. This attribute is only used when the Resolution is set to "Same as Source" One of the following value must be passed as an argument when the attribute is set.
|
flame.mediahub.files.options.bit_depth |
Attribute |
Used to get or set the MediaHub's Bit Depth. One of the following value must be passed as an argument when the attribute is set.
|
flame.mediahub.files.options.scan_mode |
Attribute |
Used to get or set the MediaHub's Scan Mode. One of the following value must be passed as an argument when the attribute is set.
|
flame.mediahub.files.options.sequence_mode |
Attribute |
Used to set the MediaHub's sequence mode to File Sequence or Frame. One of the following must be passed as an argument:
|
![]() flame.import_clips() |
Function |
Use one of the following to import a file sequence as a single clip:
|
| Command | Type | Description |
|---|---|---|
<PyClip>.get_colour_space |
Function |
Used to get the colour space of a frame in time. A PyTime can be passed as an argument to get the colour space at a specific time. If no PyTime is specified the positioner is used fo the PyClip and the first frame is used for the PySegment. |
| Command | Type | Description |
|---|---|---|
<PyTransition>.set_dissolve_to_from_colour() |
Function |
Used to transform a dissolve into a To/From Colour transition. RGB values must be passed as an argument. |
<PyTransition>.set_fade_to_from_silence() |
Function | Used to transform an audio fade into a To/From Silence transition. |
| Command | Type | Description |
|---|---|---|
<PyNode>.slope_red |
Attribute |
Used to get or set the RGB Slope values. A float number must be passed as an argument when the attribute is set. |
<PyNode>.offset_red |
Attribute | Used to get or set the RGB Offset values. A float number must be passed as an argument when the attribute is set. |
<PyNode>.power_red |
Attribute | Used to get or set the RGB Power values. A float number must be passed as an argument when the attribute is set. |
<PyNode>.saturation |
Attribute | Used to get or set the Saturation value. A float number must be passed as an argument when the attribute is set. |
<PyNode>.style |
Attribute | Used to get or set the Style value. One of these must be passed as an argument when the attribute is set:
|
<PyNode>.invert |
Attribute | Used to get or set the Invert value. One of these must be passed as an argument when the attribute is set:
|
| Command | Type | Description |
|---|---|---|
![]() <PyArchiveEntry>.clear_colour() |
Function | Used to remove the colour coding on every entry of the Media Panel that can be colour coded. |
| Command | Type | Description |
|---|---|---|
<PyClip>.cut() |
Function | Used to create a cut on one or all tracks of a clip. Example: Create a cut on all tracks on the 10th frame
Create a cut on a single track at 10:00:01:00 |
<PySegment>.clear_colour() |
Function | Used to remove the colour coding on a Timeline Segment. |
PyClip.create_container() |
Function |
Used to create a Container. The following methods are used in order:
|
PySegment.container_clip() |
Read-Only Property | Returns the content of a container in the form of a PyClip object so some modifications normally made on a PyClip are accessible. |
PyClip.open_container() |
Function | Used to open a Container tab. |
PyClip.close_container() |
Function | Used to close a Container tab. |
<PySequence>.padding_start |
Attribute | Used to add a gap before or after the first/last Timeline segment of a Sequence. A PyTime defined up to which frame the gap must be extended must be passed as an argument. Example: Add a gap from 09:59:00:00 to 10:00:00:00 for a clip starting at 10:00:00:00 |
<PySegment>.create_unlinked_segment() |
Function |
Used to turn a Gap into an unlinked media segment. The following arguments can be passed:
|
<PySegment>.source_audio_track |
Read-Only Property | Used to get the audio track from the source media. |
| Command | Type | Description |
|---|---|---|
<PyTrack>.insert_transition() |
Function |
Used to create a transition on a <PyTrack>. The following arguments can be passed:
Example: Create a new up to cut transition at frame 24 in a Sequence |
<PyTransition>.set_transition() |
Function | Used to set attributes on an existing transition. The following arguments can be passed:
Example: Change an existing cut into a dissolve |
<PyTransition>.slide() |
Function |
Used to slide a transition. The following arguments can be passed:
|
<PyTransition>.name |
Attribute | Used to get or set the transition name. A string must be passed as an argument when the attribute is set. |
<PyTransition>.duration |
Attribute | Used to get or set the transition duration. An integer number must be passed as an argument when the attribute is set. |
<PyTransition>.alignment |
Attribute | Used to get or set the transition alignment. One of the following value must be passed as an argument when the attribute is set.
|
<PyTransition>.selected |
Attribute | Used to get or set the transition selection status. |
<PyTransition>.type |
Attribute | Return the transition type. |
<PyTransition>.record_time |
Read-Only Property | Returns the record time of the cut. |
<PyTransition>.in_offset |
Read-Only Property | Returns the offset between the record_time (cut point) and the start time of the transition. |
<PyTransition>.parent |
Read-Only Property | Return the PyTrack on which the transition is located. |
<PyClip>.selected_transitions |
Read-Only Property | Used to get or set the selected transitions of a clip. |
<PyTimeline>.current_transition |
Read-Only Property | Returns a PyTransition if the current element of the timeline is a transition. |
Flame Family now installs and uses Python 3.9.7 instead of version 3.7.9 used in Flame Family 2022.
The app_started python hook has been removed. Use the Python hook app_initialized instead.
Python hook get_action_custom_ui_actions, used by the Action family nodes to add custom actions, is now available in Image and GMask Tracer.
Flame Family includes updates to the API in the following components:
| Command | Type | Description |
|---|---|---|
![]() flame.mediahub.files.options.multi_channel_mode |
Attribute | Sets the Multi-Channel mode in the MediaHub. The possible modes are:
Example: Set the multi-channel mode |
flame.mediahub.files.options.cache_mode |
Attribute | Set the Media Cache mode in the MediaHub. The possible modes are:
Example: Set the media caching mode |
flame.mediahub.files.options.proxies_mode |
Attribute | Set the Media Proxies mode in the MediaHub. The possible modes are:
Example: Set the media proxies mode |
flame.mediahub.files.options.cache_and_proxies_all_versions |
Attribute | Set the Clip Version mode in the MediaHub. The possible modes are:
Example: Set the clip version mode |
| Command | Type | Description | |
|---|---|---|---|
<PyReelGroup>.save() |
Function | Saves a PyReelGroup to the current Destination in the Library. The function was previously available for other PyObjects present in the Desktop but was not for the PyReelGroup. Example: Save a Reel Group to the destination Library |
|
|
Read-Only Property | Returns True if a Batch Group or Library is opened and False if it's closed. |
| Command | Type | Description |
|---|---|---|
|
Function | Inserts or Overwrites a source clip in a Sequence. The following arguments can be set:
Examples Overwrite the selected clip inside a sequence
Insert an Audio Track inside a sequence |
|
Function | Copy the selected segments to a destination in the Media Panel. The following arguments can be set:
Example: Copy the selected segment to the Media Panel |
| Command | Type | Description | |
|---|---|---|---|
flame.delete(<PySegment>) |
Function | Deletes a Timeline segment. This call produces the same result as the Lift shortcut: the segment is deleted and the other segments are not rippled. Example: Delete a segment in the Timeline |
|
flame.timeline.type |
Attribute | Focuses a Timeline tab in the user interface. The possible arguments are:
Example: Focus the sequence tab in the Timeline |
|
flame.timeline.clip |
Read-Only Property | Returns the PyClip or PySequence associated to the clip shown in the Timeline. Useful when running scripts in the Python Console. Example: Rename the clip currently shown in the Timeline |
|
|
Read-Only Property | Returns a PySegment, PyMarker, or a PyTimelineFX depending on what is selected in the current clip. Useful when running scripts in the Python Console. Example: Rename the selected segment in the Timeline |
|
|
Function | Turns a gap into a colour source segment and modifies the colour of an existing colour source segment. Red, Green, and Blue values arguments must be set. Example: Turn the selected gap to a colour source in the Timeline |
|
|
Function | Matches a segment from the current sequence to a destination. Contrary to the Match operation performed using the user interface or the keyboard shortcut a new clip is always created. 5 arguments can be set:
Example: Match a Timeline segment to a Reel |
|
|
Function | Replaces a Timeline segment with a source clip. A PyClip must be specified.
Example: Replace the media of a Timeline segment |
|
|
Function | Applies Trim, Slip, and Slide editorial operations. The following arguments can be set:
Example: Trim the head of a Timeline segment |
|
|
Function | Applies the Slide Keyframe editorial operation. The following arguments can be set:
Example: Slide keyframes of a Timeline segment |
|
<PyVersion>.copy_to_media_panel()
<PyAudioTrack>.copy_to_media_panel()
|
Function | Creates a new clip into the specified destination in the Media Panel. The following arguments can be set:
Example: Copy a segment to a Reel |
|
|
Read-Only Property | The following PyClip/PySequence information can be obtained through the PySegment properties. PySegment (source, gap, bfx):
PySegment with source media:
PySegment on an audio track:
Example: Get the Width and Height of the current segment |
|
|
Read-Only Property | Return the lists of RGB and Matte channels. |
|
|
Read-Only Property | Return the current RGB and Matte channels. |
|
|
Read-Only Property | Return the Matte mode. The possible values are:
|
|
|
Function | Set the RGB and Matte channels using the channel names or indexes. The following arguments can be set for the RGB and Matte channels:
Also the matte_mode can be set for the Matte channel. The modes are:
|
|
|
Attribute | The tokenized attributes can be used to set the name and comment of a PySegment or PyMarker using tokens. A string must be passed as an argument. The dynamic attributes can be used to enabled or disable the Dynamic button in the Rename and Comment dialog boxes. True or False must be passed as an argument. Example: Set the name of a timeline segment using tokens
Enable the Dynamic setting in the Marker's comment field |
Flame, Flare and Flame Assist now use Python 3.7. This means that you need to convert your Python 2 scripts to Python 3.
The process for converting your scripts from Python 2 to Python 3 is outside the scope of this documentation. But here a few pointers for doing just that.
Futurize and Modernize cannot fix everything automatically: you still need to verify your script compiles correctly.
From the command line, run:
python3 -m compileall <your_script>
In the shell, look at the compilation feedback:
The Python console, Flame menu > Python > Python Console, now benefits from the following improvements:
.py extension.PyActionNode ReachEvery functions, attributes, and properties available in the PyActionNode object are now available in GMask Tracer and Image.
The script path_of_selected_clips.py shows how to get the path and file name of a media file in MediaHub.
//The // operator is now supported in the Python API. Python 3 differentiates between / (float division) and // (integer division).
| Command | Type | Description | Example |
|---|---|---|---|
<PyActionNode>.object_dual_mode
|
Attribute |
Set the Object menu display mode to Single or Dual. One of the following must be passed as an argument:
|
Set the Object menu to Dual display mode.
|
|
|
Read-only property |
Get a list of tabs currently displayed in the Object menu.
|
Get the list of tabs currently displayed in the Left panel of the Object menu set in Dual mode.
|
|
|
Attribute |
Set a tab as current in the Object menu.
The name of a tab must be passed as an argument. |
Select the Default Camera tab in the Object menu's single panel mode.
|
| Command | Type | Description |
|---|---|---|
flame.duplicate(<PyObject>)
|
Function |
The standard |
| Command | Type | Description | Example |
|---|---|---|---|
|
|
Read-only property |
Get a list of children <PyObjects> located under the specified <PyObject> in the Media Panel Hierarchy. |
Get a list of children located under the Desktop.
|
|
|
Function |
The Duplicate Name Check dialog is now bypassed when the copy and move functions are used. The `duplicate_action` argument can be set to either add or replace. The Add option will be executed if the argument is not set. |
Replace a clip while moving another clip with the same name to that Reel.
|
|
|
Read-only property |
Used to get a Reel's type. The possible type are:
|
Print a Reel's type.
|
| Command | Type | Description |
|---|---|---|
<PySegment>.create_connection()
|
Function |
Used to create a connected segment connection on a segment. Only works for segments inside a Reel Group. |
<PySegment>.remove_connection()
|
Function |
Used to remove a connected segment connection on a segment. Only works for segments inside a Reel Group. |
<PySegment>.sync_connected_segments()
|
Function |
Used to sync the connected segments. Only works for segments inside the same Reel Group. |
<PySegment>.connected_segments()
|
Function |
Returns a list of connected segments. Only works for segments inside the same Reel Group. |
<PySegment>.duplicate_source()
|
Function |
Used to duplicate the source media of a segment. |
<PySegment>.shared_source_segments()
|
Function |
Returns a list of segments sharing the same source media. |
| Command | Type | Description |
|---|---|---|
<PyTimelineFx>.sync_connected_segments()
|
Function |
Used to sync a specific Timeline FX on connected segments inside the same Reel Group. This cannot be called on a Timewarp. |
New in the Python API for Flame Family 2021.2 Update:
New functions for MediaHub: set or get MediaHub file or archive paths.
New attributes for the following Batch nodes:
| Command | Type | Description |
|---|---|---|
flame.mediahub.files.get_path() flame.mediahub.files.set_path() flame.mediahub.archives.get_path() flame.mediahub.archives.set_path() |
Function | Used to get or set the path of the MediaHub in the Files and Archives tabs. A path must be passed as an argument when the path is set. |
| Command | Type | Description |
|---|---|---|
| <PyNode>.dominance | Attribute | Used to get or set the dominance. One of the following must be passed as an argument to set the attribute:
|
| <PyNode>.interpolation | Attribute | Used to get or set the interpolation. One of the following must be passed as an argument to set the attribute:
|
| Command | Type | Description |
|---|---|---|
| <PyNode>.tolerance_red <PyNode>.tolerance_green <PyNode>.tolerance_blue <PyNode>.tolerance_y <PyNode>.tolerance_u <PyNode>.tolerance_v |
Attribute | Used to get or set the Tolerance values. A number must be passed as an argument when the attribute is set. |
| <PyNode>.softness_red <PyNode>.softness_green <PyNode>.softness_blue <PyNode>.softness_y <PyNode>.softness_u <PyNode>.softness_v |
Attribute | Used to get or set the Softness values. A number must be passed as an argument when the attribute is set. |
<PyNode>.gain_rgb |
Attribute | Used to get or set the Gain value. A number must be passed as an argument when the attribute is set. |
| <PyNode>.lift_rgb <PyNode>.lift_yuv |
Attribute | Used to get or set the Lift value. A number must be passed as an argument when the attribute is set. |
<PyNode>.channel_red |
Attribute | Used to get or set the status of a channel. One of the following must be passed as an argument to set the attribute:
|
| <PyNode>.space_rgb | Attribute | Used to select the colour space. One of the following must be passed as an argument to set the attribute:
|
| Command | Type | Description |
|---|---|---|
<PyNode>.input_data_type |
Attribute | Used to get or set the input data type. One of the following must be passed as an argument to set the attribute:
|
| <PyNode>.exposure_red <PyNode>.exposure_green <PyNode>.exposure_blue |
Attribute | Used to get or set the red, green and blue exposure values. A number between -10 000 and 10 000 must be passed as an argument when the attribute is set. |
| <PyNode>.contrast_red <PyNode>.contrast_green <PyNode>.contrast_blue |
Attribute | Used to get or set the red, green and blue contrast values. A number between -10 000 and 10 000 must be passed as an argument when the attribute is set. |
| <PyNode>.pivot_red <PyNode>.pivot_green <PyNode>.pivot_blue |
Attribute | Used to get or set the red, green and blue pivot values. A number between 0.0 and 1.0 must be passed as an argument when the attribute is set. |
| Command | Type | Description |
|---|---|---|
<PyNode>.channel |
Attribute | Used to get or set the channel. One of the following must be passed as an argument to set the attribute:
|
| Command | Type | Description |
|---|---|---|
<PyNode>.level |
Attribute | Used to get or set the Png compression level of the Write File node. A number between 0 and 9 must be passed as an argument when the attribute is set. |
The Python API is augmented with additional methods and properties in the Flame module, Action, Batch, and Timeline groups and segments.
Command | Type | Description | Example |
|---|---|---|---|
| Function | Get the currently selected tab. | Print which tab is currently selected in the software: |
| Function | Open the tab. One of the following can be passed as an argument:
| Go to the Timeline Tab: |
|
Command |
Type |
Description |
Example |
|---|---|---|---|
|
|
Read-only Property |
Get the list of parent nodes for a node. One of the following must be passed as the link type:
Returns an empty list if there is no parent for the given link. |
Print the name of the parent nodes:
|
|
|
Read-only Property |
Get the list of children for a node. One of the following must be passed as the link type:
Returns an empty list if there are no children for the given link. |
Print the name of the children nodes:
|
|
|
Function |
Break a link between two Action nodes. Three arguments must be passed:
One of the following must be passed as the link type:
|
Disconnect a link between two nodes in Action:
|
|
Command |
Type |
Description |
Example |
|---|---|---|---|
|
|
Function |
Disconnect the links from a node's input sockets. |
Disconnect a single input link from a node:
Disconnect all input links from a node:
|
|
Command |
Type |
Description |
Example |
|---|---|---|---|
|
|
Function |
Create a group in a clip or sequence. A string must be passed as an argument to define the name of the group. |
Create a group in a clip:
|
|
|
Read-only Property |
Get the list of groups available in a clip or sequence. |
Print the list of groups of a Clip:
|
|
|
Read-only Property |
Get the list of timeline segments that are part of a group. |
Print all the segments included in a group:
|
|
|
Read-only Property |
Get the parent clip or sequence object of a group. |
Print the name of a group's parent clip:
|
|
|
Attribute |
Get or set the same of a group. A sting must be passed as an argument when the name is set. |
Rename a Group:
|
|
|
Function |
Add a segment to a group. One of the following can be passed as an argument:
|
Add a Timeline segment to a group:
|
|
|
Function |
Remove a segment from a group. One of the following can be passed as an argument:
|
Remove a Timeline segment from a group:
|
|
|
Read-only Property |
Get a list of groups a timeline segment is part of. |
Print the name of all the groups a segment is part of:
|
|
Command |
Type |
Description |
Example |
|---|---|---|---|
|
|
Read-only Property |
Get the type of a PySegment object. One of the following is returned:
|
Print the type of a Timeline segment:
|
|
|
Read-only Property |
Get the number of head of tail frames of a PySegment object. |
Print the head and tail information of all segments on a track:
|
The Python API is augmented with additional methods in Action, Batch, and Project management.
<PyActionNode>.selected_nodes can now be used to deselect all nodes in Action by passing an empty list as argument.
| Command | Type | Description | Example |
|---|---|---|---|
<PyCoNode>.pos_x<PyCoNode>.pos_y |
Attribute | Used to set or get the position of a node in the Action schematic. Requires an integer. | Set the position of a node in the Action Schematic:axis = <PyActionNode>.create_node("Axis")axis.pos_x = 100axis.pos_y = 50 |
<PyActionNode>.cursor_position |
Read-Only Property | Return a list that provides the cursor position in the Action Schematic. The first value is the x position. The second value is the y position. This is useful in the context of the custom actions as it is now possible to add nodes in the desired location. | Add a node under cursorcursor = <PyActionNode>.cursor_positionaxis = <PyActionNode>.create_node("Axis")axis.pos_x = cursor[0]axis.pos_y = cursor[1] |
| Command | Type | Description | Example |
|---|---|---|---|
<PyClipNode> |
Read-Only Property | <PyClip> properties accessible from the Media Panel are now accessible from its corresponding <PyClipNode> object in the Batch Schematic. |
Get the bit depth information from a Clip nodeclip = flame.batch.get_node("clip99").clip print(clip.bit_depth) |
| Command | Type | Description | Example |
|---|---|---|---|
flame.batch.cursor_position |
Read-Only Property | Returns a list that provides the cursor position in the Batch Schematic. The first value is the x position. The second value is the y position. This is useful in the context of the custom actions as it is now possible to add nodes in the desired location. | Add a node under cursorcursor = flame.batch.cursor_position mux = flame.batch.create_node("Mux") mux.pos_x = cursor[0] mux.pos_y = cursor[1] |
| Command | Type | Description | Example |
|---|---|---|---|
<PyNode>.compress_mode |
Attribute | Used to set or get the Compress mode of a Write File node. One of the following options must be passed as an argument: Uncompressed, RLE, LZW, Scanline, Multi_Scanline, PIZ, PXR24, B44, B44A, DWAA, DWAB, PIXSPAN, Packed. | Set a Write Node's Compress modewf = flame.batch.create_node("Write File") wf.compress_setting = "PIZ" |
<PyNode>. colour_type |
Attribute | Used to set or get the DPX Colour Type of a Write File node. One of the following options must be passed as an argument: Printing Density, Unspecified, SMPTE 274M, CCIR 709-4, CCIR 601 (625), CCIR 601 (525), NTSC, PAL | Set a Write Node's DPX Colour Type wf = flame.batch.create_node("Write File") wf.colour_space = "CCIR 601 (625)" |
| Command | Type | Description | Example |
|---|---|---|---|
flame.projects.current_project.nickname |
Read-Only Property | Returns the Project's Nickname. | Print the Project's Nicknameprint(flame.projects.current_project.nickname) |
Here are the updates to the Python API for this 2020.2 Update release.
Attributes for the Comp and Burn-In Letterbox Timeline FX can now be modified on a timeline segment.
Python functions can be executed asynchronously at an undetermined time in Flame's idle loop using the flame.schedule_idle_event().
watch_folder.py shows how to use this function. You can find it in the python examples directory, /opt/Autodesk/flame_2020.2/python_examples.<PyTimelineFx>.save_setup(): Save a Timeline FX setup.
<PyTimelineFx>.load_setup(): Load a Timeline FX setup.
Here are the updates to the Python API for this 2020.1 Update release.
flame.execute_shortcut(): Execute the specified keyboard shortcut.Updates to Action:
<PyNodeObject>.cache_range(): You can now cache range on Z-Depth and Normals map, in addition to the previously accessible Motion Vectors map.<PyCoNode>.encompass_nodes.Updates to Batch:
flame.batch.create_node(): Create Matchbox, Pybox, or Sparks nodes, specifying the shader, handler, or Spark as required.
<PyNode>.shader_name: Get the name of the shader loaded in a Matchbox node.
<PyNode>.handler_name: Get the name of the handler loaded in a Pybox node.
<PyNode>.sparks_name: Get the name of the Spark loaded in a Sparks node.
<PyOpenFX: Create an OpenFX node and then load an Open FX plug-in.
<PyNode>.bypass: Bypass nodes in the Batch schematic.
MUX improvements:
More control over the Media Panel:
<PyObject>.selected: Objects derived from PyArchiveEntry now have the selected property used to select the object.
PyMediaPanel controls the state and contents of the Media Panel.
<PyMediaPanel>.move(): Move a media panel entry to a different location.<PyMediaPanel>.copy(): Copy a media panel entry to a different location.<PyMediaPanel>.selected_entries: Set or get the list of selected entries in the Media Panel.Changes to the PyProject object:
flame.projects is now equivalent to flame.project.Now with User (Profile) management:
The property <PyProject>.current_name is now deprecated and replaced with <PyProject>.name.
We've augmented the Python API with the following:
<PyObject>.parent: Get the parent of the object.New Batch Nodes are now available with the Python API:
To support the import of UDIM textures, some <PyActionNode> functions are augmented:
<PyActionNode>.import_fbx: New is_udim parameter.<PyActionNode>.create_node: New is_udim and tile_resolution parameters.<PyActionNode>.export_fbx: New function to export an action scene to FBX.To help you implement these new features, the following examples have been added to the /opt/Autodesk/<application_version>/python_examples folder:
New Classes:
Notable updates to classes:
Also, a new look for the Flame module documentation, as well as some Flame API Code Samples.
Arguments passed for an attribute or a function are no longer case sensitive if they reference an option in the Flame user interface.
You can now pass float values (between 0.0 and 1.0) to attributes that require R, G and B arguments. Setting R, G, and B arguments can still be done with integer values, but getting the colour values always returns floating point values.
With the Python API, you create scripts to:
You can now create a sequence with PyReel.create_sequence(),PyLibrary.create_sequence(), and PyFolder.create_sequence().
You can now find clip by name, UID, or wiretap node ID.
You can now import (flame.import_clips()) or export clips (using the new PyExporter class).
You can now script the Media Panel.
Scriptable Media Panel components:
The API has also been augmented with additional Batch commands.
Exceptions can now be caught in a Python script. For example, the following will now work:
from flame import batch
try:
batch.import_clip("bad_path", "bad_reel_name")
except Exception as e:
print(str(e))