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:
authorCampbell Barton <ideasman42@gmail.com>2013-01-24 09:54:17 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-24 09:54:17 +0400
commitc65c1958bde6425cedb810590d64252adc2e56c3 (patch)
tree78610575c2c6f92a7ef45a15290d565f319d2b5a /source/blender/modifiers
parent0e2a6178c28c19a73cfd941cb4d93ca349d31bac (diff)
code cleanup: minor edits to mesh-cache formatting.
Diffstat (limited to 'source/blender/modifiers')
-rw-r--r--source/blender/modifiers/intern/MOD_meshcache.c73
1 files changed, 35 insertions, 38 deletions
diff --git a/source/blender/modifiers/intern/MOD_meshcache.c b/source/blender/modifiers/intern/MOD_meshcache.c
index 1dd41c349d9..b111381eb9c 100644
--- a/source/blender/modifiers/intern/MOD_meshcache.c
+++ b/source/blender/modifiers/intern/MOD_meshcache.c
@@ -236,49 +236,46 @@ static void meshcache_do(
/* tricky shape key integration (slow!) */
if (mcmd->deform_mode == MOD_MESHCACHE_DEFORM_INTEGRATE) {
+ Mesh *me = ob->data;
+
/* we could support any object type */
- if (ob->type != OB_MESH) {
+ if (UNLIKELY(ob->type != OB_MESH)) {
modifier_setError(&mcmd->modifier, "'Integrate' only valid for Mesh objects");
}
+ else if (UNLIKELY(me->totvert != numVerts)) {
+ modifier_setError(&mcmd->modifier, "'Integrate' original mesh vertex mismatch");
+ }
+ else if (UNLIKELY(me->totpoly == 0)) {
+ modifier_setError(&mcmd->modifier, "'Integrate' requires faces");
+ }
else {
- Mesh *me = ob->data;
- if (me->totvert != numVerts) {
- modifier_setError(&mcmd->modifier, "'Integrate' original mesh vertex mismatch");
- }
- else {
- if (me->totpoly == 0) {
- modifier_setError(&mcmd->modifier, "'Integrate' requires faces");
- }
- else {
- /* the moons align! */
- int i;
-
- float (*vertexCos_Source)[3] = MEM_mallocN(sizeof(*vertexCos_Source) * numVerts, __func__);
- float (*vertexCos_New)[3] = MEM_mallocN(sizeof(*vertexCos_New) * numVerts, __func__);
- MVert *mv = me->mvert;
-
- for (i = 0; i < numVerts; i++, mv++) {
- copy_v3_v3(vertexCos_Source[i], mv->co);
- }
-
- BKE_mesh_calc_relative_deform(
- me->mpoly, me->totpoly,
- me->mloop, me->totvert,
-
- (const float (*)[3])vertexCos_Source, /* from the original Mesh*/
- (const float (*)[3])vertexCos_Real, /* the input we've been given (shape keys!) */
-
- (const float (*)[3])vertexCos, /* the result of this modifier */
- vertexCos_New /* the result of this function */
- );
-
- /* write the corrected locations back into the result */
- memcpy(use_factor ? vertexCos : vertexCos_Real, vertexCos_New, sizeof(*vertexCos) * numVerts);
-
- MEM_freeN(vertexCos_Source);
- MEM_freeN(vertexCos_New);
- }
+ /* the moons align! */
+ int i;
+
+ float (*vertexCos_Source)[3] = MEM_mallocN(sizeof(*vertexCos_Source) * numVerts, __func__);
+ float (*vertexCos_New)[3] = MEM_mallocN(sizeof(*vertexCos_New) * numVerts, __func__);
+ MVert *mv = me->mvert;
+
+ for (i = 0; i < numVerts; i++, mv++) {
+ copy_v3_v3(vertexCos_Source[i], mv->co);
}
+
+ BKE_mesh_calc_relative_deform(
+ me->mpoly, me->totpoly,
+ me->mloop, me->totvert,
+
+ (const float (*)[3])vertexCos_Source, /* from the original Mesh*/
+ (const float (*)[3])vertexCos_Real, /* the input we've been given (shape keys!) */
+
+ (const float (*)[3])vertexCos, /* the result of this modifier */
+ vertexCos_New /* the result of this function */
+ );
+
+ /* write the corrected locations back into the result */
+ memcpy(use_factor ? vertexCos : vertexCos_Real, vertexCos_New, sizeof(*vertexCos) * numVerts);
+
+ MEM_freeN(vertexCos_Source);
+ MEM_freeN(vertexCos_New);
}
}