Fix T50084: Adding torus re-orders UV layers.
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 2 Feb 2017 20:37:53 +0000 (21:37 +0100)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 2 Feb 2017 20:42:00 +0000 (21:42 +0100)
commit9f67367f0aae46f022adb9b47d91c01b35ab9b0f
tree39b1423cf18e872484fa233a0e40b75bddd91be6
parent33e456b0ce65b07a286e22e2a40570d28a46a443
Fix T50084: Adding torus re-orders UV layers.

Issue was indeed in join operation, mesh in which we join all others
could be re-added to final data after others, leading to undesired
re-ordering of CD layers, and existing vertices etc. being shifted away
from their original indices, etc.

All kind of more or less bad and undesired changes, fixed by always
re-inserting destination mesh first.

Also cleaned up a bit that code, it was doing some rather
non-recommanded things (like allocating zero-sized mem, doing own
coocking to remove a data-block from main, etc.).
source/blender/editors/mesh/meshtools.c