fastplotlib icon indicating copy to clipboard operation
fastplotlib copied to clipboard

`pointer_leave` events `pick_info` always comes from the `Frame` mesh plane

Open kushalkolar opened this issue 1 year ago • 2 comments

This is a result of #740 that I did not anticipate 😂 . Anytime we have a pointer_leave event on an object in the Subplot Scene, it will pickup the plane mesh of the subplot Frame for the picking info.

Example, when leaving any one of these scatter points:

<pygfx.objects._events.PointerEvent object at 0x7fa7a40b20d0>
{'rgba': Color(0.8784, 0.8431, 0.098, 1.0), 'world_object': <pygfx.Mesh  at 0x7fa7ff5e1090>, 'face_index': 1, 'face_coord': (0.06349206349206349, 0.6031746031746031, 0.31746031746031744)}

Image

@almarklein do you think the best thing to do is just filter out the plane mesh anytime it appears in the pick info? In fastplotlib the events handling is wrapped so that's easy to do:

https://github.com/fastplotlib/fastplotlib/blob/d97307b3ac35d20081d0e1623878555f1f5a1cef/fastplotlib/graphics/_base.py#L300-L312

kushalkolar avatar Mar 27 '25 02:03 kushalkolar

Why is the plane's material.pick_write set to True in the first place?

almarklein avatar Mar 27 '25 13:03 almarklein

So that it's moveable, https://github.com/fastplotlib/fastplotlib/pull/740#issuecomment-2705394129

kushalkolar avatar Mar 27 '25 15:03 kushalkolar