Ejemplo n.º 1
0
def setup(console=False, port=None):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        console (bool): Display console with GUI
        port (int, optional): Port from which to start looking for an
            available port to connect with Pyblish QML, default
            provided by Pyblish Integration.

    """

    if self._has_been_setup:
        teardown()

    def threaded_wrapper(func, *args, **kwargs):
        return utils.executeInMainThreadWithResult(func, *args, **kwargs)

    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console=console, port=port)

    register_plugins()
    add_to_filemenu()
    register_host()

    self._has_been_setup = True
    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 2
0
def setup(console=False, port=None):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        preload (bool): Preload the current GUI
        console (bool): Display console with GUI

    """

    if not os.name == "nt":
        return pyblish_integration.echo("Sorry, integration only"
                                        "supported on Windows.")

    def threaded_wrapper(func, *args, **kwargs):
        return nuke.executeInMainThreadWithResult(func, args, kwargs)

    pyblish_integration.register_python_executable(where("python"))
    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console=console, port=port)

    register_plugins()
    register_host()
    add_to_filemenu()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 3
0
def setup(console=False, port=None):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        preload (bool): Preload the current GUI
        console (bool): Display console with GUI

    """

    if not os.name == "nt":
        return pyblish_integration.echo("Sorry, integration only"
                                        "supported on Windows.")

    def threaded_wrapper(func, *args, **kwargs):
        return nuke.executeInMainThreadWithResult(func, args, kwargs)

    pyblish_integration.register_python_executable(where("python"))
    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console=console, port=port)

    register_plugins()
    register_host()
    add_to_filemenu()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 4
0
def teardown():
    """Remove integration"""
    if not self._has_been_setup:
        return

    pyblish_integration.teardown()

    deregister_plugins()
    deregister_host()
    remove_from_filemenu()

    self._has_been_setup = False
    pyblish_integration.echo("pyblish: Integration torn down successfully")
Ejemplo n.º 5
0
def setup(console=False):
    """Setup integration
    Registers Pyblish for Hiero plug-ins and appends an item to the File-menu
    Attributes:
        console (bool): Display console with GUI
    """
    def threaded_wrapper(func, *args, **kwargs):
        return hiero.core.executeInMainThreadWithResult(func, *args, **kwargs)

    pyblish_integration.register_python_executable(where("python"))
    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console)

    register_plugins()
    add_to_filemenu()
    register_host()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 6
0
def setup(console=False):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        preload (bool): Preload the current GUI
        console (bool): Display console with GUI

    """

    pyblish_integration.setup(console)

    register_plugins()
    add_to_filemenu()
    register_host()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 7
0
def setup(console=False):
    """Setup integration
    Registers Pyblish for Hiero plug-ins and appends an item to the File-menu
    Attributes:
        console (bool): Display console with GUI
    """

    def threaded_wrapper(func, *args, **kwargs):
        return hiero.core.executeInMainThreadWithResult(func, *args, **kwargs)

    pyblish_integration.register_python_executable(where("python"))
    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console)

    register_plugins()
    add_to_filemenu()
    register_host()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 8
0
def setup(console=False, port=None):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        preload (bool): Preload the current GUI
        console (bool): Display console with GUI

    """
    def threaded_wrapper(func, *args, **kwargs):
        return hdefereval.executeInMainThreadWithResult(func, *args, **kwargs)

    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console=console, port=port)

    register_host()
    register_plugins()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 9
0
def setup(console=False):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        preload (bool): Preload the current GUI
        console (bool): Display console with GUI

    """

    def threaded_wrapper(func, *args, **kwargs):
        return utils.executeInMainThreadWithResult(func, *args, **kwargs)

    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console)

    register_plugins()
    add_to_filemenu()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 10
0
def setup(console=False, port=None):
    """Setup integration

    Registers Pyblish for Maya plug-ins and appends an item to the File-menu

    Attributes:
        console (bool): Display console with GUI
        port (int, optional): Port from which to start looking for an
            available port to connect with Pyblish QML, default
            provided by Pyblish Integration.

    """

    def threaded_wrapper(func, *args, **kwargs):
        return utils.executeInMainThreadWithResult(func, *args, **kwargs)

    pyblish_integration.register_dispatch_wrapper(threaded_wrapper)
    pyblish_integration.setup(console=console, port=port)

    register_plugins()
    add_to_filemenu()
    register_host()

    pyblish_integration.echo("pyblish: Integration loaded..")
Ejemplo n.º 11
0
def register_plugins():
    # Register accompanying plugins
    plugin_path = os.path.dirname(plugins.__file__)
    pyblish.api.register_plugin_path(plugin_path)
    pyblish_integration.echo("pyblish: Registered %s" % plugin_path)
Ejemplo n.º 12
0
def register_plugins():
    # Register accompanying plugins
    plugin_path = os.path.dirname(plugins.__file__)
    pyblish.api.register_plugin_path(plugin_path)
    pyblish_integration.echo("pyblish: Registered %s" % plugin_path)