Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2014-11-16 20:50:23 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2014-11-17 13:19:54 +0300
commita52fbfa828966d19e8db5995d2332c90aa6515f4 (patch)
tree4893d6f2f1a2417f10bfb11597d91229a8ed88de /source/blender/editors/sculpt_paint/sculpt.c
parentb505ecaa4ed86233396f5a2a06970dc747952144 (diff)
ShapeKey: Refactor a bit `BKE_key_convert_from_...`
Thing is, those functions always reallocate the whole keyblock's data mem, while in some cases we already have right amount of elements, so we can just copy over. Further more, `BKE_key_convert_from_offset`, despite its name, was not making any check nor allocation on keyblock's data elements! So split 'copy' operation itself in `BKE_key_update_from_...`, where no mem checks/operations are performed (only an assert). Only useful in sculpt mode currently, but will be used by fix for T35170 too.
Diffstat (limited to 'source/blender/editors/sculpt_paint/sculpt.c')
-rw-r--r--source/blender/editors/sculpt_paint/sculpt.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/sculpt.c b/source/blender/editors/sculpt_paint/sculpt.c
index aecbe629f69..821901f38b0 100644
--- a/source/blender/editors/sculpt_paint/sculpt.c
+++ b/source/blender/editors/sculpt_paint/sculpt.c
@@ -2942,7 +2942,7 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
int apply_offset = ((currkey != kb) && (ob->shapenr - 1 == currkey->relative));
if (apply_offset)
- BKE_key_convert_from_offset(ob, currkey, ofs);
+ BKE_key_update_from_offset(ob, currkey, ofs);
currkey = currkey->next;
}
@@ -2960,8 +2960,8 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
BKE_mesh_calc_normals(me);
}
- /* apply new coords on active key block */
- BKE_key_convert_from_vertcos(ob, kb, vertCos);
+ /* apply new coords on active key block, no need to re-allocate kb->data here! */
+ BKE_key_update_from_vertcos(ob, kb, vertCos);
}
/* Note: we do the topology update before any brush actions to avoid