Classes

Warning

doxygenclass: Cannot find class “alPy::Alternative” in doxygen xml output for project “alias-python-api” from directory: C:/Jenkins/workspace/d-shotgun_alias-python-api_PR-44/build/python3_AliasSurface2019/bin/Release/docs//doxygen/xml

Warning

doxygenclass: Cannot find class “alPy::Layer” in doxygen xml output for project “alias-python-api” from directory: C:/Jenkins/workspace/d-shotgun_alias-python-api_PR-44/build/python3_AliasSurface2019/bin/Release/docs//doxygen/xml

class alPy::Menu

A menu object that can be added to the Alias menu bar.

This class object is only available in OpenAlias.

Public Functions

Menu(std::string label)

Class Constructor.

Parameters

label – the menu label.

virtual ~Menu()

Class Destructor.

void clean()

Remove all the entries within the menu.

void refresh()

Refresh the Alias menu.

bool hasCommand(std::string command_name) const

Check if the given command already exists in the current menu.

Parameters

command_name – name of the command we want to test if it exists or not.

Returns

True if the command already exists, false otherwise.

py::object addCommand(std::string label, const std::function<void()> &callback, bool add_separator, py::object parent)

Add a menu entry to the menu and associate a command to it.

Parameters
  • label – name of the menu entry to add.

  • callback – python callback we want to execute when clicking on the menu entry.

  • add_separator – if True, add a separator in front of the menu item which will be created.

  • parent – if a ShotgunMenuItem is supplied by the user, the new command entry will be a child of this menu item.

Returns

The menu item as a python object.

py::object addMenu(std::string label, py::object parent)

Add a simple menu entry to the Shotgun menu (without any associated command).

This is useful if we want to create a submenu.

Parameters
  • label – name of the menu entry.

  • parent – if a ShotgunMenuItem is supplied by the user, the new command entry will be a child of this menu item.

Returns

The MenuItem newly created.

class alPy::MenuItem

An item that can be added to the Menu class object.

This class object is only available in OpenAlias.

Public Functions

MenuItem(std::string label)

Class constructor.

Parameters

label – the menu item label.

virtual ~MenuItem()

Class Destructor.

void addCommandToMenu(void (*alias_callback)(void), bool add_separator, MenuItem *parent)

Add a command entry to the menu.

Parameters
  • alias_callback – callback which will be executed when clicking on the Alias menu entry because of Alias API, we need to have the following signature void (*action)( void )

  • add_separator – if True, add a separator in front of the menu item which will be created

  • parent – if a MenuItem is supplied by the user, the new command entry will be a child of this menu item.

void addToMenu(MenuItem *parent)

Add am item to the menu. Usually, this is useful to create a submenu entry.

Parameters

parent – if a MenuItem is supplied by the user, the new command entry will be a child of this menu item.

void removeFromMenu()

Properly remove an item from the menu.

Warning

doxygenclass: Cannot find class “alPy::Reference” in doxygen xml output for project “alias-python-api” from directory: C:/Jenkins/workspace/d-shotgun_alias-python-api_PR-44/build/python3_AliasSurface2019/bin/Release/docs//doxygen/xml

class Stage

Object encapsulating an Alias stage.

class alPy::Variant

Public Functions

Variant(AlBookmarkPtr *bookmark, const std::string &path)

Class Constructor.

Parameters
  • bookmark – the AlBookmarkPtr that this Variant references

  • path – the path to the Variant

virtual ~Variant()

Class Destructor.

std::string getName() const

Return the Variant name.

Returns

The name of the Variant.

std::string getPath() const

Return the Variant thumbnail file path.

Returns

The file path to the Variant thumbnail image.

Public Static Functions

static bool hasVariants()

Check if the current file contains at least one variant. /**.

Check if the current file contains at least one variant.

Returns

True if the file contains variants, otherwise false.

static std::vector<Variant*> getVariants()

Get the list of variants for the current file in Alias.

For each variant of the current file, generate the associated thumbnail and get its path. Get also the variant name and return everything as a Python list.

NOTE: this function works only in OpenAlias.

Returns

A list of Variant objects