Closed mottosso closed 8 years ago
It all looks good, but I was wondering why you limited the algorithms to Intersection
, Subset
and Exact
?
but I was wondering why you limited the algorithms to Intersection, Subset and Exact?
I didn't think of it that way, what other algorithms would you like to see? Are you looking to provide your own?
I didn't think of it that way, what other algorithms would you like to see? Are you looking to provide your own?
Yeah, if you wanted to match by something else than the families
data member. For example for pyblish-ftrack its expected for required data members to be present. We are currently working around that by returning early, but the plugin is still run which might be confusing for other users.
Aha, ok. I think that'd be a good topic for a separate feature request. It'd be an entirely new feature, so we'll need to narrow down use-cases and consequences. Off the top of my head, I might worry about every collection of plug-ins defining their own algorithm, making external plug-ins that much less usable, understandable and interchangeable.
Does this feature request at least fulfil the initial requirement from the forums?
Does this feature request at least fulfil the initial requirement from for forums?
It does indeed:-)
This enables the use of multiple families of an instance to be associated with a plug-in, only when said families are a subset of the families supported by a plug-in.
That's a mouth full!
All algorithms
Example
Let's see an example.
In this example,
SpecificPlugin
is associated to instances whose family(ies) are a subset of the supported familiesmodel
andlow
. If the instance does not have at least both of these, it is not a match.This is different from
GenericPlugin
, where only one of the families of an instance need to match any of the supported families of a plug-in.The
match
parameter then is a matching algorithm, as provided by standard set functionality.The default value for this parameter is
api.Intersection
to preserve backwards compatibility. The last possible value isapi.Exact
which means an instance only matches when families of both instance and plug-ins match exactly.See [
test_logic.py
]() for complete examples.