← All ideas
  • Published 6 Apr 2020

loop select between two faces

Sometimes you need to select a loop, but you need to limit it between a start and end point. I propose that ctrl + alt + shift is used to select a loop between the first face selected and the last face selected.

Image

75%

Development Status: Open

Upvote 3 Downvote 1
3di
6 Apr 2020

10 Comments

testure

this would be a pretty trivial operator to write, if nobody else does it I'll throw one together when I get some time.

1
3di Author

* @testure * trivial enough to show the code here now? Although I've had no luck using the three tildes to post code blocks on here, it never keeps the indentation for some reason.

3di Author

* @testure * are the inbuilt selections done with python in blender then? Not C/C++?

ckohl_art

* @3d illusions * Blender's inbuilt selections are all done with C/C++. But this can be done in Python too. Importantly, however, it will always be faster to do this in C than in Python which is why this should really be implemented officially by the Blender developers.

But! The performance difference won't be a huge problem unless you have a really high-poly mesh and you're selecting a face loop that is thousands of faces long. So for most "normal" uses doing this in a Python addon will be perfectly fine.

testure

* @Chris Kohl * that's partially true, but it doesn't paint a very realistic picture of how things work in practice. while it should be faster in C or C++ it's not always. It's just as easy to write bad/slow code in C as it is to write fast code in python.

Since we're talking about selections- here's an anecdote. I work at a large studio where artists are working on extremely dense meshes, and one of the artists was having a bad time with circle selection. On a dense mesh, the operator stutters and skips steps constantly because of the framerate drop caused by mesh data being pushed every single frame update.

My solution was to write a modal circle select operator from scratch (in python) that is several times faster than the built-in operator because instead of constantly pushing new selections to the mesh data every single frame, I collect all of the 'selected' faces into a significantly lighter temporary buffer that is just a list of face indices (rather than bloated mesh data) and highlight them with a custom GL shader. Only when the user releases the mouse button is the mesh data updated. The result was a huge improvement in performance right out of the gate, but to make it even better I added mouse interpolation so that if frames ever DO get dropped, the missing spaces between mouse positions would be interpolated and you would have a continuous selection with no gaps.

TLDR: python can be extremely fast if you're smart about it, and the reverse is also true about C.

1
IIIFGIII

Emm... On your GIF we can see it work by just Ctrl + click and it's just well known " Select Shorter Path " . So what exactly you propose?

3di Author

* @IIIFGIII * now try it on a spiral :) I just used that to show what I meant, it wont work in most scenarios.

1
ckohl_art

* @IIIFGIII * Select Shortest Path only works on relatively straight geometry or over short distances. If there is any sort of non-trivial curve (it does still work on some curves but not reliably) it will jump outside of the "loop" of faces (or loop of edges, or ring of edges, or loop of vertices).

It is not suitable for this task. However, if Shortest Path Select was altered to have a flag for "Stay in the current loop" then it should be ideal.

IIIFGIII

* @Chris Kohl * Aha.. With this picture now I get the point. Yes, it has sense as additional option. Maybe, if this suggestion will be recreated again with such picture, it may get much more votes.

Right for now I use select nexst on mouse wheel for such cases.

1
3di Author

* @IIIFGIII * awesome idea with the mouse wheel.