Share

Python (What's New in 2025)

PySide6 Support

The version of PySide used by Flame Family applications has been upgraded to PySide6 and any script using PySide2 will no longer work as expected.

Supporting Multiple Versions in a Single Script

If you plan to use your scripts with multiple version of Flame Family products, make sure to modify your scripts to either test for the current version of PySide or use the flame.get_version() function.

Here is an example of an existing script converted to be used in older versions of the application as well as in the 2025 version:

PySide2

from PySide2 import QtWidgets, QtCore, QtGui
resolution = QtWidgets.QDesktopWidget().screenGeometry()
some_action = QtWidgets.QAction("some action")
vbox = QtWidgets.QVBoxLayout()
vbox.setMargin(10)

PySide6

try:
    from PySide6 import QtWidgets, QtCore, QtGui
except ImportError:
    from PySide2 import QtWidgets, QtCore, QtGui
 
if QtGui.__version_info__[0] < 6:
    mainWindow = QtWidgets.QDesktopWidget()
    QAction = QtWidgets.QAction
else:
    mainWindow = QtGui.QGuiApplication.primaryScreen()
    QAction = QtGui.QAction
 
resolution = mainWindow.screenGeometry()
some_action = QAction("some action")
vbox = QtWidgets.QVBoxLayout()
vbox.setContentsMargins(10, 10, 10, 10)

For more information, please visit the Qt PySide documentation.

Python API Updates

Clamp

The Python API has been adjusted so the four new controls are available as attributes, replacing the existing out_range attribute.

  • <PyNode>.min_clamp: Used to enable or disable set the Minimum Clamp button. One of the following must be passed as an argument:
    • True to enable the button.
    • False to disable the button.
  • <PyNode>.max_clamp: Used to enable or disable set the Maximum Clamp button. One of the following must be passed as an argument:
    • True to enable the button.
    • False to disable the button.
  • <PyNode>.min_value: Used to get or set the value for the Minimum Clamp button. A float value must be passed as an argument.
  • <PyNode>.max_value: Used to get or set the value for the Maximum Clamp button. A float value must be passed as an argument.

Keyboard Shortcuts

The flame.users.current_user.shortcuts_profile attribute can be used to change the profile in the Python API. One of the following must be passed as an argument:

  • Flame
  • Smoke Classic
  • Smoke (FCP 7)
  • Lustre

STMap

The new STMap node can be controlled using the Python API. 13 attributes are available:

  • <PyNode>.framing_mode: Used to get or set the framing mode. One of the following must be passed as an argument when the mode is set:
    • Use Entire Front Frame
    • Use STMap to Front Ratio
    • Use Data & Display Window
  • <PyNode>.data_window_min_x: The next 8 attributes are used to get or set the Data Window and Display Window values. One of the following must be passed as an argument when a value is set:
    • An integer number between -16384 and 16384 must be passed for the Data Window.
    • An integer number between 0 and 16384 must be passed for the Display Window.
  • <PyNode>.data_window_min_y
  • <PyNode>.data_window_max_x
  • <PyNode>.data_window_max_y
  • <PyNode>.display_window_min_x
  • <PyNode>.display_window_min_y
  • <PyNode>.display_window_max_x
  • <PyNode>.display_window_max_y
  • <PyNode>.offset_x: The next 2 attributes are used to get or set the Offset X and Y values. A float number included between the negative and positive values of the STMap clip resolution.
  • <PyNode>.offset_y
  • <PyNode>.repeat_mode: Used to get or set the repeat mode. One of the following must be passed as an argument when the mode is set:
    • Repeat Off
    • Mirrored Repeat
    • Tiled Repeat
    • Repeat Last
  • <PyNode>.filter_mode: Used to get or set the framing mode. One of the following must be passed as an argument when the mode is set:
    • Nearest
    • Linear
    • Mitchell-Netravali
    • Catmull-Rom
    • Anisotropic
    • Aniso + Linear
    • EWA
    • EWA + Linear

Was this information helpful?