Page MenuHome

EditMesh support mirror on all axes

Authored by Germano Cavalcante (mano-wii) on Mon, Sep 9, 5:14 AM.



Part of T68930

This patch adds two more mirror options that can be enabled simultaneously: Mirror Y and Z.

Since different transformation options use their own mirroring code (eg edge / vert slide and proportional editing), this patch proposes a generic solution that can be applied to any transformation.

The idea is to create a new array type that points to the location of each reference element with the mirror element location.

This reduces the amount of TransData that is already overkill.

Diff Detail

rB Blender

Event Timeline

  • Cleanup: Use more descriptive variable names

Generally looks good.

Only concern with this is it removes UV correction for vert/edge slide.

This is something I was considering we could generalize anyway, since it would be useful to be able to move any vertex and have UV's and vertex colors be corrected.

Added a task for this T69707: Transform generalized custom-data correction support.

Note that only part of this proposal would need to be implemented to handle the case of vertex/edge slide. Projecting onto original geometry could be postponed.

Campbell Barton (campbellbarton) requested changes to this revision.Tue, Sep 10, 1:03 PM
Campbell Barton (campbellbarton) added inline comments.

Think it would be more clear to call loc_src, loc_dst.


Would store this as a flag, since multiplying a float by a short isn't all that efficient.


Can see how this reads nicely but think this could be a flag too.
Since it fits better in a loop and there is some risk the axis_flag gets used in a way that breaks depending on the order of the bit-field.


This revision now requires changes to proceed.Tue, Sep 10, 1:03 PM
Germano Cavalcante (mano-wii) marked 2 inline comments as done.Tue, Sep 10, 9:19 PM
Germano Cavalcante (mano-wii) updated this revision to Diff 18061.
  • Cleanup: Use more descriptive variable names;
  • Rename TransDataMirror members and use bitfield for sign;
  • Move all CustomData correction logic used on Edge/Vert Slide to transform_convert_mesh.c.

Used bit-fields


axis_flag is being used only as a bool. I could rename it to is_mirror_enabled if preferable.

Campbell Barton (campbellbarton) added inline comments.

Could be a const to prevent accidents.

This revision is now accepted and ready to land.Wed, Sep 11, 3:18 PM

Use doxygen sections, as used at the start of the file.