-
-
Notifications
You must be signed in to change notification settings - Fork 53
Add a Selection Gizmo #753
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
base: main
Are you sure you want to change the base?
Conversation
self._ndc_to_screen = screen_space.inverse_matrix | ||
self._screen_to_ndc = screen_space.matrix | ||
|
||
def add_default_event_handlers(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think a clear_handlers
method would help with garbage collection
"pointer_move", | ||
"pointer_up", | ||
) | ||
# Not sure we actually need to update the gizmo during rendering |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
true I'm a bit confused by this as well
What do you think about drawing a rectangle (or arbitrary shape with lasso) and allowing it to stay in the scene so it can be moved around? (That could be another selection tool class, I'm just thinking if it'd be easy to do here 🤔 ) |
Certainly possible. I've added it to the potential TODOs. |
A few other things I can think of are resize handlers and a circular/elliptical selection tool. Anyways we can chat more on Friday. This actually helps us a lot with the fastplotlib roadmap! |
Hi, I don't want to be blocking this PR if you guys want to merge it! |
this is so cool! My implementation in 3D view looks like this: Aufzeichnung.2024-09-17.113023.mp4I am drawing the selection area by using the nearest object in my scene. It would be great to have your implementation worked out, so I could get rid of mine :D |
This is a draft PR for adding a selection gizmo (see #745).
Screen.Recording.2024-05-08.at.15.47.16.mov
Potential TODOs:
SelectionGizmo.is_inside
I'm aware that this might be out of the scope for
pygfx
itself as you may not want to weigh yourself down with having to maintain too many non-essential bits and pieces. If that's the case, no hard feeling! Also no worries if this implementation is going in the wrong direction.Have a look & let me know what you think.