Page MenuHome

Fix T56167: Only recalculate the looptris in the original editmesh and use a utility function to always get the looptris from the original editmesh.
Needs ReviewPublic

Authored by Germano Cavalcante (mano-wii) on Oct 18 2018, 1:25 PM.

Details

Summary

Basically this patch adds the DEG_get_original_edit_btmesh and BKE_editmesh_looptris_get functions and changes the BKE_editmesh_tessface_calc to always calculate the looptris in the original editmesh.
The rest of the patch is for the replacement of the looptris direct access by the use of the new functions.

(It's been a while since I made this solution for the T56167, but since COW is still WIP, I decided to postpone it.)

Diff Detail

Repository
rB Blender
Branch
blender2.8_fix_T56167 (branched from blender2.8)
Build Status
Buildable 2254
Build 2254: arc lint + arc unit

Event Timeline

Not sure what is exactly causing the issue with looptri ownership, but the only reason why a copy of BMEditMesh is being created is to silence some asserts which checks BMEditMesh->ob.

I've got a feeling that cleaner solution would be to tweak that assert and sanitize/make strict rule what that pointer is expected to be pointing at. That would also avoid need of BKE_editmesh_looptris_get().

Not sure what is exactly causing the issue with looptri ownership, but the only reason why a copy of BMEditMesh is being created is to silence some asserts which checks BMEditMesh->ob.

I've got a feeling that cleaner solution would be to tweak that assert and sanitize/make strict rule what that pointer is expected to be pointing at. That would also avoid need of BKE_editmesh_looptris_get().

Agree, we could try having BMEditMesh copy all pointrs except for Object *ob.

If this is causing a lot of hassles, think we could try removing ob still. It may be easier in the long run.