Flame Family products now use Python 3.7, you can now encode exports with FFmpeg, access the new Python console. Plus Python API updates.
Indicates a feature suggested and voted up by users on the Flame Feedback portal.
Flame, Flare and Flame Assist now use Python 3.7. This means that you need to convert your Python scripts to Python 3.
The process for converting your scripts to 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.
To test to see if your script compiles and will run in Python 3:
From the command line, run:
python3 -m compileall <your_script>
The Python console,
, now benefits from the following improvements:This release includes new Python API script examples showing how to encode Flame Family content using FFmpeg on CentOS and macOS
The Python example file is located in /opt/Autodesk/flame_2022/python_examples/export_selection.py.
export_selection.py contains examples to:
The Python API encoding also uses some of the Wiretap tools already installed in /opt/Autodesk/io/bin. The Wiretap tools used are:
Reel Name
Timecode
Frame rate
Colour Space, with one of the following colours spaces for parameter:
Since Timeline FX have to be rendered prior exporting with Python API, we have added in the example a way to pre-render content before exporting. If you create your own Python script, make sure to pre-render any Timeline FX to avoid black frames in your resulting files. Also, Audio mix down might be required if your content has more than two audio tracks.
The above script also shows how to export clips located in a Reel or a Folder, and displays a file browser to select a destination.
Python API limitations:
Every 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 does the distinction between / (float division) and // (integer division).
Command | Type | Description |
---|---|---|
<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. <PyActionNode>.object_dual_mode = True |
<PyActionNode>.left_tabs
<PyActionNode>.right_tabs <PyActionNode>.all_tabs | 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. print <PyActionNode>.left_tabs |
<PyActionNode>.current_left_tab
<PyActionNode>.current_right_tab <PyActionNode>.current_tab | attribute |
Set a tab as current in the Object menu.
Select the Default Camera tab in the Object menu's single panel mode <PyActionNode>.current_tab = "Default" |
Command | Type | Description |
---|---|---|
flame.duplicate(<PyObject>) | function | The standard flame.duplicate() function can now be used to duplicate an object inside a PyActionNode, PyImageNode, and PyGMaskTracerNode. |
Command | Type | Description |
---|---|---|
<PyDesktop>.children
<PyReelGroup>.children <PyReel>.children <PyLibrary>.children <PyFolder>.children | 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: print flame.projects.current_project.current_workspace.desktop.children |
<PyMediaPanel>.copy()
<PyMediaPanel>.move() | 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 to dictate the desired behaviour. 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 clip = flame.project.current_project.current_workspace.desktop.reel_groups[0].reels[3].clips[0] reel = flame.project.current_project.current_workspace.desktop.reel_groups[0].reels[2] flame.media_panel.move(source_entries = clip, destination = reel, duplicate_action = 'replace') |
<PyReel>.type | read-only property |
Used to get a Reel's type. The possible type are:
Print a Reel's type print(<PyReel>.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. |