Skip to content

Commit 606cfc3

Browse files
committed
[ui] Viewer3D: fix Alembic visibility issues
Binding the "enabled" property of AlembicLoader's ObjectPicker to the parent MediaLoader's own "enabled" property caused invalid state where the loaded AlembicEntity was partially visible when toggling object visibility (since Qt 5.13). In order to disable camera picking when AlembicEntity is disable, scale the camSelector component to 0.
1 parent 696d8d5 commit 606cfc3

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

meshroom/ui/qml/Viewer3D/AlembicLoader.qml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import Qt3D.Extras 2.1
1111
AlembicEntity {
1212
id: root
1313

14+
property bool cameraPickingEnabled: true
1415
// filter out non-reconstructed cameras
1516
skipHidden: true
1617

@@ -52,9 +53,13 @@ AlembicEntity {
5253
},
5354
ObjectPicker {
5455
id: cameraPicker
55-
enabled: root.enabled
56-
onClicked: _reconstruction.selectedViewId = camSelector.viewId
57-
}
56+
onPressed: pick.accepted = cameraPickingEnabled
57+
onReleased: _reconstruction.selectedViewId = camSelector.viewId
58+
},
59+
// Qt 5.13: binding cameraPicker.enabled to cameraPickerEnabled
60+
// causes rendering issues when entity gets disabled.
61+
// Use a scale to 0 to disable picking.
62+
Transform { scale: cameraPickingEnabled ? 1 : 0 }
5863
]
5964
}
6065
}

meshroom/ui/qml/Viewer3D/MediaLibrary.qml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ Entity {
275275

276276
components: [
277277
ObjectPicker {
278-
enabled: parent.enabled && pickingEnabled
278+
enabled: mediaLoader.enabled && pickingEnabled
279279
hoverEnabled: false
280280
onPressed: root.pressed(pick)
281281
}

meshroom/ui/qml/Viewer3D/MediaLoader.qml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,14 +80,13 @@ import Utils 1.0
8080
id: abcLoaderEntityComponent
8181
MediaLoaderEntity {
8282
id: abcLoaderEntity
83-
enabled: root.enabled
8483
Component.onCompleted: {
8584

8685
var obj = Viewer3DSettings.abcLoaderComp.createObject(abcLoaderEntity, {
8786
'source': source,
8887
'pointSize': Qt.binding(function() { return 0.01 * Viewer3DSettings.pointSize }),
8988
'locatorScale': Qt.binding(function() { return Viewer3DSettings.cameraScale }),
90-
'enabled': Qt.binding(function() { return root.enabled })
89+
'cameraPickingEnabled': Qt.binding(function() { return root.enabled })
9190
});
9291

9392
obj.statusChanged.connect(function() {

0 commit comments

Comments
 (0)