QScreenRayCaster not picking object re-added to graph
-
wrote on 12 Jun 2024, 19:51 last edited by
Hi,
I'm using Qt3D to make a UI with selectable objects. So far everything I did worked great.
I'm using a QScreenRayCaster to pick objects and display them as selected, this works great. I moved away from the QObjectPicker because I also needed to know when the background was clicked, to clear the selection.
Now I have also added the possibility to add and remove objects from the scene. As this is done in a QUndoCommand, the only change I actually do is remove the parent entity of the object, which makes it disappear, and re-set the parent when the command is undone, so the object appears again. But when I do so, the object becomes somehow invisible to picking. Objects created after that are properly pickable, but these become forever completely ignored.Is this some bug, or am I supposed to re-register the object somewhere to make it available for picking again ? I can try to provide a minimal reproduceable example if that can help.
Thanks for any help !
-
wrote on 12 Jun 2024, 20:36 last edited by
I have made a minimal example that reproduces the issue. Sorry I can't post it here because Askimet thinks it's a spam, so here is a link to download the source files:
On this example, the first click on the cylinder make it disappear by removing its parent, then clicking on the background makes it appear again by setting the parent back. But from now on, it becomes invisible to ray casting.
-
wrote on 26 Sept 2024, 19:04 last edited by
Hi, any news on this topic ? Recently I have also been playing with enabled/disabled entities, and the same problem arises. This is really a blocker to setup my interactions.
-
wrote 22 days ago last edited by
Hi - did you manage solve your issue? I'm working on some sort of 3d level editor and will be implementing undo/redo soon, so I may come across the exact same problem...