mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-04-29 10:17:27 +02:00
[ui] ensure all node types used in the UI are declared
Avoid qml errors when accessing non-existing nodes. The entry exist in the dict and we retrieve a null node.
This commit is contained in:
parent
727a4d129b
commit
426855baa6
1 changed files with 15 additions and 1 deletions
|
@ -453,6 +453,16 @@ class Reconstruction(UIGraph):
|
||||||
# Nodes that can be used to provide matches folders to the UI
|
# Nodes that can be used to provide matches folders to the UI
|
||||||
"matchProvider": ["FeatureMatching", "StructureFromMotion"]
|
"matchProvider": ["FeatureMatching", "StructureFromMotion"]
|
||||||
}
|
}
|
||||||
|
# Nodes accessed from the UI
|
||||||
|
uiNodes = [
|
||||||
|
"LdrToHdrMerge",
|
||||||
|
"LdrToHdrCalibration",
|
||||||
|
"ImageProcessing",
|
||||||
|
"PhotometricStereo",
|
||||||
|
"PanoramaInit",
|
||||||
|
"ColorCheckerDetection",
|
||||||
|
"SphereDetection",
|
||||||
|
]
|
||||||
|
|
||||||
def __init__(self, undoStack: commands.UndoStack, taskManager: TaskManager, defaultPipeline: str="", parent: QObject=None):
|
def __init__(self, undoStack: commands.UndoStack, taskManager: TaskManager, defaultPipeline: str="", parent: QObject=None):
|
||||||
super(Reconstruction, self).__init__(undoStack, taskManager, parent)
|
super(Reconstruction, self).__init__(undoStack, taskManager, parent)
|
||||||
|
@ -516,7 +526,11 @@ class Reconstruction(UIGraph):
|
||||||
# Create all possible entries
|
# Create all possible entries
|
||||||
for category, _ in self.activeNodeCategories.items():
|
for category, _ in self.activeNodeCategories.items():
|
||||||
self._activeNodes.add(ActiveNode(category, parent=self))
|
self._activeNodes.add(ActiveNode(category, parent=self))
|
||||||
for nodeType, _ in meshroom.core.nodesDesc.items():
|
# For all nodes declared to be accessed by the UI
|
||||||
|
usedNodeTypes = {j for i in self.activeNodeCategories.values() for j in i}
|
||||||
|
allUiNodes = set(self.uiNodes) | usedNodeTypes
|
||||||
|
allLoadedNodeTypes = set(meshroom.core.nodesDesc.keys())
|
||||||
|
for nodeType in allUiNodes:
|
||||||
self._activeNodes.add(ActiveNode(nodeType, parent=self))
|
self._activeNodes.add(ActiveNode(nodeType, parent=self))
|
||||||
|
|
||||||
def clearActiveNodes(self):
|
def clearActiveNodes(self):
|
||||||
|
|
Loading…
Add table
Reference in a new issue