Skip to content

Commit 69a7043

Browse files
committed
[core] node: Check chunk size for nodes with dynamic sizes
Nodes with dynamic sizes may end up in a state where they have no chunk (e.g. because there are no input images for the previous nodes). In this case, the first chunk is the list cannot be accessed as it does not exist yet, raising an `IndexError`. We now check that there is at least an element in the chunk list before accessing it. If there is none, the default execution mode is returned instead.
1 parent 7cac2bf commit 69a7043

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

meshroom/core/node.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,10 @@ def _isInputNode(self):
15421542

15431543
@property
15441544
def globalExecMode(self):
1545-
return self._chunks.at(0).execModeName
1545+
if len(self._chunks):
1546+
return self._chunks.at(0).execModeName
1547+
else:
1548+
return ExecMode.NONE
15461549

15471550
def getChunks(self) -> list[NodeChunk]:
15481551
return self._chunks

0 commit comments

Comments
 (0)