Skip to content

Commit 89f0390

Browse files
committed
[GraphEditor] NodeChunks bar for each iteration of for loop (only UI for now)
1 parent 32b0ed5 commit 89f0390

File tree

1 file changed

+35
-13
lines changed

1 file changed

+35
-13
lines changed

meshroom/ui/qml/GraphEditor/Node.qml

Lines changed: 35 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -377,19 +377,41 @@ Item {
377377
}
378378

379379
// Node Chunks
380-
NodeChunks {
381-
visible: node.isComputable
382-
defaultColor: Colors.sysPalette.mid
383-
implicitHeight: 3
384-
width: parent.width
385-
model: node ? node.chunks : undefined
386-
387-
Rectangle {
388-
anchors.fill: parent
389-
color: Colors.sysPalette.mid
390-
z: -1
391-
}
392-
}
380+
Column {
381+
width: parent.width
382+
383+
spacing: 2
384+
Repeater {
385+
// the model is the number of iterations for the for loop
386+
// so if the count is 0 we display only one iteration
387+
// else we display the number of iterations
388+
model: {
389+
if (node.countForLoop === 0)
390+
return 1
391+
392+
for (let i = 0; i < node.attributes.count; ++i) {
393+
if (node.attributes.at(i).isLink) {
394+
var srcAttr = node.attributes.at(i).linkParam
395+
return srcAttr.root.value.count
396+
}
397+
}
398+
}
399+
400+
delegate: NodeChunks {
401+
visible: node.isComputable
402+
defaultColor: Colors.sysPalette.mid
403+
height: 3
404+
width: parent.width
405+
model: node ? node.chunks : undefined
406+
407+
Rectangle {
408+
anchors.fill: parent
409+
color: Colors.sysPalette.mid
410+
z: -1
411+
}
412+
}
413+
}
414+
}
393415

394416
// Vertical Spacer
395417
Item { width: parent.width; height: 2 }

0 commit comments

Comments
 (0)