Python API Updates (What's New in 2025.2)
Indicates a feature suggested and voted up by users on the Flame Feedback portal.
Morph
The following attributes can be used to modify parameters in the Morph node:
- <PyMorphNode>.interpolation: Used to set or get the Frame Interpolation mode. One of the following must be passed as an argument when the attribute is set:
- Machine Learning
- Motion Vectors
- <PyMorphNode>.rendering_platform (Rocky Linux only): Used to set or get the Rendering Platform option. One of the following must be passed as an argument when the attribute is set:
- GPU
- CPU
- <PyMorphNode>.ml_engine_cache (Rocky Linux only): 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:
- True to enable the button
- False to disable the button
- <PyMorphNode>.use_16_bit_fp (Rocky Linux only): 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:
- True to select 16-bit fp
- False to select 32-bit fp
- <PyMorphNode>.motion_analysis_quality: 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:
- Use 1/16 Resolution
- Use 1/8 Resolution
- Use 1/4 Resolution
- Use 1/2 Resolution
- Use Full Resolution
- <PyMorphNode>.motion_blur: 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:
- True to enable the button
- False to disable the button
- <PyMorphNode>.samples: Used to set or get the Samples value. An integer value between 3 and 25 must be passed as the argument.
- <PyMorphNode>.shutter: Used to set or get the Shutter value. A float value between 0.05 and 10.00 must be passed as the argument.
- <PyMorphNode>.reference: 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:
- True to enable the button
- False to disable the button
- <PyMorphNode>.reference_colour: 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.
- <PyMorphNode>.reference_position_x: 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_y: 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_mode: Used to set or get the Range mode. One of the following must be passed as an argument when the attribute is set:
- All Frames
- Custom Range
- <PyMorphNode>.range_first_frame: 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_frame: 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>.mix: 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_frame: 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:
- True to enable the button
- False to disable the button
- <PyMorphNode>.freeze_last_frame: 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:
- True to enable the button
- False to disable the button
Example:
# 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)
The following function can be used in the Morph node:
- <PyMorphNode>.set_mix_to_range(): Used to execute a Set Mix to Range operation.
PyNode
The following attributes can be used to modify parameters in a PyNode:
- <PyNode>.schematic_colour: 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.
- <PyNode>.schematic_colour_label: 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.
Examples:
# Set the colour of the current Schematic node to Red
flame.batch.current_node.get_value().schematic_colour = (0.6, 0.0, 0.0)
# 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"
The following function can be used on a PyNode node:
- <PyNode>.clear_schematic_colour(): Used to clear the colour of a Schematic node.
Example:
# Clear the colour of all Schematic node in the current Batch Group
for node in flame.batch.nodes:
node.clear_schematic_colour()
Render node
The status of the Apply Colour Coding button can be set through the Python API.
- <PyRenderNode>.apply_colour_coding: 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:
- True to enable the button
- False to disable the button
- <PyRenderNode>.tags: 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.
Examples:
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 = []
Write File node
The following attribute can be used to modify parameters in a Write File node:
- <PyWriteFileNode>.apply_colour_coding: 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:
- True to enable the button
- False to disable the button
For more information, see Python API Documentation.