Skip to content

commands

AYON script commands to be used directly in Maya.

ToolWindows

Source code in client/ayon_maya/api/commands.py
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
class ToolWindows:

    _windows = {}

    @classmethod
    def get_window(cls, tool):
        """Get widget for specific tool.

        Args:
            tool (str): Name of the tool.

        Returns:
            Stored widget.

        """
        try:
            return cls._windows[tool]
        except KeyError:
            return None

    @classmethod
    def set_window(cls, tool, window):
        """Set widget for the tool.

        Args:
            tool (str): Name of the tool.
            window (QtWidgets.QWidget): Widget

        """
        cls._windows[tool] = window

get_window(tool) classmethod

Get widget for specific tool.

Parameters:

Name Type Description Default
tool str

Name of the tool.

required

Returns:

Type Description

Stored widget.

Source code in client/ayon_maya/api/commands.py
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@classmethod
def get_window(cls, tool):
    """Get widget for specific tool.

    Args:
        tool (str): Name of the tool.

    Returns:
        Stored widget.

    """
    try:
        return cls._windows[tool]
    except KeyError:
        return None

set_window(tool, window) classmethod

Set widget for the tool.

Parameters:

Name Type Description Default
tool str

Name of the tool.

required
window QWidget

Widget

required
Source code in client/ayon_maya/api/commands.py
30
31
32
33
34
35
36
37
38
39
@classmethod
def set_window(cls, tool, window):
    """Set widget for the tool.

    Args:
        tool (str): Name of the tool.
        window (QtWidgets.QWidget): Widget

    """
    cls._windows[tool] = window