diff options
author | Loïc Vital <mugulmotion@gmail.com> | 2022-09-27 11:17:44 +0300 |
---|---|---|
committer | Fabien Castan <fabcastan@gmail.com> | 2022-10-19 11:50:15 +0300 |
commit | 8abe45da5106876e7f0877bac141bc7c71604bed (patch) | |
tree | af81dc5e777dcb97c8cb5bb2d393b07172b0e30d | |
parent | 6b7d4d66a89315608585293aa1b08a6ea4eccb6d (diff) |
[ui] update outputAttributes when displayedNode is undefined
-rw-r--r-- | meshroom/ui/qml/Viewer/Viewer2D.qml | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/meshroom/ui/qml/Viewer/Viewer2D.qml b/meshroom/ui/qml/Viewer/Viewer2D.qml index e47c6bf9..4e0a4106 100644 --- a/meshroom/ui/qml/Viewer/Viewer2D.qml +++ b/meshroom/ui/qml/Viewer/Viewer2D.qml @@ -228,25 +228,21 @@ FocusScope { } onDisplayedNodeChanged: { - // safety check - if (!displayedNode) { - return; - } - var names = []; - // store attr name for output attributes that represent images - for (var i = 0; i < displayedNode.attributes.count; i++) { - var attr = displayedNode.attributes.at(i); - if (attr.isOutput && attr.desc.semantic == "image") { - names.push(attr.name); + // safety check + if (displayedNode) { + // store attr name for output attributes that represent images + for (var i = 0; i < displayedNode.attributes.count; i++) { + var attr = displayedNode.attributes.at(i); + if (attr.isOutput && attr.desc.semantic == "image") { + names.push(attr.name); + } + } + // ensure that we can always visualize the gallery + if (names.length > 0) { + names.push("gallery"); } } - - // ensure that we can always visualize the gallery - if (names.length > 0) { - names.push("gallery"); - } - outputAttribute.names = names; } |