mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-24 21:04:40 +01:00
use settings to decide if new integrator should skip instances
This commit is contained in:
parent
f398fae425
commit
1a024d3552
1 changed files with 37 additions and 0 deletions
|
|
@ -167,11 +167,15 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
"project", "asset", "task", "subset", "version", "representation",
|
||||
"family", "hierarchy", "username"
|
||||
]
|
||||
skip_host_families = []
|
||||
|
||||
# Attributes set by settings
|
||||
template_name_profiles = None
|
||||
|
||||
def process(self, instance):
|
||||
if self._temp_skip_instance_by_settings(instance):
|
||||
return
|
||||
|
||||
# Mark instance as processed for legacy integrator
|
||||
instance.data["processedWithNewIntegrator"] = True
|
||||
|
||||
|
|
@ -213,6 +217,39 @@ class IntegrateAsset(pyblish.api.InstancePlugin):
|
|||
# the try, except.
|
||||
file_transactions.finalize()
|
||||
|
||||
def _temp_skip_instance_by_settings(self, instance):
|
||||
"""Decide if instance will be processed with new or legacy integrator.
|
||||
|
||||
This is temporary solution until we test all usecases with new (this)
|
||||
integrator plugin.
|
||||
"""
|
||||
|
||||
host_name = instance.context.data["hostName"]
|
||||
instance_family = instance.data["family"]
|
||||
instance_families = set(instance.data.get("families") or [])
|
||||
|
||||
skip = False
|
||||
for item in self.skip_host_families:
|
||||
if item["host"] != host_name:
|
||||
continue
|
||||
|
||||
families = set(item["families"])
|
||||
if instance_family in families:
|
||||
skip = True
|
||||
break
|
||||
|
||||
for family in instance_families:
|
||||
if family in families:
|
||||
skip = True
|
||||
break
|
||||
|
||||
if skip:
|
||||
break
|
||||
|
||||
if skip:
|
||||
self.log.debug("Instance is marked to be skipped by settings.")
|
||||
return skip
|
||||
|
||||
def filter_representations(self, instance):
|
||||
# Prepare repsentations that should be integrated
|
||||
repres = instance.data.get("representations")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue