Skip to content

Commit

Permalink
Merge pull request #1936 from alicevision/dev/sfmSetPair
Browse files Browse the repository at this point in the history
Image Gallery: Add a menu to set the StructureFromMotion initial pair from the gallery
  • Loading branch information
fabiencastan authored Mar 18, 2023
2 parents 736d069 + 790ede0 commit 9d269ba
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
4 changes: 2 additions & 2 deletions meshroom/nodes/aliceVision/StructureFromMotion.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
),
Expand Down
16 changes: 16 additions & 0 deletions meshroom/ui/qml/ImageGallery/ImageDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 9d269ba

Please sign in to comment.