diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-06 22:40:15 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-06 22:40:15 +0400 |
commit | 31d2ee9bf77bb991ea4779c47379b2cee84b27ed (patch) | |
tree | fd6f021356fc78d6dfeff9f18f601ce645dd7ffe /source/blender/editors/armature | |
parent | 7b7214c72233f72268f72d31fd8626a0f94e557e (diff) |
style cleanup, brackets in else/if, some indentation.
Diffstat (limited to 'source/blender/editors/armature')
-rw-r--r-- | source/blender/editors/armature/editarmature.c | 71 | ||||
-rw-r--r-- | source/blender/editors/armature/editarmature_retarget.c | 8 |
2 files changed, 28 insertions, 51 deletions
diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 6a128abea18..365eb28278d 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -2533,8 +2533,7 @@ EditBone *duplicateEditBoneObjects(EditBone *curBone, const char *name, ListBase curBone->temp = eBone; eBone->temp = curBone; - if (name != NULL) - { + if (name != NULL) { BLI_strncpy(eBone->name, name, sizeof(eBone->name)); } @@ -5557,8 +5556,7 @@ void transform_armature_mirror_update(Object *obedit) eboflip->roll= -ebo->roll; /* Also move connected parent, in case parent's name isn't mirrored properly */ - if (eboflip->parent && eboflip->flag & BONE_CONNECTED) - { + if (eboflip->parent && eboflip->flag & BONE_CONNECTED) { EditBone *parent = eboflip->parent; copy_v3_v3(parent->tail, eboflip->head); parent->rad_tail = ebo->rad_head; @@ -5589,8 +5587,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode bArmature *arm= obedit->data; EditBone *lastBone = NULL; - if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) - { + if (scene->toolsettings->skgen_options & SKGEN_CUT_ANGLE) { ReebArcIterator arc_iter; BArcIterator *iter = (BArcIterator*)&arc_iter; float *previous = NULL, *current = NULL; @@ -5624,8 +5621,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode len1 = normalize_v3(vec1); len2 = normalize_v3(vec2); - if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit) - { + if (len1 > 0.0f && len2 > 0.0f && dot_v3v3(vec1, vec2) < angleLimit) { copy_v3_v3(parent->tail, previous); child = ED_armature_edit_bone_add(arm, "Bone"); @@ -5641,8 +5637,7 @@ EditBone * subdivideByAngle(Scene *scene, Object *obedit, ReebArc *arc, ReebNode /* If the bone wasn't subdivided, delete it and return NULL * to let subsequent subdivision methods do their thing. * */ - if (parent == root) - { + if (parent == root) { if(parent==arm->act_edbone) arm->act_edbone= NULL; ED_armature_edit_bone_remove(arm, parent); parent = NULL; @@ -5658,8 +5653,7 @@ EditBone * test_subdivideByCorrelation(Scene *scene, Object *obedit, ReebArc *ar { EditBone *lastBone = NULL; - if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION) - { + if (scene->toolsettings->skgen_options & SKGEN_CUT_CORRELATION) { float invmat[4][4]= MAT4_UNITY; float tmat[3][3]= MAT3_UNITY; ReebArcIterator arc_iter; @@ -5682,19 +5676,16 @@ float arcLengthRatio(ReebArc *arc) arcLength = len_v3v3(arc->head->p, arc->tail->p); - if (arc->bcount > 0) - { + if (arc->bcount > 0) { /* Add the embedding */ - for ( i = 1; i < arc->bcount; i++) - { + for ( i = 1; i < arc->bcount; i++) { embedLength += len_v3v3(arc->buckets[i - 1].p, arc->buckets[i].p); } /* Add head and tail -> embedding vectors */ embedLength += len_v3v3(arc->head->p, arc->buckets[0].p); embedLength += len_v3v3(arc->tail->p, arc->buckets[arc->bcount - 1].p); } - else - { + else { embedLength = arcLength; } @@ -5734,8 +5725,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) src = scene->basact->object; - if (obedit != NULL) - { + if (obedit != NULL) { ED_armature_from_edit(obedit); ED_armature_edit_free(obedit); } @@ -5772,32 +5762,28 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) * Finally, the arc direction is stored in its flag: 1 (low -> high), -1 (high -> low) */ - /* if arc is a symmetry axis, internal bones go up the tree */ - if (arc->symmetry_level == 1 && arc->tail->degree != 1) - { + /* if arc is a symmetry axis, internal bones go up the tree */ + if (arc->symmetry_level == 1 && arc->tail->degree != 1) { head = arc->tail; tail = arc->head; arc->flag = -1; /* mark arc direction */ } /* Bones point AWAY from the symmetry axis */ - else if (arc->head->symmetry_level == 1) - { + else if (arc->head->symmetry_level == 1) { head = arc->head; tail = arc->tail; arc->flag = 1; /* mark arc direction */ } - else if (arc->tail->symmetry_level == 1) - { + else if (arc->tail->symmetry_level == 1) { head = arc->tail; tail = arc->head; arc->flag = -1; /* mark arc direction */ } /* otherwise, always go from low weight to high weight */ - else - { + else { head = arc->head; tail = arc->tail; @@ -5805,10 +5791,8 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) } /* Loop over subdivision methods */ - for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) - { - switch(scene->toolsettings->skgen_subdivisions[i]) - { + for (i = 0; lastBone == NULL && i < SKGEN_SUB_TOTAL; i++) { + switch(scene->toolsettings->skgen_subdivisions[i]) { case SKGEN_SUB_LENGTH: lastBone = test_subdivideByLength(scene, obedit, arc, head, tail); break; @@ -5821,8 +5805,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) } } - if (lastBone == NULL) - { + if (lastBone == NULL) { EditBone *bone; bone = ED_armature_edit_bone_add(obedit->data, "Bone"); bone->flag |= BONE_SELECTED|BONE_TIPSEL|BONE_ROOTSEL; @@ -5843,20 +5826,18 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) ReebArc *incomingArc = NULL; int i; - for (i = 0; i < node->degree; i++) - { + for (i = 0; i < node->degree; i++) { arc = (ReebArc*)node->arcs[i]; /* if arc is incoming into the node */ - if ((arc->head == node && arc->flag == -1) || (arc->tail == node && arc->flag == 1)) + if ((arc->head == node && arc->flag == -1) || + (arc->tail == node && arc->flag == 1)) { - if (incomingArc == NULL) - { + if (incomingArc == NULL) { incomingArc = arc; /* loop further to make sure there's only one incoming arc */ } - else - { + else { /* skip this node if more than one incomingArc */ incomingArc = NULL; break; /* No need to look further, we are skipping already */ @@ -5864,8 +5845,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) } } - if (incomingArc != NULL) - { + if (incomingArc != NULL) { EditBone *parentBone = BLI_ghash_lookup(arcBoneMap, incomingArc); /* Look for outgoing arcs and parent their bones */ @@ -5874,8 +5854,7 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) arc = node->arcs[i]; /* if arc is outgoing from the node */ - if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1)) - { + if ((arc->head == node && arc->flag == 1) || (arc->tail == node && arc->flag == -1)) { EditBone *childBone = BLI_ghash_lookup(arcBoneMap, arc); /* find the root bone */ diff --git a/source/blender/editors/armature/editarmature_retarget.c b/source/blender/editors/armature/editarmature_retarget.c index f1ea39e45b9..375184d3229 100644 --- a/source/blender/editors/armature/editarmature_retarget.c +++ b/source/blender/editors/armature/editarmature_retarget.c @@ -2901,12 +2901,10 @@ void BIF_retargetArc(bContext *C, ReebArc *earc, RigGraph *template_rigg) char *num_string = scene->toolsettings->skgen_num_string; int free_template = 0; - if (template_rigg) - { - ob = template_rigg->ob; + if (template_rigg) { + ob = template_rigg->ob; } - else - { + else { free_template = 1; ob = obedit; template_rigg = armatureSelectedToGraph(C, ob, ob->data); |