Python API Updates

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.

Batch

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


Frequency

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

Inference

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

Project Management

Set the Action and Working colour spaces.

Lens Distortion

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

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

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.

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

Markers

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

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

Timeline

Tags

Tags can be set for all a <PySegment>.

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

For more information, the Python API Documentation.