-
-
Notifications
You must be signed in to change notification settings - Fork 152
Fix #50 by refactoring the selection mechanism #513
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
This reverts commit a585f49.
Hey these are great changes, thanks! I still have some input however: Overlapping entity selection:
Workplane selection:
|
No, you should just be able to click to cycle through overlapping entities (I am testing with two lines that partially overlap). Box selection works as far as I can tell. I will look at the workplace selection a bit better. I was annoyed that I could't select them without clicking the edges because, to be honest, they are very small targets. I might need to track drawing order... |
Well, I can now pick workplanes through other workplanes, but I can't really get it to work reliably regarding the edges. I think I'll pause this, I've found I can easily select any workplane by moving the mouse to it even through another.... |
If you're OK with this, can we merge this one? I'd like to keep PRs relatively small. |
It behaves a bit weird, when i move the cursor away from the plane it stays hovered, also i cannot manage to select a plane border through another plane. Screencast.From.2025-05-05.08-08-37.mp4Normal entity selection is almost entirely broken for me. |
Well, that's because I am clamping the selection to make it easier to use with a trackpad. As to the borders, I've tried many things, but I just can't make them be consistently "in front" of the planes and they are very hard to select, even when increasing the tolerance/line width (I dialed that back in my last commit, must have affected the selection because there is just the one constant). I'll have another go. I can remove the clamping and tweak the tolerances again, but TBH selecting the planes via the borders doesn't seem trivial. |
Oh, I'm not done yet. I had to turn on workplane drawing to test the selection buffer and also broke constraint drawing. I just ran out of time yesterday. I might still move some stuff off global_data and into constants (ZAXIS) or utilities as I go along... |
This is sort of OK-ish now. I am going to test it and then revisit the stacked/overlapping entities thing. I think it's still working, but I haven't tried to actually use it since yesterday. |
model/workplane.py
Outdated
# return | ||
# Check if workplane should be shown in selection buffer when inside a sketch | ||
active_sketch = context.scene.sketcher.active_sketch | ||
if active_sketch and active_sketch.wp != 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.
The workplane is a 3d element so it should never be drawn when a sketch is active
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.
It's not, I think. I split those out into two separate calls but didn't update the comments... Can you see it in the selection buffer?
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.
Yes i still see the black square in the selection buffer when a sketch is active
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.
The latest push should fix that. I made the logic a bit more explicit. But I still need to go back and validate that overlapping selections work and hoist a few more constants.
The behavior seems to work in a case where two lines intersect like on your picture but i cannot get it to work with parallel overlapping edges like in the picture below. |
Hmmm. OK. I think I know why. I need to check if double clicking is being properly propagated as well, but that test case should help. Will see if I can spend a couple of hours this week on it. |
I noticed that the batch_for_shader function was generating internal errors in Blender 4.4, so I went down that rabbit hole and indirectly fixed all the selection errors I was having - and also refactored the workplane selection.
Right now box selection works, including for overlapping entities (at least as far as I can understand it), so I think this fixes #50 as well