LOGIK_PORTAL // PYFLAME
--:--:--  ·  SYS:OK  ·  CONN:ACTIVE  
$ import pyflame

PyFlame_

v5.3.1  ·  FLAME 2025.1+  ·  PYTHON 3.11  ·  PYSIDE6

A Python library for Autodesk Flame.

autodesk flame python library pyside6 qt widgets

PyFlame is a Python library containing a set of custom Qt widgets for Autodesk Flame — all styled to match Flame's native UI — along with layout helpers, window classes, a config system, and utility functions for script development.

The library file should be renamed per-script to pyflame_lib_<script_name>.py and placed in the script's lib/ folder, avoiding version conflicts when multiple scripts coexist in the Flame Python folder. It requires the Montserrat font family (included in assets/fonts/) to render correctly. These fonts are included in the PyFlame library.

Flame Version2025.1+
Python Version3.11
Qt BindingPySide6
PlatformRocky Linux  ·  MacOS
Version5.3.0  ·  Updated 03.13.26
LicenceGNU General Public License v3.0 (GPL-3.0)

All scripts using PyFlame must follow this layout. Rename the library file per-script to avoid conflicts when multiple scripts are installed simultaneously.

The script folder, script name, and library file name must all be the same.

Folder structure:

script_folder/
 ├── main_script.py
 ├── lib/
 │   └── pyflame_lib_<script_name>.py
 │   └── README.md              # optional
 │   └── CHANGELOG.md           # optional
 └── assets/
      └── fonts/
          └── Montserrat-Regular.ttf
          └── Montserrat-Light.ttf
          └── Montserrat-Thin.ttf


Example folder structure for script named "rename_shots":

rename_shots/
 ├── rename_shots.py
 ├── lib/
 │   └── pyflame_lib_rename_shots.py
 │   └── README.md              # optional
 │   └── CHANGELOG.md           # optional
 └── assets/
      └── fonts/
          └── Montserrat-Regular.ttf
          └── Montserrat-Light.ttf
          └── Montserrat-Thin.ttf

Import everything from the library into the script's namespace. Use PyFlameFunctions via the pyflame object and instantiate widgets directly by class name.

# Import everything from the library
from lib.pyflame_lib_my_script import *

# Use PyFlameFunctions via the pyflame object
pyflame.print("Script loaded")
flame_version = pyflame.get_flame_version()

# Instantiate widgets directly
window = PyFlameWindow(title='My Script', width=500, height=400)
button = PyFlamePushButton(text='Run', connect=my_function)
menu = PyFlameMenu(text='Options', menu_options=['A', 'B', 'C'])
window.show()
// WIDGET CLASSES
PyFlameButtonCustom Qt Flame button widget
PyFlameEntryCustom Qt Flame entry field — replaces PyFlameLineEdit
PyFlameEntryFileBrowserEntry field that opens Flame File Browser on click
PyFlameLabelCustom Qt Flame label widget
PyFlameListWidgetCustom Qt Flame list widget
PyFlamePushButtonCustom Qt Flame push button
PyFlameMenuCustom Qt Flame menu — replaces PyFlamePushButtonMenu
PyFlameColorMenuPush button with colour menu — replaces PyFlamePushButtonColorMenu
PyFlameTokenMenuCustom Qt Flame token menu — replaces PyFlameTokenPushButton
PyFlameSliderCustom Qt Flame numerical slider
PyFlameTableCustom Qt Flame table widget
PyFlameTabWidgetCustom Qt Flame tab widget
PyFlameTextEditCustom Qt Flame text edit widget
PyFlameTextBrowserCustom Qt Flame text browser widget
PyFlameTreeWidgetCustom Qt Flame tree widget
PyFlameButtonGroupGroups PyFlameButton types for mutually exclusive toggling
PyFlameProgressBarWidgetCustom Qt Flame progress bar widget
PyFlameHorizontalLineCustom Qt horizontal line divider widget
PyFlameVerticalLineCustom Qt vertical line divider widget
// LAYOUT CLASSES
PyFlameGridLayoutCustom Qt grid layout
PyFlameHBoxLayoutCustom Qt horizontal box layout
PyFlameVBoxLayoutCustom Qt vertical box layout
// WINDOW CLASSES
PyFlameWindowBase Flame Qt window — container for all script UIs
PyFlameMessageWindowFlame message dialog window
PyFlamePasswordWindowFlame password input window
PyFlameProgressWindowFlame progress indicator window
PyFlameInputDialogFlame Qt input dialog window
// UTILITY CLASSES
PyFlameConfigCreate, load, and save script config files

Click any widget to see its description, parameters, and a usage example.

// SELECT WIDGET
SELECT A WIDGET

All utility functions are accessed through the pyflame object after importing the library.

pyflame.printPrint message to terminal and Flame message area
pyflame.print_dictCleanly print nested dicts with indentation to terminal
pyflame.print_jsonCleanly print JSON data to terminal with proper indentation
pyflame.print_listPrint a list of items to terminal and Flame message area
pyflame.print_titlePrint script title to terminal
pyflame.get_flame_versionGet the current version of Flame
pyflame.file_browserOpen Flame file browser or Qt file browser window
pyflame.copy_to_clipboardCopy text to clipboard using Qt
pyflame.create_file_system_foldersCreate folders in the file system from a folder structure
pyflame.create_media_panel_foldersCreate folders in the Flame media panel
pyflame.create_media_panel_librariesCreate libraries with folders in the media panel
pyflame.resolve_tokensResolve strings containing Flame tokens
pyflame.resolve_shot_nameResolve shot name from string
pyflame.shot_name_from_clipGet shot name from a Flame clip object
pyflame.find_by_tagSearch Flame object's contained objects by tags
pyflame.set_shot_taggingTag Flame objects with shot name tag
pyflame.move_to_shot_folderMove a clip to a shot folder in the Media Panel
pyflame.get_export_preset_namesGet export preset names from Shared and Project paths
pyflame.get_export_preset_versionGet export preset version
pyflame.update_export_presetUpdate export preset version
pyflame.convert_export_preset_name_to_pathConvert export preset name to file path
pyflame.open_in_finderOpen a path in the system Finder
pyflame.refresh_hooksRefresh Flame Python hooks
pyflame.verify_script_installVerify script is installed correctly with required files
pyflame.python_package_local_installInstall Python packages bundled with a script
pyflame.generate_unique_node_namesGenerate unique node names from a list of existing names
pyflame.iterate_nameReturn a unique name by iterating through a name list
pyflame.create_temp_folderCreate a temporary folder in the script folder
pyflame.cleanup_temp_folderClear the contents of the temporary folder
pyflame.untarUntar a tar file
pyflame.get_flame_python_packages_pathGet path to the Flame Python packages folder
pyflame.raise_type_errorRaise a type error with traceback to Flame and terminal
pyflame.raise_value_errorRaise a value error with traceback to Flame and terminal