Skip to content

Commit e4f1b2a

Browse files
Alxiicecbentejac
authored andcommitted
[core] Fix issues on missing chunks fro sfm node & node chunk indicator
1 parent f113e9a commit e4f1b2a

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

meshroom/core/node.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ class Status(Enum):
5050
STOPPED = 4
5151
KILLED = 5
5252
SUCCESS = 6
53-
# SKIPPED = 7
5453
INPUT = 7 # Special status for input nodes
5554

5655

@@ -2211,6 +2210,7 @@ def _resetChunks(self):
22112210
# TODO : Maybe don't delete chunks if we will recreate them as before ?
22122211
"""
22132212
if isinstance(self.nodeDesc, desc.InputNode):
2213+
self._chunksCreated = True
22142214
return
22152215
# Disconnect signals
22162216
for chunk in self._chunks:
@@ -2219,8 +2219,10 @@ def _resetChunks(self):
22192219
self._chunks.setObjectList([])
22202220
# Recreate list with reset values (1 chunk or the static size)
22212221
if not self.isParallelized:
2222-
self._chunksCreated = True
22232222
self.setSize(1)
2223+
self._chunks.setObjectList([NodeChunk(self, desc.Range())])
2224+
self._chunks[0].statusChanged.connect(self.globalStatusChanged)
2225+
self._chunksCreated = True
22242226
elif isinstance(self.nodeDesc.size, desc.computation.StaticNodeSize):
22252227
self._chunksCreated = True
22262228
self.setSize(self.nodeDesc.size.computeSize(self))

meshroom/ui/qml/GraphEditor/Node.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ Item {
496496
// Node Chunks
497497
NodeChunks {
498498
visible: node.isComputableType
499-
nodeStatus: node ? node.globalStatus : "NONE"
499+
targetNode: node
500500
defaultColor: Colors.sysPalette.mid
501501
implicitHeight: 3
502502
width: parent.width

meshroom/ui/qml/GraphEditor/NodeChunks.qml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ ListView {
99

1010
SystemPalette { id: activePalette }
1111

12-
property string nodeStatus: "NONE"
12+
property var targetNode: null
13+
1314
property color defaultColor: Qt.darker(activePalette.window, 1.1)
1415
property real chunkHeight: height
1516
property int modelSize: model ? model.count : 0
@@ -38,10 +39,14 @@ ListView {
3839
}
3940
}
4041

41-
// Default rectangle shown when model is empty/undefined
42+
// Default rectangle shown when model is empty/undefined (= no chunks)
4243
Rectangle {
4344
anchors.fill: parent
44-
color: nodeStatus == "NONE" ? Colors.darkpurple : Colors.statusColors[nodeStatus]
45+
color: root.targetNode !== null
46+
? (root.targetNode.globalStatus === "NONE"
47+
? Colors.darkpurple
48+
: Colors.statusColors[root.targetNode.globalStatus])
49+
: "transparent"
4550
enabled: modelSize == 0
4651
visible: enabled
4752
}

meshroom/ui/qml/Utils/Colors.qml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ QtObject {
2828
"RUNNING": orange,
2929
"ERROR": red,
3030
"SUCCESS": green,
31-
"STOPPED": pink
31+
"STOPPED": pink,
32+
"INPUT": "transparent"
3233
}
3334

3435
readonly property var ghostColors: {

meshroom/ui/reconstruction.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1031,7 +1031,8 @@ def _setSfm(self, node):
10311031
# disconnection step in 'setSfm' (at this point, 'self._sfm' underlying object
10321032
# has been destroyed and can't be evaluated anymore)
10331033
self._sfm.destroyed.connect(self._unsetSfm)
1034-
self._sfm.chunks[0].statusChanged.connect(self.updateSfMResults)
1034+
if len(self._sfm._chunks) > 0:
1035+
self._sfm.chunks[0].statusChanged.connect(self.updateSfMResults)
10351036
self.sfmChanged.emit()
10361037

10371038
def setSfm(self, node):

0 commit comments

Comments
 (0)