Eureka!
Got an idea of how to solve the issue of using third-party plug-ins in an already established publishing pipeline. Rather than providing a fixed family, allow the end-user to indicate what families a plug-in is meant to process!
Example Usage
This is what a user might do after having installed Pyblish Alembic.
import pyblish_alembic
pyblish_alembic.register_family("ExtractModel", "character.model")
pyblish_alembic.register_family("ExtractPointcache", "character.rig")
Example Implementation
And this is how Pyblish Alembic could be implemented.
import pyblish_alembic
import pyblish.api as pyblish
class ExtractModel(pyblish.Extractor):
families = pyblish_alembic.registered_families("ExtractModel")
def process(self, instance):
# extract instances of registered families
Your comment struck a chord with me, @BigRoy, in that it makes more sense to associate instances with standalone Extractors than the inverse. This way, a studio can have associate their existing asset families with plug-ins provided by a Pyblish package, without much effort.
The package would define an interface for each of it’s plug-ins that their Instance
's would need to align with, similar to what we talked about above.
For example, an extractor could start off like this.
class ExtractModel(pyblish.Extractor):
families = pyblish_alembic.registered_families("ExtractModel")
def process(self, instance):
# 1. Validate interface
assert instance.has_data("pyblishAlembicSpecficAttribute"),
"%s is not compatible with %s" % (instance, self)
# 2. Instance is compatible, carry on.
For which documentation can specify how to make your instances compatible.
Example Documentation
- Instances must contain the data-member
pyblishAlembicSpecificAttribute
- The data-member must have a value of
True