Share

Python API (What's New in 2023.2)

Directory python_utilities now contains samples and scripts, more control over custom actions in context menus, directories as arguments, changes to flame.batch.create_group(), and now functions and attributes.

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

Renamed Python Directories

The new directory /opt/Autodesk/<version>/python_utilities replaces the old /opt/Autodesk/<version>/python_examples directory. It contains a scripts directory for useful custom actions, and an examples directory for examples of python API uses.

Custom Layout in the Context Menu

You now have more control over the placement of custom actions in context menus.

  • You can now place custom actions at the first level of a context menu or inside a submenu hierarchy.

  • You can now set the order attribute on a submenu or an action set the order in which they are displayed. Custom actions that do not have an order attribute are sorted alphabetically.

  • Use the separator attribute to add a separator between custom actions or submenus. Make sure to set the above or below attribute for each separator.

Important: Set the minimumVersion attribute to 2023.2.0.0 on your actions so the new structure only applies to this version and not previous releases.

/opt/Autodesk/<version>/python_utilities/examples contains an example of the new custom actions menu structure.

Directory as arg

You can now pass a directory as an argument to flame.import_clips().

  • If the destination is a Library then the directory structure is imported as-is.
  • Every clip found in the hierarchy is loaded at the first level when the destination is a Reel.

Changes to flame.batch.create_group()

You no longer have to set the duration argument for the flame.batch.create_group() function.

  • If you set the duration, the application considers the value as the desired one and won't modify it.
  • If you do not set the duration, the Batch group has a duration of 100 up until a clip is added to the Schematic: this sets the duration to that of the clip's.

New Attributes and Functions

The following are new attributes and functions available in Flame Family 2023.2:

  • <PyWriteFileNode>.add_to_workspace
  • <PyWriteFileNode>.in_mark & <PyWriteFileNode>.out_mark
  • <PyWriteFileNode>.get_resolved_media_path()
  • <PyBatch>.current_iteration_number & <PyBatchIteration>.iteration_number
  • <PyWriteFileNode>.get_resolved_media_path()
  • <PyNode>.set_channel_name()
  • <PyNode>.channels

For more information, see Flame Family Python API.

Was this information helpful?