Skip to content

Commit

Permalink
Merge pull request #121 from RafaelVillar/iterator_reset_bugfix
Browse files Browse the repository at this point in the history
reset_iterator starts from the first validatorOrder value #114 #120
  • Loading branch information
mottosso authored Feb 1, 2021
2 parents f0db29d + baf76b2 commit e94b3ef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
15 changes: 12 additions & 3 deletions pyblish_lite/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from .vendor.Qt import QtCore

import pyblish.api
import pyblish.lib
import pyblish.util
import pyblish.logic

Expand Down Expand Up @@ -81,6 +82,7 @@ def reset(self):
def validate(self):
# The iterator doesn't sync with the GUI check states so
# reset the iterator to ensure we grab the updated instances
# assuming the plugins are already sorted from api.Discover()
self._reset_iterator(start_from=pyblish.api.ValidatorOrder)
self._run(until=pyblish.api.ValidatorOrder,
on_finished=self.on_validated)
Expand Down Expand Up @@ -240,9 +242,16 @@ def _current_pair_is_active(self):

def _reset_iterator(self, start_from=-float("inf")):
self.is_running = True
self.pair_generator = self._iterator(self.plugins,
self.context,
start_from)
self.pair_generator = self._iterator(
self.plugins,
self.context,

# Minus 0.5, because each order is a range of values,
# from -0.5 to 0.5. E.g. ExtractorOrder is 2, and spans
# between 1.5-2.5
start_from - 0.5
)

self.current_pair = next(self.pair_generator, (None, None))
self.is_running = False

Expand Down
2 changes: 1 addition & 1 deletion pyblish_lite/version.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

VERSION_MAJOR = 0
VERSION_MINOR = 8
VERSION_PATCH = 11
VERSION_PATCH = 12

version_info = (VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH)
version = '%i.%i.%i' % version_info
Expand Down

0 comments on commit e94b3ef

Please sign in to comment.