Multi-Object-Editing : Support for MESH_OT_select_axis
Needs ReviewPublic

Authored by Lucas Boutrot (thornydre) on May 11 2018, 12:24 AM.

Diff Detail

Repository
rB Blender
Campbell Barton (campbellbarton) requested changes to this revision.May 11 2018, 7:53 AM

This needs to use the active vertex of the active object as a reference, then all other vertices should be selected based on this as a reference point.

This revision now requires changes to proceed.May 11 2018, 7:53 AM

Can we fix select axis first, before moving to multi-object?
Before or after this patch I can't get it to work for the simplest of the cases:

  • Add cube
  • Subvidivide 2x
  • Select a vertice in the middle and Select Axis.

The fix should be done as a separate patch though. Which makes me wonder, how did you test this patch? Is this feature working in a different case?

It works for me with these following steps :

  • Create Monkey
  • Select one of the upper vertices
  • Select axis (Positive Axis, Z Axis)
  • And play with the threshold

I'll have a go tonight to make it behave as Campbell said.

I miss only one thing before making it based on the active vertex of the active object :

v_act->co[axis] and v->co[axis] are local, and I can't find a way to get an offset for the non-active objects and their selection based on a "v_act->co[axis] world value", don't know if that makes sense ?

Dalai Felinto (dfelinto) requested changes to this revision.May 14 2018, 1:55 PM

Your patch needs to include all your changes, not only the last one.

It is easier if you keep all your changes in a branch and use arcanist to submit them:
https://wiki.blender.org/index.php/Dev:Doc/Tools/Code_Review#Use_Arcanist

To update an existing patch (like this one) make sure your branch is updated in relation to blender2.8 and use: arc diff origin/blender2.8 --update D3337.

This revision now requires changes to proceed.May 14 2018, 1:55 PM

Sorry for that, here it is. Commit all the changes at once.

Dalai Felinto (dfelinto) requested changes to this revision.May 16 2018, 12:51 PM
Dalai Felinto (dfelinto) added inline comments.
source/blender/editors/mesh/editmesh_select.c
4265

This is shadowing the declaration of em, and bm inside the loop. It is probably throwing some compile warnings (not to be ignored ;).

This whole block should go away, and BMVert *v_act = BM_mesh_active_vert_get(bm); can be checked inside the for loop.

4277

Please move the { to the previous line with a space between it and the (.

4283

You should report errors only once and only if all the objects fail for the same reason.

4286

Also since we are using continue, there is no need for the else. This way you can unindent this whole block of code (under else).

This revision now requires changes to proceed.May 16 2018, 12:51 PM
Lucas Boutrot (thornydre) marked 4 inline comments as done.

I corrected the mistakes you told me, but I am still a bit stuck about selecting the points on a non-active mesh based on the active point of the active mesh. Would you have a little hint for me ?

Every should work now, I found a solution by getting obedit->loc[axis], I don't know if this is a good way to do it, let me know !