I’ve also been considering the benefits of a pyblish-integration
package.
Currently, integrations are nearly identical, with the primary difference being how Pyblish is added to the GUI and minor host-dependent utility functions like maintaining selection during extraction.
Initially, I expected there to be a bulk of work involved in getting Pyblish to run commands in a host, but so far almost all hosts have provided an almost identical wrapper that solved all problems - i.e. executeInMainThreadWithResult
.
An integration package could work along the lines of this.
# Maya integration psuedo
import maya.util
import pyblish_integration
pyblish_integration.register_threaded_wrapper(
maya.util.executeInMainThreadWithResult)
def gui_callback():
"""Append Publish to file-menu"""
maya.cmds.menu("Publish")
pyblish_integration.register_gui_callback(gui_callback)
Except…
…in cases where a wrapper isn’t enough. The Modo integration is an example of this, and looks like Fusion is too.
Still, perhaps it could provide what is common, whilst still allowing for bespoke integrations to take place. It may even be possible, or even likely, that whatever it takes to get Fusion integrated is the exact same procedure as for Modo and possibly other hosts as well.
You are probably right. They exist for legacy reasons, as Pyblish used to be (and still can be, actually) fully installed via pip
. But it isn’t a lasting solution, as we’ve covered already.