diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 9dfc0ad6bca..af328cd2594 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -28,6 +28,9 @@ FocusScope { property bool enable8bitViewer: enable8bitViewerAction.checked property bool enableSequencePlayer: enableSequencePlayerAction.checked + readonly property alias imgContainer: imgContainer + readonly property alias imgLayout: imgLayout + QtObject { id: m property variant viewpointMetadata: { diff --git a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml index 0b5d49bffa8..9ad9c8fe67c 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml @@ -21,6 +21,8 @@ Entity { property Layer frontLayerComponent property var window + property var viewer2DInfo: null + /// Camera to consider for positioning property Camera camera: null @@ -225,6 +227,7 @@ Entity { camera: root.camera renderMode: root.renderMode enabled: visible + viewer2DInfo: root.viewer2DInfo // QObject.destroyed signal is not accessible // Use the object as NodeInstantiator model to be notified of its deletion diff --git a/meshroom/ui/qml/Viewer3D/MediaLoader.qml b/meshroom/ui/qml/Viewer3D/MediaLoader.qml index e56a18ba4af..c28d9e4d4f1 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLoader.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLoader.qml @@ -20,6 +20,8 @@ import Utils 1.0 property var object: null property int renderMode + property var viewer2DInfo: null + /// Scene's current camera property Camera camera: null @@ -91,6 +93,7 @@ import Utils 1.0 'pointSize': Qt.binding(function() { return 0.01 * Viewer3DSettings.pointSize }), 'locatorScale': Qt.binding(function() { return Viewer3DSettings.cameraScale }), 'viewId': Qt.binding(function() { return _reconstruction.selectedViewId }), + 'viewer2DInfo': Qt.binding(function() {return root.viewer2DInfo}), 'cameraPickingEnabled': Qt.binding(function() { return root.enabled }) }); diff --git a/meshroom/ui/qml/Viewer3D/Viewer3D.qml b/meshroom/ui/qml/Viewer3D/Viewer3D.qml index e8be4706500..5f09f901f5b 100644 --- a/meshroom/ui/qml/Viewer3D/Viewer3D.qml +++ b/meshroom/ui/qml/Viewer3D/Viewer3D.qml @@ -29,6 +29,8 @@ FocusScope { readonly property var viewpoint: _reconstruction ? _reconstruction.selectedViewpoint : null readonly property bool doSyncViewpointCamera: Viewer3DSettings.syncViewpointCamera && (viewpoint && viewpoint.isReconstructed) + property alias viewer2DInfo: mediaLibrary.viewer2DInfo + // functions function resetCameraPosition() { mainCamera.position = defaultCamPosition; diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index 24d948313c2..af794fd877b 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -206,6 +206,14 @@ Item { Viewer3D { id: c_viewer3D + viewer2DInfo: { + "x": viewer2D.imgContainer.x, + "y": viewer2D.imgContainer.y, + "width": viewer2D.imgLayout.width, + "height": viewer2D.imgLayout.height, + "scale": viewer2D.imgContainer.scale + } + Layout.fillWidth: true Layout.fillHeight: true Layout.minimumWidth: 20