From b42e7cbd8750728d935a7992b00fc389eb1e1731 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 15 Mar 2023 16:19:24 +0100 Subject: [PATCH 1/2] [nodes] StructureFromMotion: Update description of "initialPair" files "initialPairA" and "initialPairB" can either be the filename of the image (without the path), the whole path of the image, or its view ID. --- meshroom/nodes/aliceVision/StructureFromMotion.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshroom/nodes/aliceVision/StructureFromMotion.py b/meshroom/nodes/aliceVision/StructureFromMotion.py index c16de93a8d..e975a4f639 100644 --- a/meshroom/nodes/aliceVision/StructureFromMotion.py +++ b/meshroom/nodes/aliceVision/StructureFromMotion.py @@ -318,14 +318,14 @@ class StructureFromMotion(desc.AVCommandLineNode): desc.File( name='initialPairA', label='Initial Pair A', - description='Filename of the first image (without path).', + description='View ID or filename of the first image (either with or without the full path).', value='', uid=[0], ), desc.File( name='initialPairB', label='Initial Pair B', - description='Filename of the second image (without path).', + description='View ID or filename of the second image (either with or without the full path).', value='', uid=[0], ), From 790ede0b8904302f812b20f757cc2f56dacb5131 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Candice=20Bent=C3=A9jac?= Date: Wed, 15 Mar 2023 16:14:18 +0100 Subject: [PATCH 2/2] [ui] ImageGallery: Add an option in the menu to set the SfM initial pair Add a "SfM: Define Initial Pair" sub-menu in the Image Gallery menu that is only enabled if the currently active group contains a StructureFromMotion node. Clicking "A" or "B" will automatically set the selected image's view ID as a part of the initial pair. --- meshroom/ui/qml/ImageGallery/ImageDelegate.qml | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/meshroom/ui/qml/ImageGallery/ImageDelegate.qml b/meshroom/ui/qml/ImageGallery/ImageDelegate.qml index fd34e997df..e4216f10e1 100644 --- a/meshroom/ui/qml/ImageGallery/ImageDelegate.qml +++ b/meshroom/ui/qml/ImageGallery/ImageDelegate.qml @@ -84,6 +84,22 @@ Item { enabled: !root.readOnly && _viewpoint.viewId != -1 && _reconstruction && activeNode onClicked: activeNode.attribute("transformation").value = _viewpoint.viewId.toString() } + Menu { + id: sfmSetPairMenu + title: "SfM: Define Initial Pair" + property var activeNode: _reconstruction ? _reconstruction.activeNodes.get("StructureFromMotion").node : null + enabled: !root.readOnly && _viewpoint.viewId != -1 && _reconstruction && activeNode + + MenuItem { + text: "A" + onClicked: sfmSetPairMenu.activeNode.attribute("initialPairA").value = _viewpoint.viewId.toString() + } + + MenuItem { + text: "B" + onClicked: sfmSetPairMenu.activeNode.attribute("initialPairB").value = _viewpoint.viewId.toString() + } + } } ColumnLayout {