mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-07-30 14:58:37 +02:00
[core] handle unsatisfied node parallelization requirements
* catch error in case the required attribute is not found in preceding nodes * set an empty list of chunks when this happens * avoid uncatched exceptions in the middle of an update
This commit is contained in:
parent
ccaac43b34
commit
80cad9386a
2 changed files with 17 additions and 7 deletions
|
@ -785,13 +785,19 @@ class Node(BaseObject):
|
|||
|
||||
def updateInternals(self):
|
||||
if self.isParallelized:
|
||||
ranges = self.nodeDesc.parallelization.getRanges(self)
|
||||
if len(ranges) != len(self.chunks):
|
||||
self._chunks = [NodeChunk(self, range) for range in ranges]
|
||||
try:
|
||||
ranges = self.nodeDesc.parallelization.getRanges(self)
|
||||
if len(ranges) != len(self.chunks):
|
||||
self._chunks = [NodeChunk(self, range) for range in ranges]
|
||||
self.chunksChanged.emit()
|
||||
else:
|
||||
for chunk, range in zip(self.chunks, ranges):
|
||||
chunk.range = range
|
||||
except RuntimeError:
|
||||
# TODO: set node internal status to error
|
||||
logging.warning("Invalid Parallelization on node {}".format(self._name))
|
||||
self._chunks = []
|
||||
self.chunksChanged.emit()
|
||||
else:
|
||||
for chunk, range in zip(self.chunks, ranges):
|
||||
chunk.range = range
|
||||
else:
|
||||
if len(self._chunks) != 1:
|
||||
self._chunks = [NodeChunk(self, desc.Range())]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue