Skip to content

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

Open
@ghweber

Description

@ghweber

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?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions