Details
Description
Picking in a detached imported scene fails after second time the scene is imported to a View3D. The attached project can be used to reproduce this when opened inside QDS dev built against Qt 6.5.1.
- Open attached project in QDS. Make sure 6.5.1 kit is used.
- Click on "group" item in navigator (this is our detached scene)
- Click on cylinder in 3D view -> cylinder is seleted correctly
- Click on "view3D" item on navigator to change the scene
- Click again on "group" to change the scene back to detached scene
- Click on cylinder in 3D view -> cylinder is is not selected
The problem appears to be that on the second time the detached scene is used as importScene, it is still using the same old backend node from the first time. Since the old node exists and is still same as the current node after running updateSpatialNode(), the node is not added to the node map in QQuick3DSceneManager::updateDirtySpatialNode(). This means that picking cannot resolve the frontend node from the backend node.