Edit Mesh: multi-object sort_elements support
Needs RevisionPublic

Authored by codemanx on May 16 2018, 12:54 AM.

Details

Summary

Seems to work fine, but I'm unsure if it's okay to use only the first object to determine the selectmode:

Object *obedit = objects[0];

Can multiple objects in edit mode have different selectmodes?
Is it even meaningful to have a selectmode on BMEditMesh anymore instead of as toolsetting?

Diff Detail

If you look at T54643 under Differential Revisions you can see which operators are already being worked on. I this case, there already is a diff D3330.

I like your approach (it solves some of the issues I mentioned in D3330), but what I said there is valid here too:

You still need to skip the for loop when mode is not SRT_SELECTED and no relevant element is selected (do it based on elem_items).

source/blender/editors/mesh/editmesh_tools.c
5998

Move the { to the previous line, with a space between ) and {.

Dalai Felinto (dfelinto) requested changes to this revision.May 16 2018, 2:26 PM
This revision now requires changes to proceed.May 16 2018, 2:26 PM
codemanx added inline comments.May 16 2018, 10:24 PM
source/blender/editors/mesh/editmesh_tools.c
5998

This was based on the formatting used in the reference patch:
https://developer.blender.org/rB3a9669bfff9512c52dc0c2914c5ac14142f7e762 (line 4076)

If you look at T54643 under Differential Revisions you can see which operators are already being worked on. I this case, there already is a diff D3330.

Sorry, I only searched the page for "sort_elements", not "sort elements". I'll leave the honor to you to port this operator code.