mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-06-06 21:01:59 +02:00
[ui] Sync camera gizmo in Viewer3D enabled
This commit is contained in:
parent
361f777118
commit
369143eca1
6 changed files with 19 additions and 2 deletions
|
@ -22,6 +22,7 @@ FloatingPane {
|
|||
// Exposed properties
|
||||
property var sortedViewIds: []
|
||||
property var viewer: null
|
||||
readonly property alias sync3DSelected: m.sync3DSelected
|
||||
|
||||
function updateReconstructionView() {
|
||||
if (_reconstruction && m.frame >= 0 && m.frame < sortedViewIds.length) {
|
||||
|
|
|
@ -28,6 +28,8 @@ FocusScope {
|
|||
property bool enable8bitViewer: enable8bitViewerAction.checked
|
||||
property bool enableSequencePlayer: enableSequencePlayerAction.checked
|
||||
|
||||
readonly property alias sync3DSelected: sequencePlayer.sync3DSelected
|
||||
|
||||
QtObject {
|
||||
id: m
|
||||
property variant viewpointMetadata: {
|
||||
|
|
|
@ -112,7 +112,8 @@ import Utils 1.0
|
|||
'locatorScale': Qt.binding(function() { return Viewer3DSettings.cameraScale }),
|
||||
'cameraPickingEnabled': Qt.binding(function() { return root.enabled }),
|
||||
'resectionId': Qt.binding(function() { return Viewer3DSettings.resectionId }),
|
||||
'displayResections': Qt.binding(function() { return Viewer3DSettings.displayResectionIds })
|
||||
'displayResections': Qt.binding(function() { return Viewer3DSettings.displayResectionIds }),
|
||||
'syncPickedViewId': Qt.binding(function() { return Viewer3DSettings.syncWithPickedViewId })
|
||||
});
|
||||
|
||||
obj.statusChanged.connect(function() {
|
||||
|
|
|
@ -12,6 +12,8 @@ SfmDataEntity {
|
|||
id: root
|
||||
|
||||
property bool cameraPickingEnabled: true
|
||||
property bool syncPickedViewId: false
|
||||
|
||||
// filter out non-reconstructed cameras
|
||||
skipHidden: true
|
||||
|
||||
|
@ -22,6 +24,9 @@ SfmDataEntity {
|
|||
function onSelectedViewIdChanged() {
|
||||
root.cameraSelected(_reconstruction.selectedViewId)
|
||||
}
|
||||
function onSelectedViewpointChanged() {
|
||||
root.cameraSelected(_reconstruction.pickedViewId)
|
||||
}
|
||||
}
|
||||
|
||||
function spawnCameraSelectors() {
|
||||
|
@ -96,7 +101,7 @@ SfmDataEntity {
|
|||
},
|
||||
PhongMaterial{
|
||||
id: mat
|
||||
ambient: _reconstruction && viewId === _reconstruction.selectedViewId ? activePalette.highlight : customColor // "#CCC"
|
||||
ambient: _reconstruction && (viewId === _reconstruction.selectedViewId || (viewId === _reconstruction.pickedViewId && syncPickedViewId)) ? activePalette.highlight : customColor // "#CCC"
|
||||
diffuse: cameraPicker.containsMouse ? Qt.lighter(activePalette.highlight, 1.2) : ambient
|
||||
},
|
||||
ObjectPicker {
|
||||
|
|
|
@ -51,6 +51,7 @@ Item {
|
|||
property bool displayOrigin: false
|
||||
// Camera
|
||||
property bool syncViewpointCamera: false
|
||||
property bool syncWithPickedViewId: false // Sync active camera with picked view ID from sequence player if the setting is enabled
|
||||
property bool viewpointImageOverlay: true
|
||||
property real viewpointImageOverlayOpacity: 0.5
|
||||
readonly property bool showViewpointImageOverlay: syncViewpointCamera && viewpointImageOverlay
|
||||
|
|
|
@ -226,6 +226,13 @@ Item {
|
|||
drop.urls.forEach(function(url){ load3DMedia(url); });
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: viewer2D
|
||||
function onSync3DSelectedChanged() {
|
||||
Viewer3DSettings.syncWithPickedViewId = viewer2D.sync3DSelected
|
||||
}
|
||||
}
|
||||
|
||||
// Load reconstructed model
|
||||
Button {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue