diff options
author | Loïc Vital <mugulmotion@gmail.com> | 2022-09-16 18:01:07 +0300 |
---|---|---|
committer | Fabien Castan <fabcastan@gmail.com> | 2022-10-19 11:50:07 +0300 |
commit | fc5ab540f5a231a2510997d61d65c600bcb9e394 (patch) | |
tree | 8eaf50a4fa6a7582b380e9a44b86481e4249729e | |
parent | ab0e132121a0372e6712f346f63c3ffd7348a070 (diff) |
added outputImageTypes in node desc to update the viewer2D imageType combo box when double clicking a node
-rw-r--r-- | meshroom/core/desc.py | 1 | ||||
-rw-r--r-- | meshroom/core/node.py | 4 | ||||
-rw-r--r-- | meshroom/nodes/aliceVision/DepthMap.py | 2 | ||||
-rw-r--r-- | meshroom/ui/qml/Viewer/Viewer2D.qml | 6 | ||||
-rwxr-xr-x | meshroom/ui/qml/main.qml | 6 |
5 files changed, 18 insertions, 1 deletions
diff --git a/meshroom/core/desc.py b/meshroom/core/desc.py index 6766f729..1810c9d2 100644 --- a/meshroom/core/desc.py +++ b/meshroom/core/desc.py @@ -489,6 +489,7 @@ class Node(object): parallelization = None documentation = '' category = 'Other' + outputImageTypes = ['image'] def __init__(self): pass diff --git a/meshroom/core/node.py b/meshroom/core/node.py index 372c5384..25b05443 100644 --- a/meshroom/core/node.py +++ b/meshroom/core/node.py @@ -568,6 +568,9 @@ class BaseNode(BaseObject): def getAttributes(self): return self._attributes + def getOutputImageTypes(self): + return self.nodeDesc.outputImageTypes + @Slot(str, result=bool) def hasAttribute(self, name): return name in self._attributes.keys() @@ -1053,6 +1056,7 @@ class BaseNode(BaseObject): x = Property(float, lambda self: self._position.x, notify=positionChanged) y = Property(float, lambda self: self._position.y, notify=positionChanged) attributes = Property(BaseObject, getAttributes, constant=True) + outputImageTypes = Property(Variant, getOutputImageTypes, constant=True) internalFolderChanged = Signal() internalFolder = Property(str, internalFolder.fget, notify=internalFolderChanged) depthChanged = Signal() diff --git a/meshroom/nodes/aliceVision/DepthMap.py b/meshroom/nodes/aliceVision/DepthMap.py index e1d84225..8bd810e2 100644 --- a/meshroom/nodes/aliceVision/DepthMap.py +++ b/meshroom/nodes/aliceVision/DepthMap.py @@ -299,3 +299,5 @@ Use a downscale factor of one (full-resolution) only if the quality of the input uid=[], ), ] + + outputImageTypes = ['depth', 'sim'] diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 8bd2ceb1..f60e5e26 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -165,6 +165,10 @@ FocusScope { return ""; } + function setImageTypes(types) { + imageType.types = types; + } + // context menu property Component contextMenu: Menu { MenuItem { @@ -998,7 +1002,7 @@ FocusScope { Layout.preferredWidth: 6.0 * Qt.application.font.pixelSize flat: true - property var types: ["image", "depth", "sim"] + property var types: ["image"] property string type: enabled ? types[currentIndex] : types[0] model: types diff --git a/meshroom/ui/qml/main.qml b/meshroom/ui/qml/main.qml index db218e19..bd3977dd 100755 --- a/meshroom/ui/qml/main.qml +++ b/meshroom/ui/qml/main.qml @@ -890,6 +890,10 @@ ApplicationWindow { return false; } + + function setImageTypes(types) { + viewer2D.setImageTypes(types); + } } } @@ -954,6 +958,8 @@ ApplicationWindow { nodeTypesModel: _nodeTypes onNodeDoubleClicked: { + workspaceView.setImageTypes(node.outputImageTypes); + _reconstruction.setActiveNode(node); let viewable = false; |