Page MenuHome

Multi-Object EditMode: LATTICE_OT_flip
Needs ReviewPublic

Authored by Habib Gahbiche (zazizizou) on Dec 14 2018, 7:09 PM.

Details

Summary

LATTICE_OT_flip now uses global symmetry axis. This is done in 3 steps.

  1. Compute global center
  2. Mirror along desired global axis
  3. Swap lattice indices along local axis corresponding to global axis to correct for unwanted effects, such as flipped normals etc..

Diff Detail

Repository
rB Blender
Branch
update_lattice (branched from master)
Build Status
Buildable 3443
Build 3443: arc lint + arc unit

Event Timeline

Habib Gahbiche (zazizizou) edited the summary of this revision. (Show Details)

Covered two more rotation cases.

Dalai Felinto (dfelinto) requested changes to this revision.Dec 15 2018, 12:13 AM

Crashed in simple test:

  • Tab twice {*}.
  • Flip (Alt + F) > U (X)

SUMMARY: AddressSanitizer: heap-buffer-overflow /home/dfelinto/src/blender/blender/source/blender/blenlib/intern/math_vector_inline.c:260 in swap_v3_v3
Full backtrace: P873

{*} - (otherwise the second object won't be selected - unrelated bug, a bug nonetheless if you want to investigate it separately go ahead)

This revision now requires changes to proceed.Dec 15 2018, 12:13 AM

Also I skimmed over it, but I'm a bit skeptical at the length of the new code. It seems surprisingly more lengthy than the original one.

  • Tab twice {*}.

Can't reproduce. But maybe because I'm not building with everything enabled. I'll investigate more...

  • Flip (Alt + F) > U (X)

For me it behaves as expected (?), i.e. If you scale in x-direction by -1 you would get the same result. Or maybe you're getting something related to (*)?

Also I skimmed over it, but I'm a bit skeptical at the length of the new code. It seems surprisingly more lengthy than the original one.

The function lattice_swap_indices() is what makes the code much larger. The original code does the mirroring and index swapping at once in one step. Here, I need to do the mirroring globally (because axis is now global), and the index swapping locally. Hence the extra code.

Can't reproduce. But maybe because I'm not building with everything enabled. I'll investigate more...

Are you Linux? If so you can build with WITH_COMPILER_ASAN to catch those.

Fixed crash detected by an address sanitizer. Gizmos still not updating properly.

{*} - (otherwise the second object won't be selected - unrelated bug, a bug nonetheless if you want to investigate it separately go ahead)

I submitted a fix for this bug: D4091

Habib Gahbiche (zazizizou) edited the summary of this revision. (Show Details)

Fixed gizmos not updating.

Updated patch such that it can be applied to current master.
Updated style using clang-format.