avalon.mock.creators

Here are the examples of the python api avalon.mock.creators taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 Source : window.py
with MIT License
from pypeclub

def show(debug=False, parent=None):
    """Display asset creator GUI

    Arguments:
        debug (bool, optional): Run loader in debug-mode,
            defaults to False
        parent (QtCore.QObject, optional): When provided parent the interface
            to this QObject.

    """

    try:
        module.window.close()
        del(module.window)
    except (AttributeError, RuntimeError):
        pass

    if debug:
        from avalon import mock
        for creator in mock.creators:
            api.register_plugin(LegacyCreator, creator)

        import traceback
        sys.excepthook = lambda typ, val, tb: traceback.print_last()

        io.install()

        any_project = next(
            project for project in io.projects()
            if project.get("active", True) is not False
        )

        api.Session["AVALON_PROJECT"] = any_project["name"]
        module.project = any_project["name"]

    with qt_app_context():
        window = CreatorWindow(parent)
        window.refresh()
        window.show()

        module.window = window

        # Pull window to the front.
        module.window.raise_()
        module.window.activateWindow()