Integrate with red extractor


#1

Hello again
i have another problem here.
i want to know there is possible to integrate files when we have red extractor?

i think integration is a step after extraction, means when we have red extractor pyblish should not be reach to integrate point!!

This is an image

please let’s talk!

and i should say that i’m using Pyblish 1.3.1 yet

This is necessary to stop process when extractor is red, for example, when our C:\ drive is full and does not have any space, i don’t want to save bad data to my storage on disk
make sense?!

thanks


#2

This is actually the same question as Stopping Execution a couple of days back. Please refer to that topic regarding a possible solution (overwriting the default tests), etc.

In that topic is also mentioned that the original design was to have Validators in place so that when passing validation nothing should ever go wrong. Yet in practice it’s hard to capture all bugs or specific cases.

Having no space for example could be validated. Yet if there’s 100 GB free space and the extractor would write out a (unknowingly beforehand) huge cache file that’d exceed that then the problem persists.

Since it’s a stumbling block it could be a good idea to think about alternatives (like overriding default_tests) and ensuring pipeline safety is first.


#3

Hi @Mahmoodreza_Aarabi,

Have a look here for why integration continues, even though extraction fails.

In your case, by default it would be up to your validators to ensure there is enough space on disk to actually perform extraction. If they either can’t or they produce a false positive, one alternative or fallback is for your extractor(s) to communicate to your integrator(s) that something bad enough happened for them to stop what they are doing.

class SceneExtractor(pyblish.api.InstancePlugin):
  ...
  def process(self, instance):
    data = instance.context.data

    try:
      cmds.file(data["tempdir"], saveAs=True)
    except OSError:
      data["criticalError"] = "Scene file export failed"


class Integrator(pyblish.api.ContextPlugin):
  ...
  def process(self, context):
    if "criticalError" in context.data:
      raise Exception(context.data["criticalError"])

    # otherwise go on as usual

Now your integrator will fail (and appear red) if extraction encountered a bad enough problem.


#5

Thanks bigroy
i will review it


#6

Hey marcus
thanks for your help
i think it woks fine
i will test this method
thanks