Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modifying geometry in event callback before rendering to depth buffer (thread issue?) #6290

Open
3 tasks done
ghweber opened this issue Aug 2, 2023 · 0 comments
Open
3 tasks done

Comments

@ghweber
Copy link

ghweber commented Aug 2, 2023

Checklist

My Question

I am trying to implement location selection similar as in the mouse_and_point_coord.py example. I.e., to get the world coordinates of a point clicked, I render the geometry into a depth buffer (render_to_depth_image) and then use widget3d.scene.camera.unproject to convert pixel coordinates and depth into world coordinates. However, I need to hide some objects of the geometry to exclude them from selection. I am trying to implement a "draggable" point by rendering a sphere at the point location and need to hide the sphere geometry during dragging so that it "sticks" to the "real" scene geometry. However, when I hide the sphere before calling render_to_depth_image it still appears in the depth image (as well as in a color image rendered via render_to_image for debugging purposes). I assume this is because the mouse event handler is used in a different thread. I have tried many approaches bus can't seem to figure out how to change geometry in the main thread and then resume the mouse event handler. Any advice on how to work around that issue?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants