Skip to content

Using positive and negative offsets leading to some Plug-Ins being processed multiple times #127

@Etherkirby

Description

@Etherkirby

When using a mix of Plug-Ins with positive and negative offsets, some Plug-Ins get executed twice, depending on where you continue the publishing process.

Example structure:

  • Collector1 (order=CollectorOrder)
  • Collector2 (order=CollectorOrder + 0.4)
  • Validator1 (order=ValidatorOrder - 0.4)
  • Validator2 (order=ValidatorOrder)
  • Validator3 (order=ValidatorOrder + 0.4)
  • Extractor1 (order=ExtractorOrder - 0.4)
  • Extractor2 (order=ExtractorOrder)
  • Integrator

With these example Plug-Ins, we can run into either Collector2 or Validator3 being run twice. Here's how:

  • Open Pyblish Lite UI
  • Collection will run
  • Pressing the "Play" Button now will lead to Collector2 being processed an additional time.
  • Instead, if we press the "Validate" Button first, all Validators run as expected without any Collectors being run twice.
  • If we now press the "Play" Button, Validator3 will be processed an additional time.

This problem seems to happen here, because we take the .order of the next Plug-In to run and always subtract 0.5 from it to find out where we should start. This in turn causes an issue if the next order is actually using a negative offset and will go back more than it needs to:

  • Start of Collection
  • Collector1 is processed
  • Collector2 is processed (0 + 0.4 = 0.4)
  • Press "Publish" button
  • Next Plug-In is Validator1 (1 - 0.4 = 0.6)
  • We subtract 0.5 from this to figure out where to continue (0.6 - 0.5 = 0.1)
  • Collector2 is processed again
  • Validator1 is processed
  • Validator2 is processed
  • ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions