Page MenuHome

Fix T79973: Re-ordering face maps messes up the names of other face maps
ClosedPublic

Authored by Germano Cavalcante (mano-wii) on Aug 27 2020, 11:15 PM.

Details

Summary

The problem happens because when a facemap is moved from the end of the list to the beginning or from the beginning to the end, the indexes of all facemaps should be modified with an offset.
But the swap function is called instead, changing only 2 indexes.

We could do a solution similar to that of the Vertex Group and prevent a facemap from being moved beyond the limits.

Or we can use this patch's solution and update all indexes.

Ref T79973

Diff Detail

Repository
rB Blender
Branch
master
Build Status
Buildable 9861
Build 9861: arc lint + arc unit

Event Timeline

Germano Cavalcante (mano-wii) requested review of this revision.Aug 27 2020, 11:15 PM

While this seems fine, I think it'd be better to have a remap function, instead of swap/cycle functions.

The remap function can take an array of remapping indices to avoid having both object_facemap_swap & object_facemap_cycle_offset.

This is isn't needed for the bug-fix though, LGTM.

This revision is now accepted and ready to land.Aug 28 2020, 8:19 AM

I liked the idea of the remap.
Decrease and simplify the code.