Share

Python API Updates (What's New in 2025.1)

Indicates a feature suggested and voted up by users on the Flame Feedback portal.

Action

A new input_colour_space argument can be set to convert the texture to the Action working space in the following functions. A valid colour space must be set as an argument. The argument is optional and resolves to "From Files or Rules" by default.

  • <PyActionNode>.create_node()
  • <PyActionNode>.import_psd()
  • <PyActionNode>.import_fbx()
  • <PyActionNode>.read_fbx()

Batch

The path to the model can be passed as an additional argument when an Inference node is created.

  • <PyBatch>.create_node("Inference"): The path to the model can be passed as an additional argument.
# Create an Inference node with a specific model
flame.batch.create_node("Inference", "/var/tmp/model.onnx")


Frequency

The following attributes can be used to modify parameters in the Frequency node:

  • <PyNode>.separation: Used to get or set the Separation Mode. One of the following must be passed as an argument when the attribute is set:
    • 2 Bands
    • 3 Bands
  • <PyNode>.blur_mode_low: Used to get or set the Low Blur Mode. One of the following must be passed as an argument when the attribute is set:
    • Box
    • Gaussian
  • <PyNode>.blur_width_low: 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_low: 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_mid: Used to get or set the Mid Blur Mode. One of the following must be passed as an argument when the attribute is set:
    • Box
    • Gaussian
  • <PyNode>.blur_width_mid: 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_mid: 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_scale: 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:
    • True
    • false

Inference

The name of the model loaded in an Inference node can be get.

  • <PyNode>.model_name: Used to get the name of the current model loaded in the Inference node.

Project Management

Set the Action and Working colour spaces.

  • <PyProject>.working_colour_space: Used to get or set the working colour space of the project.
  • <PyProject>.action_colour_space: Used to get or set the action colour space of the project.
  • <PyProject>.get_available_colour_spaces(): Used to get all the available colour spaces of the project.

Lens Distortion

A compatible Lens Distortion JSON file created from a third-party application can be imported.

  • <PyNode>.import_lens_distortion(): 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")


Media Panel

Tags

Tags can be set for all <PyObject> present in the Media Panel.

  • <PyObject>.tags: Used to get or set tags on an object. 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 most objects available in the Media Panel.

# 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)

Colour Coding

Objects can be coloured using the label given to a colour preset in the Colour Coding Preferences.

  • <PyArchiveEntry>.colour_label: Used to set or get the colour of a Media Panel object using a colour label. A string must be passed as the argument when the attribute is set.
# Set the colour of the selected clip in the Media Panel.
clip = flame.media_panel.selected_entries[0]
clip.colour_label = "Approved"

Miscellaneous

The following now work as expected:

  • <PyBatchGroup>.clear_colour(): Used to clear the colour of a Batch Group.
  • <PyDesktop>.clear(): Used to clear the content of the current Desktop.

Markers

Objects can be coloured using the label given to a colour preset in the Colour Coding Preferences.

  • <PyMarker>.colour_label: Used to set or get the colour of a Marker object using a colour label. A string must be passed as the argument when the attribute is set.
# 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"

The location of a Marker can be locked.

  • <PyMarker>.locked_location: Used to lock or unlock a marker's location. One of the following must be passed as an argument:
    • True
    • False

Timeline

Tags

Tags can be set for all a <PySegment>.

  • <PySegment>.tags: 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)

Source Attributes

The source frame rate of a clip can be get:

  • <PySegment>.source_frame_rate: Used to get the source frame rate of a timeline segment.

For more information, the Python API Documentation.

Was this information helpful?