diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-03-07 08:53:43 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-03-07 08:53:43 +0400 |
commit | 46045fbb09684ebc74835168ff4c5924261e3fc0 (patch) | |
tree | d233bc2baea422008e5f330ff457291907a387bc /source/blender/editors | |
parent | 71e5edeb6a769e2fd861f5fe374e75391415402a (diff) |
style cleanup - braces & else / if's
Diffstat (limited to 'source/blender/editors')
10 files changed, 87 insertions, 161 deletions
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 931896ed916..a388e465a21 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -586,8 +586,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object if (partype == PAR_PATH_CONST) { /* don't do anything here, since this is not technically "parenting" */ } - else if (ELEM(partype, PAR_CURVE, PAR_LATTICE) || (pararm)) - { + else if (ELEM(partype, PAR_CURVE, PAR_LATTICE) || (pararm)) { /* partype is now set to PAROBJECT so that invisible 'virtual' modifiers don't need to be created * NOTE: the old (2.4x) method was to set ob->partype = PARSKEL, creating the virtual modifiers */ diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 07d47e64be2..4a301277ff3 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1616,8 +1616,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short "Specify which button to use"); } } - else if(joy->type == SENS_JOY_AXIS) - { + else if(joy->type == SENS_JOY_AXIS) { uiDefButS(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, &joy->axis, 1, 8.0, 100, 0, "Specify which axis pair to use, 1 is useually the main direction input"); @@ -1633,8 +1632,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short "The direction of the axis, use 'All Events' to receive events on any direction"); } } - else if (joy->type == SENS_JOY_HAT) - { + else if (joy->type == SENS_JOY_HAT) { uiDefButI(block, NUM, 1, "Number:", xco+10, yco-68, 0.46 * (width-20), 19, &joy->hat, 1, 4.0, 100, 0, "Specify which hat to use"); @@ -2547,8 +2545,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo // uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation"); } #if 0 - else if (gma->type == ACT_GAME_START) - { + else if (gma->type == ACT_GAME_START) { ysize = 68; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); @@ -2557,8 +2554,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation"); } #endif - else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) - { + else if (ELEM4(gma->type, ACT_GAME_RESTART, ACT_GAME_QUIT, ACT_GAME_SAVECFG, ACT_GAME_LOADCFG)) { ysize = 28; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); diff --git a/source/blender/editors/space_node/node_edit.c b/source/blender/editors/space_node/node_edit.c index a423322edd5..1593710a98a 100644 --- a/source/blender/editors/space_node/node_edit.c +++ b/source/blender/editors/space_node/node_edit.c @@ -3402,8 +3402,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } } - else if(RNA_struct_property_is_set(op->ptr, "name")) - { + else if(RNA_struct_property_is_set(op->ptr, "name")) { char name[MAX_ID_NAME-2]; RNA_string_get(op->ptr, "name", name); ima= (Image *)find_id("IM", name); diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 0cc5d877b44..77a686e81b7 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -6803,10 +6803,10 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) // only draw domains if (smd->domain && smd->domain->fluid) { - if (CFRA < smd->domain->point_cache[0]->startframe) - ; /* don't show smoke before simulation starts, this could be made an option in the future */ - else if (!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) - { + if (CFRA < smd->domain->point_cache[0]->startframe) { + /* don't show smoke before simulation starts, this could be made an option in the future */ + } + else if (!smd->domain->wt || !(smd->domain->viewsettings & MOD_SMOKE_VIEW_SHOWBIG)) { // #if 0 smd->domain->tex = NULL; GPU_create_smoke(smd, 0); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 979e3820018..7bd0aaf89db 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -316,13 +316,11 @@ static void viewRedrawForce(const bContext *C, TransInfo *t) else if (t->spacetype == SPACE_NLA) { WM_event_add_notifier(C, NC_ANIMATION|ND_NLA|NA_EDITED, NULL); } - else if(t->spacetype == SPACE_NODE) - { + else if(t->spacetype == SPACE_NODE) { //ED_area_tag_redraw(t->sa); WM_event_add_notifier(C, NC_SPACE|ND_SPACE_NODE_VIEW, NULL); } - else if(t->spacetype == SPACE_SEQ) - { + else if(t->spacetype == SPACE_SEQ) { WM_event_add_notifier(C, NC_SCENE|ND_SEQUENCER, NULL); } else if (t->spacetype==SPACE_IMAGE) { @@ -1519,8 +1517,7 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int { t->launch_event = RIGHTMOUSE; } - else if (t->launch_event == EVT_TWEAK_L) - { + else if (t->launch_event == EVT_TWEAK_L) { t->launch_event = LEFTMOUSE; } diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 1292a058f41..dfe582412b6 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -80,16 +80,13 @@ static void constraintAutoValues(TransInfo *t, float vec[3]) { float nval = (t->flag & T_NULL_ONE)?1.0f:0.0f; - if ((mode & CON_AXIS0) == 0) - { + if ((mode & CON_AXIS0) == 0) { vec[0] = nval; } - if ((mode & CON_AXIS1) == 0) - { + if ((mode & CON_AXIS1) == 0) { vec[1] = nval; } - if ((mode & CON_AXIS2) == 0) - { + if ((mode & CON_AXIS2) == 0) { vec[2] = nval; } } @@ -165,8 +162,7 @@ static void postConstraintChecks(TransInfo *t, float vec[3], float pvec[3]) } /* autovalues is operator param, use that directly but not if snapping is forced */ - if (t->flag & T_AUTOVALUES && (t->tsnap.status & SNAP_FORCED) == 0) - { + if (t->flag & T_AUTOVALUES && (t->tsnap.status & SNAP_FORCED) == 0) { mul_v3_m3v3(vec, t->con.imtx, t->auto_values); constraintAutoValues(t, vec); /* inverse transformation at the end */ @@ -716,8 +712,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) UI_ThemeColor(TH_GRID); - if(t->spacetype == SPACE_VIEW3D && rv3d != NULL) - { + if(t->spacetype == SPACE_VIEW3D && rv3d != NULL) { copy_m4_m4(tmat, rv3d->viewmat); invert_m4_m4(imat, tmat); } @@ -730,12 +725,10 @@ void drawPropCircle(const struct bContext *C, TransInfo *t) copy_v3_v3(center, t->center); - if((t->spacetype == SPACE_VIEW3D) && t->obedit) - { + if((t->spacetype == SPACE_VIEW3D) && t->obedit) { mul_m4_v3(t->obedit->obmat, center); /* because t->center is in local space */ } - else if(t->spacetype == SPACE_IMAGE) - { + else if(t->spacetype == SPACE_IMAGE) { float aspx, aspy; ED_space_image_uv_aspect(t->sa->spacedata.first, &aspx, &aspy); diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index ed01de848ae..fa0575ca9db 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -717,7 +717,9 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb) { bone->flag |= BONE_HINGE_CHILD_TRANSFORM; } - else if (bone->flag & BONE_TRANSFORM && (mode == TFM_ROTATION || mode == TFM_TRACKBALL) && around == V3D_LOCAL) + else if ((bone->flag & BONE_TRANSFORM) && + (mode == TFM_ROTATION || mode == TFM_TRACKBALL) && + (around == V3D_LOCAL)) { bone->flag |= BONE_TRANSFORM_CHILD; } @@ -1126,8 +1128,7 @@ static void createTransArmatureVerts(TransInfo *t) if (ebo->flag & BONE_SELECTED) t->total++; } - else if (t->mode==TFM_BONE_ROLL) - { + else if (t->mode==TFM_BONE_ROLL) { if (ebo->flag & BONE_SELECTED) t->total++; } @@ -1190,8 +1191,7 @@ static void createTransArmatureVerts(TransInfo *t) } } - else if (t->mode==TFM_BONESIZE) - { + else if (t->mode==TFM_BONESIZE) { if (ebo->flag & BONE_SELECTED) { if(arm->drawtype==ARM_ENVELOPE) { @@ -1223,8 +1223,7 @@ static void createTransArmatureVerts(TransInfo *t) td++; } } - else if (t->mode==TFM_BONE_ROLL) - { + else if (t->mode==TFM_BONE_ROLL) { if (ebo->flag & BONE_SELECTED) { td->loc= NULL; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index f3cede75786..b32ed17f57a 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -1098,21 +1098,18 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } } - else if(t->spacetype==SPACE_IMAGE) - { + else if(t->spacetype==SPACE_IMAGE) { SpaceImage *sima = sa->spacedata.first; // XXX for now, get View2D from the active region t->view = &ar->v2d; t->around = sima->around; } - else if(t->spacetype==SPACE_NODE) - { + else if(t->spacetype==SPACE_NODE) { // XXX for now, get View2D from the active region t->view = &ar->v2d; t->around = V3D_CENTER; } - else if(t->spacetype==SPACE_IPO) - { + else if(t->spacetype==SPACE_IPO) { SpaceIpo *sipo= sa->spacedata.first; t->view = &ar->v2d; t->around = sipo->around; @@ -1151,8 +1148,7 @@ int initTransInfo (bContext *C, TransInfo *t, wmOperator *op, wmEvent *event) } } // Need stuff to take it from edit mesh or whatnot here - else if (t->spacetype == SPACE_VIEW3D) - { + else if (t->spacetype == SPACE_VIEW3D) { if (t->obedit && t->obedit->type == OB_MESH && (((Mesh *)t->obedit->data)->editflag & ME_EDIT_MIRROR_X)) { t->flag |= T_MIRROR; @@ -1552,8 +1548,7 @@ void calculateCenter(TransInfo *t) { Scene *scene = t->scene; Object *ob= OBACT; - if(ob) - { + if (ob) { copy_v3_v3(t->center, ob->obmat[3]); projectIntView(t, t->center, t->center2d); } @@ -1564,23 +1559,19 @@ void calculateCenter(TransInfo *t) /* setting constraint center */ copy_v3_v3(t->con.center, t->center); - if(t->flag & (T_EDIT|T_POSE)) - { + if (t->flag & (T_EDIT|T_POSE)) { Object *ob= t->obedit?t->obedit:t->poseobj; mul_m4_v3(ob->obmat, t->con.center); } /* for panning from cameraview */ - if(t->flag & T_OBJECT) - { - if(t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) - { + if (t->flag & T_OBJECT) { + if (t->spacetype==SPACE_VIEW3D && t->ar && t->ar->regiontype == RGN_TYPE_WINDOW) { View3D *v3d = t->view; Scene *scene = t->scene; RegionView3D *rv3d = t->ar->regiondata; - if(v3d->camera == OBACT && rv3d->persp==RV3D_CAMOB) - { + if (v3d->camera == OBACT && rv3d->persp==RV3D_CAMOB) { float axis[3]; /* persinv is nasty, use viewinv instead, always right */ copy_v3_v3(axis, t->viewinv[2]); @@ -1603,8 +1594,7 @@ void calculateCenter(TransInfo *t) } } - if(t->spacetype==SPACE_VIEW3D) - { + if (t->spacetype==SPACE_VIEW3D) { /* initgrabz() defines a factor for perspective depth correction, used in window_to_3d_delta() */ if(t->flag & (T_EDIT|T_POSE)) { Object *ob= t->obedit?t->obedit:t->poseobj; @@ -1632,8 +1622,7 @@ void calculatePropRatio(TransInfo *t) if (td->flag & TD_SELECTED) { td->factor = 1.0f; } - else if (t->flag & T_MIRROR && td->loc[0] * t->mirror < -0.00001f) - { + else if (t->flag & T_MIRROR && td->loc[0] * t->mirror < -0.00001f) { td->flag |= TD_SKIP; td->factor = 0.0f; restoreElement(td); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 6b3380ea42e..2b5758c5ec1 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -122,8 +122,7 @@ void BIF_createTransformOrientation(bContext *C, ReportList *reports, char *name ts = createObjectSpace(C, reports, name, overwrite); } - if (use && ts != NULL) - { + if (use && ts != NULL) { BIF_selectTransformOrientation(C, ts); } } @@ -144,8 +143,7 @@ TransformOrientation *createObjectSpace(bContext *C, ReportList *UNUSED(reports) normalize_m3(mat); /* use object name if no name is given */ - if (name[0] == 0) - { + if (name[0] == 0) { strncpy(name, ob->id.name+2, MAX_ID_NAME-2); } @@ -164,8 +162,7 @@ TransformOrientation *createBoneSpace(bContext *C, ReportList *reports, char *na return NULL; } - if (name[0] == 0) - { + if (name[0] == 0) { strcpy(name, "Bone"); } @@ -188,8 +185,7 @@ TransformOrientation *createMeshSpace(bContext *C, ReportList *reports, char *na return NULL; } - if (name[0] == 0) - { + if (name[0] == 0) { strcpy(name, "Vertex"); } break; @@ -199,8 +195,7 @@ TransformOrientation *createMeshSpace(bContext *C, ReportList *reports, char *na return NULL; } - if (name[0] == 0) - { + if (name[0] == 0) { strcpy(name, "Edge"); } break; @@ -210,8 +205,7 @@ TransformOrientation *createMeshSpace(bContext *C, ReportList *reports, char *na return NULL; } - if (name[0] == 0) - { + if (name[0] == 0) { strcpy(name, "Face"); } break; @@ -254,8 +248,7 @@ int createSpaceNormalTangent(float mat[3][3], float normal[3], float tangent[3]) } /* preempt zero length tangent from causing trouble */ - if (tangent[0] == 0 && tangent[1] == 0 && tangent[2] == 0) - { + if (tangent[0] == 0 && tangent[1] == 0 && tangent[2] == 0) { tangent[2] = 1; } @@ -284,8 +277,7 @@ TransformOrientation* addMatrixSpace(bContext *C, float mat[3][3], char name[], } /* if not, create a new one */ - if (ts == NULL) - { + if (ts == NULL) { ts = MEM_callocN(sizeof(TransformOrientation), "UserTransSpace from matrix"); BLI_addtail(transform_spaces, ts); strncpy(ts->name, name, sizeof(ts->name)); @@ -566,8 +558,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], normal[0] = normal[1] = normal[2] = 0; plane[0] = plane[1] = plane[2] = 0; - if(obedit) - { + if (obedit) { float imat[3][3], mat[3][3]; /* we need the transpose of the inverse for a normal... */ @@ -578,8 +569,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], ob= obedit; - if(ob->type==OB_MESH) - { + if (ob->type==OB_MESH) { Mesh *me= ob->data; BMEditMesh *em = me->edit_btmesh; BMVert *eve; @@ -587,8 +577,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], float vec[3]= {0,0,0}; /* USE LAST SELECTED WITH ACTIVE */ - if (activeOnly && EDBM_get_actSelection(em, &ese)) - { + if (activeOnly && EDBM_get_actSelection(em, &ese)) { EDBM_editselection_normal(normal, &ese); EDBM_editselection_plane(em, plane, &ese); @@ -622,8 +611,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], result = ORIENTATION_FACE; } - else if (em->bm->totvertsel == 3) - { + else if (em->bm->totvertsel == 3) { BMVert *v1 = NULL, *v2 = NULL, *v3 = NULL; BMIter iter; float cotangent[3]; @@ -648,8 +636,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } /* if there's an edge available, use that for the tangent */ - if (em->bm->totedgesel >= 1) - { + if (em->bm->totedgesel >= 1) { BMEdge *eed = NULL; BMIter iter; @@ -663,8 +650,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], result = ORIENTATION_FACE; } - else if (em->bm->totedgesel == 1) - { + else if (em->bm->totedgesel == 1) { BMEdge *eed = NULL; BMIter iter; @@ -679,8 +665,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } result = ORIENTATION_EDGE; } - else if (em->bm->totvertsel == 2) - { + else if (em->bm->totvertsel == 2) { BMVert *v1 = NULL, *v2 = NULL; BMIter iter; @@ -701,8 +686,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } result = ORIENTATION_EDGE; } - else if (em->bm->totvertsel == 1) - { + else if (em->bm->totvertsel == 1) { BMIter iter; BM_ITER(eve, &iter, em->bm, BM_VERTS_OF_MESH, NULL) { @@ -713,8 +697,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } result = ORIENTATION_VERT; } - else if (em->bm->totvertsel > 3) - { + else if (em->bm->totvertsel > 3) { BMIter iter; normal[0] = normal[1] = normal[2] = 0.0f; @@ -728,19 +711,16 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } } } /* end editmesh */ - else if ELEM(obedit->type, OB_CURVE, OB_SURF) - { + else if ELEM(obedit->type, OB_CURVE, OB_SURF) { Curve *cu= obedit->data; Nurb *nu; BezTriple *bezt; int a; ListBase *nurbs= curve_editnurbs(cu); - for (nu = nurbs->first; nu; nu = nu->next) - { + for (nu = nurbs->first; nu; nu = nu->next) { /* only bezier has a normal */ - if(nu->type == CU_BEZIER) - { + if (nu->type == CU_BEZIER) { bezt= nu->bezt; a= nu->pntsu; while(a--) @@ -756,8 +736,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], if (bezt->f2) { sub_v3_v3v3(normal, bezt->vec[0], bezt->vec[2]); } - if(bezt->f3) - { + if (bezt->f3) { sub_v3_v3v3(normal, bezt->vec[1], bezt->vec[2]); } } @@ -766,21 +745,18 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } } - if (normal[0] != 0 || normal[1] != 0 || normal[2] != 0) - { + if (normal[0] != 0 || normal[1] != 0 || normal[2] != 0) { result = ORIENTATION_NORMAL; } } - else if(obedit->type==OB_MBALL) - { + else if(obedit->type==OB_MBALL){ #if 0 // XXX /* editmball.c */ extern ListBase editelems; /* go away ! */ MetaElem *ml, *ml_sel = NULL; /* loop and check that only one element is selected */ - for (ml = editelems.first; ml; ml = ml->next) - { + for (ml = editelems.first; ml; ml = ml->next) { if (ml->flag & SELECT) { if (ml_sel == NULL) { ml_sel = ml; @@ -792,8 +768,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], } } - if (ml_sel) - { + if (ml_sel) { float mat[4][4]; /* Rotation of MetaElem is stored in quat */ @@ -808,16 +783,13 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], #endif } - else if (obedit->type == OB_ARMATURE) - { + else if (obedit->type == OB_ARMATURE) { bArmature *arm = obedit->data; EditBone *ebone; for (ebone = arm->edbo->first; ebone; ebone=ebone->next) { - if (arm->layer & ebone->layer) - { - if (ebone->flag & BONE_SELECTED) - { + if (arm->layer & ebone->layer) { + if (ebone->flag & BONE_SELECTED) { float tmat[3][3]; float vec[3]; sub_v3_v3v3(vec, ebone->tail, ebone->head); @@ -849,8 +821,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], mul_m3_v3(mat, plane); } } - else if(ob && (ob->mode & OB_MODE_POSE)) - { + else if(ob && (ob->mode & OB_MODE_POSE)) { bArmature *arm= ob->data; bPoseChannel *pchan; int totsel; @@ -879,8 +850,8 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], result = ORIENTATION_EDGE; } } - else if(ob && (ob->mode & (OB_MODE_ALL_PAINT|OB_MODE_PARTICLE_EDIT))) - { + else if(ob && (ob->mode & (OB_MODE_ALL_PAINT|OB_MODE_PARTICLE_EDIT))) { + /* pass */ } else { /* we need the one selected object, if its not active */ diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 1ee87b395b2..c4e871f83c5 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -198,8 +198,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) if(v3d->zbuf) glEnable(GL_DEPTH_TEST); } - else if (t->spacetype==SPACE_IMAGE) - { + else if (t->spacetype==SPACE_IMAGE) { /* This will not draw, and Im nor sure why - campbell */ #if 0 float xuser_asp, yuser_asp; @@ -288,8 +287,7 @@ void applyProject(TransInfo *t) Object *ob = t->obedit?t->obedit:t->poseobj; mul_m4_v3(ob->obmat, iloc); } - else if (t->flag & T_OBJECT) - { + else if (t->flag & T_OBJECT) { td->ob->recalc |= OB_RECALC_OB|OB_RECALC_DATA|OB_RECALC_TIME; object_handle_update(t->scene, td->ob); copy_v3_v3(iloc, td->ob->obmat[3]); @@ -327,8 +325,7 @@ void applySnapping(TransInfo *t, float *vec) t->tsnap.applySnap(t, vec); } - else if ((t->tsnap.mode != SCE_SNAP_MODE_INCREMENT) && activeSnap(t)) - { + else if ((t->tsnap.mode != SCE_SNAP_MODE_INCREMENT) && activeSnap(t)) { double current = PIL_check_seconds_timer(); // Time base quirky code to go around findnearest slowness @@ -478,10 +475,8 @@ void initSnapping(TransInfo *t, wmOperator *op) } } /* use scene defaults only when transform is modal */ - else if (t->flag & T_MODAL) - { - if(ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) - { + else if (t->flag & T_MODAL) { + if(ELEM(t->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) { if (ts->snap_flag & SCE_SNAP) { t->modifiers |= MOD_SNAP; } @@ -895,8 +890,7 @@ static void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) t->tsnap.status &= ~POINT_INIT; } } - else if (t->spacetype == SPACE_IMAGE && t->obedit != NULL && t->obedit->type==OB_MESH) - { /* same as above but for UV's */ + else if (t->spacetype == SPACE_IMAGE && t->obedit != NULL && t->obedit->type==OB_MESH) { /* same as above but for UV's */ Image *ima= ED_space_image(t->sa->spacedata.first); float aspx, aspy, co[2]; @@ -1306,8 +1300,7 @@ static int snapArmature(short snap_mode, ARegion *ar, Object *ob, bArmature *arm } } } - else if (ob->pose && ob->pose->chanbase.first) - { + else if (ob->pose && ob->pose->chanbase.first) { bPoseChannel *pchan; Bone *bone; @@ -1630,8 +1623,7 @@ static int snapObject(Scene *scene, ARegion *ar, Object *ob, int editobject, flo dm->release(dm); } - else if (ob->type == OB_ARMATURE) - { + else if (ob->type == OB_ARMATURE) { retval = snapArmature(ts->snap_mode, ar, ob, ob->data, obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, r_depth); } @@ -1648,8 +1640,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c ED_view3d_win_to_ray(ar, v3d, mval, ray_start, ray_normal); - if (mode == SNAP_ALL && obedit) - { + if (mode == SNAP_ALL && obedit) { Object *ob = obedit; retval |= snapObject(scene, ar, ob, 1, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth); @@ -1661,8 +1652,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c * To solve that problem, we do it first as an exception. * */ base= BASACT; - if(base && base->object && base->object->mode & OB_MODE_PARTICLE_EDIT) - { + if (base && base->object && base->object->mode & OB_MODE_PARTICLE_EDIT) { Object *ob = base->object; retval |= snapObject(scene, ar, ob, 0, ob->obmat, ray_start, ray_normal, mval, r_loc, r_no, r_dist, &depth); } @@ -1676,8 +1666,7 @@ static int snapObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, c { Object *ob = base->object; - if (ob->transflag & OB_DUPLI) - { + if (ob->transflag & OB_DUPLI) { DupliObject *dupli_ob; ListBase *lb = object_duplilist(scene, ob); @@ -1720,12 +1709,10 @@ static int cmpPeel(void *arg1, void *arg2) DepthPeel *p2 = arg2; int val = 0; - if (p1->depth < p2->depth) - { + if (p1->depth < p2->depth) { val = -1; } - else if (p1->depth > p2->depth) - { + else if (p1->depth > p2->depth) { val = 1; } @@ -1739,13 +1726,11 @@ static void removeDoublesPeel(ListBase *depth_peels) for (peel = depth_peels->first; peel; peel = peel->next) { DepthPeel *next_peel = peel->next; - - if (next_peel && ABS(peel->depth - next_peel->depth) < 0.0015f) - { + + if (next_peel && ABS(peel->depth - next_peel->depth) < 0.0015f) { peel->next = next_peel->next; - if (next_peel->next) - { + if (next_peel->next) { next_peel->next->prev = peel; } @@ -1841,8 +1826,7 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], addDepthPeel(depth_peels, new_depth, location, normal, ob); } - if (f->v4 && result == 0) - { + if (f->v4 && result == 0) { result = isect_ray_tri_threshold_v3(ray_start_local, ray_normal_local, verts[f->v3].co, verts[f->v4].co, verts[f->v1].co, &lambda, NULL, 0.001); if (result) { @@ -1886,12 +1870,11 @@ static int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, L ED_view3d_win_to_ray(ar, v3d, mval, ray_start, ray_normal); - for ( base = scene->base.first; base != NULL; base = base->next ) { + for (base = scene->base.first; base != NULL; base = base->next) { if ( BASE_SELECTABLE(v3d, base) ) { Object *ob = base->object; - if (ob->transflag & OB_DUPLI) - { + if (ob->transflag & OB_DUPLI) { DupliObject *dupli_ob; ListBase *lb = object_duplilist(scene, ob); |