diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index 8a277a7f..b2e6c986 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -1170,14 +1170,17 @@ FocusScope { MaterialToolButton { id: displayImageOutputIn3D - enabled: root.aliceVisionPluginAvailable && Filepath.basename(root.source).includes("depthMap") + enabled: root.aliceVisionPluginAvailable && _reconstruction && displayedNode && Filepath.basename(root.source).includes("depthMap") ToolTip.text: "View Depth Map in 3D" text: MaterialIcons.input font.pointSize: 11 Layout.minimumWidth: 0 onClicked: { - root.viewIn3D(root.source); + root.viewIn3D( + root.source, + displayedNode.name + ":" + outputAttribute.name + " " + String(_reconstruction.selectedViewId) + ); } } diff --git a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml index f3fa124f..2b6d9ef9 100644 --- a/meshroom/ui/qml/Viewer3D/MediaLibrary.qml +++ b/meshroom/ui/qml/Viewer3D/MediaLibrary.qml @@ -83,7 +83,7 @@ Entity { return -1; } - function load(filepath) { + function load(filepath, label = undefined) { var pathStr = Filepath.urlToString(filepath); if(!Filepath.exists(pathStr)) { @@ -99,12 +99,11 @@ Entity { // add file to the internal ListModel m.mediaModel.append(makeElement({ "source": pathStr, - "label": Filepath.basename(pathStr), + "label": label ? label : Filepath.basename(pathStr), "section": "External" })); } - function view(attribute) { if(m.sourceToEntity[attribute]) { ensureVisible(attribute); diff --git a/meshroom/ui/qml/Viewer3D/Viewer3D.qml b/meshroom/ui/qml/Viewer3D/Viewer3D.qml index 89b46274..fab4c24b 100644 --- a/meshroom/ui/qml/Viewer3D/Viewer3D.qml +++ b/meshroom/ui/qml/Viewer3D/Viewer3D.qml @@ -36,8 +36,8 @@ FocusScope { mainCamera.viewCenter = defaultCamViewCenter; } - function load(filepath) { - mediaLibrary.load(filepath); + function load(filepath, label = undefined) { + mediaLibrary.load(filepath, label); } /// View 'attribute' in the 3D Viewer. Media will be loaded if needed. diff --git a/meshroom/ui/qml/WorkspaceView.qml b/meshroom/ui/qml/WorkspaceView.qml index 9379da77..ecaf2012 100644 --- a/meshroom/ui/qml/WorkspaceView.qml +++ b/meshroom/ui/qml/WorkspaceView.qml @@ -30,9 +30,9 @@ Item { // Load a 3D media file in the 3D viewer - function load3DMedia(filepath) { + function load3DMedia(filepath, label = undefined) { if(panel3dViewerLoader.active) { - panel3dViewerLoader.item.viewer3D.load(filepath); + panel3dViewerLoader.item.viewer3D.load(filepath, label); } }