Fix #28280: Insert Hook wrong index
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 2 Sep 2011 15:19:30 +0000 (15:19 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 2 Sep 2011 15:19:30 +0000 (15:19 +0000)
commit2fb2075c5b3495fede6980b4f9247f9e89c39d39
tree30e03c72aca6d80472a76034c73393a1b813ae2b
parent6b4bdf621f2830ceff2c44f871523a312422a338
Fix #28280: Insert Hook wrong index

Use quite easy and stupid approach like it used for shape keys:
re-make editmesh (editcurve or editlattice) before creating index array
for hook or storing vertex index in parenting object.

Even if hook was added in "current" edit mode, it should be re-mapped on
loading edit data because topology could be changed after it was created.
Such kind of re-loading edit structures is the easiest way for now to
update keyindexes to relevant state.

Also, fixed bug with not re-mapping indices for vertex-parented objects.
Really old error, not sure why it wasn't noticed yet.
source/blender/editors/mesh/editmesh.c
source/blender/editors/object/object_hook.c
source/blender/editors/object/object_relations.c