diff options
author | Campbell Barton <ideasman42@gmail.com> | 2012-04-29 19:47:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2012-04-29 19:47:02 +0400 |
commit | e701f9b67010279db02ceb51f7d08078cb34170a (patch) | |
tree | 22134b33527f2d3a1b05f4265422bf5d98420bbc /source/blender/editors | |
parent | 038c12895f50a97607dd372cb0780c55eb38fe22 (diff) |
style cleanup: whitespace / commas
Diffstat (limited to 'source/blender/editors')
42 files changed, 548 insertions, 549 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 8aafdc6ab40..714a91ad0b5 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -291,7 +291,7 @@ static short acf_generic_group_offset(bAnimContext *ac, bAnimListElem *ale) offset += 21; } /* materials and particles animdata */ - else if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) + else if (ELEM(GS(ale->id->name), ID_MA, ID_PA)) offset += 14; /* if not in Action Editor mode, action-groups (and their children) must carry some offset too... */ diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 94d9d426932..78c5ced60c4 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -509,7 +509,7 @@ static int ed_markers_poll_markers_exist(bContext *C) * exec() callback will be called instead in the appropriate places. */ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent *evt, - int (*invoke_func)(bContext*,wmOperator*,wmEvent*)) + int (*invoke_func)(bContext *, wmOperator *, wmEvent *)) { ScrArea *sa = CTX_wm_area(C); int retval = OPERATOR_PASS_THROUGH; diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index cd698bbf09f..969127325e6 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -680,7 +680,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op) * 2. remove this from the 'visual' y-rotation */ { - float premat[3][3], imat[3][3],pmat[3][3], tmat[3][3]; + float premat[3][3], imat[3][3], pmat[3][3], tmat[3][3]; float delta[3], eul[3]; /* obtain new auto y-rotation */ @@ -693,7 +693,7 @@ static int apply_armature_pose2bones_exec (bContext *C, wmOperator *op) /* remove auto from visual and get euler rotation */ mul_m3_m3m3(tmat, imat, pmat); - mat3_to_eul( eul,tmat); + mat3_to_eul( eul, tmat); /* just use this euler-y as new roll value */ curbone->roll= eul[1]; @@ -2285,7 +2285,7 @@ static int armature_click_extrude_exec(bContext *C, wmOperator *UNUSED(op)) View3D *v3d; bArmature *arm; EditBone *ebone, *newbone, *flipbone; - float *curs, mat[3][3],imat[3][3]; + float *curs, mat[3][3], imat[3][3]; int a, to_root= 0; Object *obedit; Scene *scene; @@ -3457,7 +3457,7 @@ static int armature_bone_primitive_add_exec(bContext *C, wmOperator *op) RNA_string_get(op->ptr, "name", name); - copy_v3_v3(curs, give_cursor(CTX_data_scene(C),CTX_wm_view3d(C))); + copy_v3_v3(curs, give_cursor(CTX_data_scene(C), CTX_wm_view3d(C))); /* Get inverse point for head and orientation for tail */ invert_m4_m4(obedit->imat, obedit->obmat); @@ -4440,7 +4440,7 @@ static int vgroup_add_unique_bone_cb(Object *ob, Bone *bone, void *UNUSED(ptr)) * If such a vertex group aleady exist the routine exits. */ if (!(bone->flag & BONE_NO_DEFORM)) { - if (!defgroup_find_name(ob,bone->name)) { + if (!defgroup_find_name(ob, bone->name)) { ED_vgroup_add_name(ob, bone->name); return 1; } @@ -4828,7 +4828,7 @@ static void pchan_clear_rot(bPoseChannel *pchan) quat_to_eul(oldeul, quat1); } else if (pchan->rotmode == ROT_MODE_AXISANGLE) { - axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT,pchan->rotAxis, pchan->rotAngle); + axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT, pchan->rotAxis, pchan->rotAngle); } else { copy_v3_v3(oldeul, pchan->eul); @@ -4855,7 +4855,7 @@ static void pchan_clear_rot(bPoseChannel *pchan) } } else if (pchan->rotmode == ROT_MODE_AXISANGLE) { - eulO_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,eul, EULER_ORDER_DEFAULT); + eulO_to_axis_angle( pchan->rotAxis, &pchan->rotAngle, eul, EULER_ORDER_DEFAULT); } else { copy_v3_v3(pchan->eul, eul); @@ -5094,7 +5094,7 @@ void POSE_OT_select_all(wmOperatorType *ot) static int pose_select_parent_exec(bContext *C, wmOperator *UNUSED(op)) { Object *ob= object_pose_armature_get(CTX_data_active_object(C)); - bPoseChannel *pchan,*parent; + bPoseChannel *pchan, *parent; /* Determine if there is an active bone */ pchan=CTX_data_active_pose_bone(C); @@ -5737,8 +5737,8 @@ void generateSkeletonFromReebGraph(Scene *scene, ReebGraph *rg) /* Copy orientation from source */ copy_v3_v3(dst->loc, src->obmat[3]); - mat4_to_eul( dst->rot,src->obmat); - mat4_to_size( dst->size,src->obmat); + mat4_to_eul(dst->rot, src->obmat); + mat4_to_size(dst->size, src->obmat); where_is_object(scene, obedit); diff --git a/source/blender/editors/armature/meshlaplacian.c b/source/blender/editors/armature/meshlaplacian.c index 59a7437e753..a5db3dc118f 100644 --- a/source/blender/editors/armature/meshlaplacian.c +++ b/source/blender/editors/armature/meshlaplacian.c @@ -584,7 +584,7 @@ static void heat_calc_vnormals(LaplacianSystem *sys) v2= (*face)[1]; v3= (*face)[2]; - normal_tri_v3( fnor,sys->verts[v1], sys->verts[v2], sys->verts[v3]); + normal_tri_v3(fnor, sys->verts[v1], sys->verts[v2], sys->verts[v3]); add_v3_v3(sys->heat.vnors[v1], fnor); add_v3_v3(sys->heat.vnors[v2], fnor); @@ -945,7 +945,7 @@ void rigid_deform_iteration() } } - /* solve for positions, for X,Y and Z separately */ + /* solve for positions, for X, Y and Z separately */ for (i=0; i<3; i++) { laplacian_begin_solve(sys, i); @@ -1069,7 +1069,7 @@ void rigid_deform_end(int cancel) #define MESHDEFORM_MIN_INFLUENCE 0.0005f static int MESHDEFORM_OFFSET[7][3] = - {{0,0,0}, {1,0,0}, {-1,0,0}, {0,1,0}, {0,-1,0}, {0,0,1}, {0,0,-1}}; + {{0, 0, 0}, {1, 0, 0}, {-1, 0, 0}, {0, 1, 0}, {0, -1, 0}, {0, 0, 1}, {0, 0, -1}}; typedef struct MDefBoundIsect { float co[3], uvw[4]; @@ -1128,10 +1128,10 @@ typedef struct MeshDeformIsect { /* our own triangle intersection, so we can fully control the epsilons and * prevent corner case from going wrong*/ static int meshdeform_tri_intersect(float orig[3], float end[3], float vert0[3], - float vert1[3], float vert2[3], float *isectco, float *uvw) + float vert1[3], float vert2[3], float *isectco, float *uvw) { float edge1[3], edge2[3], tvec[3], pvec[3], qvec[3]; - float det,inv_det, u, v, dir[3], isectdir[3]; + float det, inv_det, u, v, dir[3], isectdir[3]; sub_v3_v3v3(dir, end, orig); @@ -1208,16 +1208,16 @@ static int meshdeform_intersect(MeshDeformBind *mdb, MeshDeformIsect *isec) hit = meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw); if (hit) { - normal_tri_v3( nor,face[0], face[1], face[2]); + normal_tri_v3(nor, face[0], face[1], face[2]); } else { hit= meshdeform_tri_intersect(isec->start, end, face[0], face[2], face[3], co, uvw); - normal_tri_v3( nor,face[0], face[2], face[3]); + normal_tri_v3(nor, face[0], face[2], face[3]); } } else { hit= meshdeform_tri_intersect(isec->start, end, face[0], face[1], face[2], co, uvw); - normal_tri_v3( nor,face[0], face[1], face[2]); + normal_tri_v3(nor, face[0], face[1], face[2]); } if (hit) { @@ -1281,7 +1281,7 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float copy_v3_v3(vert[1], cagecos[mface->v2]); copy_v3_v3(vert[2], cagecos[mface->v3]); if (mface->v4) copy_v3_v3(vert[3], cagecos[mface->v4]); - interp_weights_poly_v3( isect->uvw,vert, isect->nvert, isect->co); + interp_weights_poly_v3( isect->uvw, vert, isect->nvert, isect->co); return isect; } diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c index f54cdb330e3..87cf25e99be 100644 --- a/source/blender/editors/armature/poseobject.c +++ b/source/blender/editors/armature/poseobject.c @@ -792,7 +792,7 @@ static void pose_copy_menu(Scene *scene) if (nr != 5) { for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ( (arm->layer & pchan->bone->layer) && + if ((arm->layer & pchan->bone->layer) && (pchan->bone->flag & BONE_SELECTED) && (pchan != pchanact) ) { @@ -861,13 +861,13 @@ static void pose_copy_menu(Scene *scene) float tmp_quat[4]; /* need to convert to quat first (in temp var)... */ - mat4_to_quat( tmp_quat,delta_mat); - quat_to_axis_angle( pchan->rotAxis, &pchan->rotAngle,tmp_quat); + mat4_to_quat(tmp_quat, delta_mat); + quat_to_axis_angle(pchan->rotAxis, &pchan->rotAngle, tmp_quat); } else if (pchan->rotmode == ROT_MODE_QUAT) - mat4_to_quat( pchan->quat,delta_mat); + mat4_to_quat(pchan->quat, delta_mat); else - mat4_to_eulO( pchan->eul, pchan->rotmode,delta_mat); + mat4_to_eulO(pchan->eul, pchan->rotmode, delta_mat); } break; case 11: /* Visual Size */ @@ -875,7 +875,7 @@ static void pose_copy_menu(Scene *scene) float delta_mat[4][4], size[4]; armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat); - mat4_to_size( size,delta_mat); + mat4_to_size(size, delta_mat); copy_v3_v3(pchan->size, size); } } @@ -914,7 +914,7 @@ static void pose_copy_menu(Scene *scene) /* Copy the temo listbase to the selected posebones */ for (pchan= ob->pose->chanbase.first; pchan; pchan= pchan->next) { - if ( (arm->layer & pchan->bone->layer) && + if ((arm->layer & pchan->bone->layer) && (pchan->bone->flag & BONE_SELECTED) && (pchan!=pchanact) ) { @@ -1050,9 +1050,9 @@ static bPoseChannel *pose_bone_do_paste (Object *ob, bPoseChannel *chan, short s else if (pchan->rotmode > 0) { /* quat/axis-angle to euler */ if (chan->rotmode == ROT_MODE_AXISANGLE) - axis_angle_to_eulO( pchan->eul, pchan->rotmode,chan->rotAxis, chan->rotAngle); + axis_angle_to_eulO(pchan->eul, pchan->rotmode, chan->rotAxis, chan->rotAngle); else - quat_to_eulO( pchan->eul, pchan->rotmode,chan->quat); + quat_to_eulO(pchan->eul, pchan->rotmode, chan->quat); } else if (pchan->rotmode == ROT_MODE_AXISANGLE) { /* quat/euler to axis angle */ diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index eebdeafcea9..efcbab78884 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -197,7 +197,7 @@ void REEB_freeGraph(ReebGraph *rg) // free arcs arc = rg->arcs.first; - while ( arc ) { + while (arc) { ReebArc *next = arc->next; REEB_freeArc((BArc*)arc); arc = next; @@ -1683,7 +1683,7 @@ int filterSmartReebGraph(ReebGraph *UNUSED(rg), float UNUSED(threshold)) int merging = 0; int total = BLI_ghash_size(arc->faces); float avg_angle = 0; - float avg_vec[3] = {0,0,0}; + float avg_vec[3] = {0, 0, 0}; for (BLI_ghashIterator_init(&ghi, arc->faces); !BLI_ghashIterator_isDone(&ghi); @@ -1873,7 +1873,7 @@ static void finalizeGraph(ReebGraph *rg, char passes, char method) /************************************** WEIGHT SPREADING ***********************************************/ -static int compareVerts( const void* a, const void* b ) +static int compareVerts(const void* a, const void* b) { EditVert *va = *(EditVert**)a; EditVert *vb = *(EditVert**)b; @@ -2090,7 +2090,7 @@ void mergeArcEdges(ReebGraph *rg, ReebArc *aDst, ReebArc *aSrc, MergeDirection d e->arc = aDst; // Edge is stolen by new arc } - BLI_movelisttolist(&aDst->edges , &aSrc->edges); + BLI_movelisttolist(&aDst->edges, &aSrc->edges); } else { for (e = aSrc->edges.first; e; e = e->next) { @@ -3470,18 +3470,18 @@ void REEB_draw() glColor3f(0, 1, 0); glRasterPos3fv(vec); - BMF_DrawString( G.fonts, text); + BMF_DrawString(G.fonts, text); } if (G.scene->toolsettings->skgen_options & SKGEN_DISP_INDEX) { sprintf(text, " %i", arc->head->index); glRasterPos3fv(arc->head->p); - BMF_DrawString( G.fonts, text); + BMF_DrawString(G.fonts, text); sprintf(text, " %i", arc->tail->index); glRasterPos3fv(arc->tail->p); - BMF_DrawString( G.fonts, text); + BMF_DrawString(G.fonts, text); } } glEnable(GL_DEPTH_TEST); diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index e65b4280dc9..37bbedbc9dd 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -108,7 +108,7 @@ void selectend_nurb(Object *obedit, short selfirst, short doswap, short selstatu static void select_adjacent_cp(ListBase *editnurb, short next, short cont, short selstatus); /* still need to eradicate a few :( */ -#define callocstructN(x,y,name) (x*)MEM_callocN((y)* sizeof(x),name) +#define callocstructN(x, y, name) (x*)MEM_callocN((y)* sizeof(x), name) static float nurbcircle[8][2]= { {0.0, -1.0}, {-1.0, -1.0}, {-1.0, 0.0}, {-1.0, 1.0}, @@ -4224,10 +4224,10 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen Curve *cu= (Curve*)obedit->data; ListBase *editnurb= object_editcurve_get(obedit); Nurb *nu; - float si,phi,n[3],q[4],cmat[3][3],tmat[3][3],imat[3][3]; + float si, phi, n[3], q[4], cmat[3][3], tmat[3][3], imat[3][3]; float bmat[3][3], rotmat[3][3], scalemat1[3][3], scalemat2[3][3]; float persmat[3][3], persinv[3][3]; - short a,ok, changed= 0; + short a, ok, changed= 0; copy_m3_m4(persmat, viewmat); invert_m3_m3(persinv, persmat); @@ -4244,7 +4244,7 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen q[1]= n[0]*si; q[2]= n[1]*si; q[3]= n[2]*si; - quat_to_mat3( cmat,q); + quat_to_mat3(cmat, q); mul_m3_m3m3(tmat, cmat, bmat); mul_m3_m3m3(rotmat, imat, tmat); @@ -4252,19 +4252,19 @@ static int spin_nurb(float viewmat[][4], Object *obedit, float *axis, float *cen scalemat1[0][0]= M_SQRT2; scalemat1[1][1]= M_SQRT2; - mul_m3_m3m3(tmat,persmat,bmat); - mul_m3_m3m3(cmat,scalemat1,tmat); - mul_m3_m3m3(tmat,persinv,cmat); - mul_m3_m3m3(scalemat1,imat,tmat); + mul_m3_m3m3(tmat, persmat, bmat); + mul_m3_m3m3(cmat, scalemat1, tmat); + mul_m3_m3m3(tmat, persinv, cmat); + mul_m3_m3m3(scalemat1, imat, tmat); unit_m3(scalemat2); - scalemat2[0][0]/= (float)M_SQRT2; - scalemat2[1][1]/= (float)M_SQRT2; + scalemat2[0][0] /= (float)M_SQRT2; + scalemat2[1][1] /= (float)M_SQRT2; - mul_m3_m3m3(tmat,persmat,bmat); - mul_m3_m3m3(cmat,scalemat2,tmat); - mul_m3_m3m3(tmat,persinv,cmat); - mul_m3_m3m3(scalemat2,imat,tmat); + mul_m3_m3m3(tmat, persmat, bmat); + mul_m3_m3m3(cmat, scalemat2, tmat); + mul_m3_m3m3(tmat, persinv, cmat); + mul_m3_m3m3(scalemat2, imat, tmat); ok= 1; @@ -4533,7 +4533,7 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) } else { mul_v3_m4v3(newbezt->vec[1], imat, location); - sub_v3_v3v3(temp, newbezt->vec[1],temp); + sub_v3_v3v3(temp, newbezt->vec[1], temp); if (bezt_recalc[1]) { const char h1 = bezt_recalc[1]->h1, h2 = bezt_recalc[1]->h2; @@ -4543,8 +4543,8 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) bezt_recalc[1]->h2 = h2; } else { - add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp); - add_v3_v3v3(newbezt->vec[2], bezt->vec[2],temp); + add_v3_v3v3(newbezt->vec[0], bezt->vec[0], temp); + add_v3_v3v3(newbezt->vec[2], bezt->vec[2], temp); } @@ -6268,7 +6268,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) bp->vec[0]+= 1.5f*grid; bp= nu->bp; - for (a=0;a<4;a++, bp++) mul_m4_v3(mat,bp->vec); + for (a=0;a<4;a++, bp++) mul_m4_v3(mat, bp->vec); if (cutype==CU_NURBS) { nu->knotsu= NULL; /* nurbs_knot_calc_u allocates */ @@ -6302,7 +6302,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) bp->vec[0]+= 2.0f*grid; bp= nu->bp; - for (a=0;a<5;a++, bp++) mul_m4_v3(mat,bp->vec); + for (a=0;a<5;a++, bp++) mul_m4_v3(mat, bp->vec); if (cutype==CU_NURBS) { nu->knotsu= NULL; /* nurbs_knot_calc_u allocates */ @@ -6323,28 +6323,28 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) bezt->h1= bezt->h2= HD_AUTO; bezt->f1= bezt->f2= bezt->f3= SELECT; bezt->vec[1][0]+= -grid; - for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]); + for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]); bezt->radius = bezt->weight = 1.0; bezt++; bezt->h1= bezt->h2= HD_AUTO; bezt->f1= bezt->f2= bezt->f3= SELECT; bezt->vec[1][1]+= grid; - for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]); + for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]); bezt->radius = bezt->weight = 1.0; bezt++; bezt->h1= bezt->h2= HD_AUTO; bezt->f1= bezt->f2= bezt->f3= SELECT; bezt->vec[1][0]+= grid; - for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]); + for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]); bezt->radius = bezt->weight = 1.0; bezt++; bezt->h1= bezt->h2= HD_AUTO; bezt->f1= bezt->f2= bezt->f3= SELECT; bezt->vec[1][1]+= -grid; - for (a=0;a<3;a++) mul_m4_v3(mat,bezt->vec[a]); + for (a=0;a<3;a++) mul_m4_v3(mat, bezt->vec[a]); bezt->radius = bezt->weight = 1.0; BKE_nurb_handles_calc(nu); @@ -6369,7 +6369,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) } if (a & 1) bp->vec[3]= 0.25*M_SQRT2; else bp->vec[3]= 1.0; - mul_m4_v3(mat,bp->vec); + mul_m4_v3(mat, bp->vec); bp->radius = bp->weight = 1.0; bp++; @@ -6401,7 +6401,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) if (a==1 || a==2) if (b==1 || b==2) { bp->vec[2]+= grid; } - mul_m4_v3(mat,bp->vec); + mul_m4_v3(mat, bp->vec); bp->vec[3]= 1.0; bp++; } @@ -6465,7 +6465,7 @@ Nurb *add_nurbs_primitive(bContext *C, float mat[4][4], int type, int newob) bp->vec[2]+= nurbcircle[a][1]*grid; if (a & 1) bp->vec[3]= 0.5*M_SQRT2; else bp->vec[3]= 1.0; - mul_m4_v3(mat,bp->vec); + mul_m4_v3(mat, bp->vec); bp++; } nu->flagu= CU_NURB_BEZIER; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 131034848de..891b5048fa5 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -403,7 +403,7 @@ static int key_test_depth(PEData *data, const float co[3]) View3D *v3d= data->vc.v3d; double ux, uy, uz; float depth; - short wco[3], x,y; + short wco[3], x, y; /* nothing to do */ if ((v3d->drawtype<=OB_WIRE) || (v3d->flag & V3D_ZBUF_SELECT)==0) @@ -414,7 +414,7 @@ static int key_test_depth(PEData *data, const float co[3]) if (wco[0] == IS_CLIPPED) return 0; - gluProject(co[0],co[1],co[2], data->mats.modelview, data->mats.projection, + gluProject(co[0], co[1], co[2], data->mats.modelview, data->mats.projection, (GLint *)data->mats.viewport, &ux, &uy, &uz); x=wco[0]; @@ -473,7 +473,7 @@ static int key_inside_rect(PEData *data, const float co[3]) { int sco[2]; - project_int(data->vc.ar, co,sco); + project_int(data->vc.ar, co, sco); if (sco[0] == IS_CLIPPED) return 0; @@ -622,7 +622,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) { if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat); - invert_m4_m4(imat,mat); + invert_m4_m4(imat, mat); } func(data, mat, imat, p, point->totkey-1, key); @@ -636,7 +636,7 @@ static void foreach_mouse_hit_key(PEData *data, ForKeyMatFunc func, int selected if (key_inside_circle(data, data->rad, KEY_WCO, &data->dist)) { if (edit->psys && !(edit->psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(data->ob, psmd->dm, psys->part->from, psys->particles + p, mat); - invert_m4_m4(imat,mat); + invert_m4_m4(imat, mat); } func(data, mat, imat, p, k, key); @@ -902,7 +902,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) return; psys = edit->psys; - psmd = psys_get_modifier(ob,psys); + psmd = psys_get_modifier(ob, psys); if (!psmd->dm) return; @@ -920,26 +920,26 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) dist_1st *= 0.75f * pset->emitterdist; } else { - index= BLI_kdtree_find_nearest(edit->emitter_field,key->co,NULL,NULL); + index= BLI_kdtree_find_nearest(edit->emitter_field, key->co, NULL, NULL); vec=edit->emitter_cosnos +index*6; nor=vec+3; sub_v3_v3v3(dvec, key->co, vec); - dot=dot_v3v3(dvec,nor); - copy_v3_v3(dvec,nor); + dot=dot_v3v3(dvec, nor); + copy_v3_v3(dvec, nor); if (dot>0.0f) { if (dot<dist_1st) { normalize_v3(dvec); - mul_v3_fl(dvec,dist_1st-dot); + mul_v3_fl(dvec, dist_1st-dot); add_v3_v3(key->co, dvec); } } else { normalize_v3(dvec); - mul_v3_fl(dvec,dist_1st-dot); + mul_v3_fl(dvec, dist_1st-dot); add_v3_v3(key->co, dvec); } if (k==1) @@ -947,7 +947,7 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) } } - invert_m4_m4(hairimat,hairmat); + invert_m4_m4(hairimat, hairmat); LOOP_KEYS { mul_m4_v3(hairimat, key->co); @@ -1053,7 +1053,7 @@ static void recalc_lengths(PTCacheEdit *edit) /* calculate a tree for finding nearest emitter's vertice */ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) { - DerivedMesh *dm=psys_get_modifier(ob,psys)->dm; + DerivedMesh *dm=psys_get_modifier(ob, psys)->dm; PTCacheEdit *edit= psys->edit; float *vec, *nor; int i, totface /*, totvert*/; @@ -1069,7 +1069,7 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) totface=dm->getNumTessFaces(dm); /*totvert=dm->getNumVerts(dm);*/ /*UNSUED*/ - edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float),"emitter cosnos"); + edit->emitter_cosnos=MEM_callocN(totface*6*sizeof(float), "emitter cosnos"); edit->emitter_field= BLI_kdtree_new(totface); @@ -1077,30 +1077,30 @@ static void recalc_emitter_field(Object *ob, ParticleSystem *psys) nor=vec+3; for (i=0; i<totface; i++, vec+=6, nor+=6) { - MFace *mface=dm->getTessFaceData(dm,i,CD_MFACE); + MFace *mface=dm->getTessFaceData(dm, i, CD_MFACE); MVert *mvert; - mvert=dm->getVertData(dm,mface->v1,CD_MVERT); - copy_v3_v3(vec,mvert->co); - VECCOPY(nor,mvert->no); + mvert=dm->getVertData(dm, mface->v1, CD_MVERT); + copy_v3_v3(vec, mvert->co); + VECCOPY(nor, mvert->no); - mvert=dm->getVertData(dm,mface->v2,CD_MVERT); - add_v3_v3v3(vec,vec,mvert->co); - VECADD(nor,nor,mvert->no); + mvert=dm->getVertData(dm, mface->v2, CD_MVERT); + add_v3_v3v3(vec, vec, mvert->co); + VECADD(nor, nor, mvert->no); - mvert=dm->getVertData(dm,mface->v3,CD_MVERT); - add_v3_v3v3(vec,vec,mvert->co); - VECADD(nor,nor,mvert->no); + mvert=dm->getVertData(dm, mface->v3, CD_MVERT); + add_v3_v3v3(vec, vec, mvert->co); + VECADD(nor, nor, mvert->no); if (mface->v4) { - mvert=dm->getVertData(dm,mface->v4,CD_MVERT); - add_v3_v3v3(vec,vec,mvert->co); - VECADD(nor,nor,mvert->no); + mvert=dm->getVertData(dm, mface->v4, CD_MVERT); + add_v3_v3v3(vec, vec, mvert->co); + VECADD(nor, nor, mvert->no); - mul_v3_fl(vec,0.25); + mul_v3_fl(vec, 0.25); } else - mul_v3_fl(vec,0.3333f); + mul_v3_fl(vec, 0.3333f); normalize_v3(nor); @@ -1154,7 +1154,7 @@ static void update_world_cos(Object *ob, PTCacheEdit *edit) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles+p, hairmat); LOOP_KEYS { - copy_v3_v3(key->world_co,key->co); + copy_v3_v3(key->world_co, key->co); if (!(psys->flag & PSYS_GLOBAL_HAIR)) mul_m4_v3(hairmat, key->world_co); } @@ -1239,7 +1239,7 @@ void PE_update_object(Scene *scene, Object *ob, int useflag) pe_deflect_emitter(scene, ob, edit); PE_apply_lengths(scene, edit); if (pe_x_mirror(ob)) - PE_apply_mirror(ob,edit->psys); + PE_apply_mirror(ob, edit->psys); if (edit->psys) update_world_cos(ob, edit); if (pset->flag & PE_AUTO_VELOCITY) @@ -1637,7 +1637,7 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho copy_v3_v3(co, key->co); mul_m4_v3(mat, co); project_int(ar, co, vertco); - if (BLI_lasso_is_point_inside(mcords,moves,vertco[0],vertco[1], IS_CLIPPED) && + if (BLI_lasso_is_point_inside(mcords, moves, vertco[0], vertco[1], IS_CLIPPED) && key_test_depth(&data, co)) { if (select && !(key->flag & PEK_SELECT)) { @@ -1656,8 +1656,8 @@ int PE_lasso_select(bContext *C, int mcords[][2], short moves, short extend, sho copy_v3_v3(co, key->co); mul_m4_v3(mat, co); - project_int(ar, co,vertco); - if (BLI_lasso_is_point_inside(mcords,moves,vertco[0],vertco[1], IS_CLIPPED) && + project_int(ar, co, vertco); + if (BLI_lasso_is_point_inside(mcords, moves, vertco[0], vertco[1], IS_CLIPPED) && key_test_depth(&data, co)) { if (select && !(key->flag & PEK_SELECT)) { @@ -1908,7 +1908,7 @@ static void rekey_particle(PEData *data, int pa_index) pa->flag |= PARS_REKEY; - key= new_keys= MEM_callocN(data->totrekey * sizeof(HairKey),"Hair re-key keys"); + key= new_keys= MEM_callocN(data->totrekey * sizeof(HairKey), "Hair re-key keys"); okey = pa->hair; /* root and tip stay the same */ @@ -1920,7 +1920,7 @@ static void rekey_particle(PEData *data, int pa_index) dval= (end - sta) / (float)(data->totrekey - 1); /* interpolate new keys from old ones */ - for (k=1,key++; k<data->totrekey-1; k++,key++) { + for (k=1, key++; k<data->totrekey-1; k++, key++) { state.time= (float)k / (float)(data->totrekey-1); psys_get_particle_on_path(&sim, pa_index, &state, 0); copy_v3_v3(key->co, state.co); @@ -1937,7 +1937,7 @@ static void rekey_particle(PEData *data, int pa_index) if (point->keys) MEM_freeN(point->keys); - ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey),"Hair re-key edit keys"); + ekey= point->keys= MEM_callocN(pa->totkey * sizeof(PTCacheEditKey), "Hair re-key edit keys"); for (k=0, key=pa->hair; k<pa->totkey; k++, key++, ekey++) { ekey->co= key->co; @@ -2223,7 +2223,7 @@ static void subdivide_particle(PEData *data, int pa_index) sim.ob= data->ob; sim.psys= edit->psys; - for (k=0, ekey=point->keys; k<pa->totkey-1; k++,ekey++) { + for (k=0, ekey=point->keys; k<pa->totkey-1; k++, ekey++) { if (ekey->flag&PEK_SELECT && (ekey+1)->flag&PEK_SELECT) totnewkey++; } @@ -2232,16 +2232,16 @@ static void subdivide_particle(PEData *data, int pa_index) pa->flag |= PARS_REKEY; - nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)),"Hair subdivide keys"); - nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)),"Hair subdivide edit keys"); + nkey= new_keys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(HairKey)), "Hair subdivide keys"); + nekey= new_ekeys= MEM_callocN((pa->totkey+totnewkey)*(sizeof(PTCacheEditKey)), "Hair subdivide edit keys"); key = pa->hair; endtime= key[pa->totkey-1].time; for (k=0, ekey=point->keys; k<pa->totkey-1; k++, key++, ekey++) { - memcpy(nkey,key,sizeof(HairKey)); - memcpy(nekey,ekey,sizeof(PTCacheEditKey)); + memcpy(nkey, key, sizeof(HairKey)); + memcpy(nekey, ekey, sizeof(PTCacheEditKey)); nekey->co= nkey->co; nekey->time= &nkey->time; @@ -2266,8 +2266,8 @@ static void subdivide_particle(PEData *data, int pa_index) } } /*tip still not copied*/ - memcpy(nkey,key,sizeof(HairKey)); - memcpy(nekey,ekey,sizeof(PTCacheEditKey)); + memcpy(nkey, key, sizeof(HairKey)); + memcpy(nekey, ekey, sizeof(PTCacheEditKey)); nekey->co= nkey->co; nekey->time= &nkey->time; @@ -2356,7 +2356,7 @@ static int remove_doubles_exec(bContext *C, wmOperator *op) copy_v3_v3(co, point->keys->co); mul_m4_v3(mat, co); - totn= BLI_kdtree_find_n_nearest(tree,10,co,NULL,nearest); + totn= BLI_kdtree_find_n_nearest(tree, 10, co, NULL, nearest); for (n=0; n<totn; n++) { /* this needs a custom threshold still */ @@ -2666,7 +2666,7 @@ static void PE_mirror_x(Scene *scene, Object *ob, int tagged) /* assign face inddex */ newpa->num= mirrorfaces[pa->num*2]; - newpa->num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,newpa->num,newpa->fuv, NULL); + newpa->num_dmcache= psys_particle_dm_face_lookup(ob, psmd->dm, newpa->num, newpa->fuv, NULL); /* update edit key pointers */ key= newpoint->keys; @@ -2730,8 +2730,8 @@ static void brush_comb(PEData *data, float UNUSED(mat[][4]), float imat[][4], in fac= (float)pow((double)(1.0f - data->dist / data->rad), (double)data->combfac); - copy_v3_v3(cvec,data->dvec); - mul_mat3_m4_v3(imat,cvec); + copy_v3_v3(cvec, data->dvec); + mul_mat3_m4_v3(imat, cvec); mul_v3_fl(cvec, fac); add_v3_v3(key->co, cvec); @@ -2840,17 +2840,17 @@ static void brush_length(PEData *data, int point_index) PTCacheEdit *edit= data->edit; PTCacheEditPoint *point = edit->points + point_index; KEY_K; - float dvec[3],pvec[3] = {0.0f, 0.0f, 0.0f}; + float dvec[3], pvec[3] = {0.0f, 0.0f, 0.0f}; LOOP_KEYS { if (k==0) { - copy_v3_v3(pvec,key->co); + copy_v3_v3(pvec, key->co); } else { - sub_v3_v3v3(dvec,key->co,pvec); - copy_v3_v3(pvec,key->co); - mul_v3_fl(dvec,data->growfac); - add_v3_v3v3(key->co,(key-1)->co,dvec); + sub_v3_v3v3(dvec, key->co, pvec); + copy_v3_v3(pvec, key->co); + mul_v3_fl(dvec, data->growfac); + add_v3_v3v3(key->co, (key-1)->co, dvec); } } @@ -2877,7 +2877,7 @@ static void brush_puff(PEData *data, int point_index) if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(data->ob, data->dm, psys->part->from, psys->particles + point_index, mat); - invert_m4_m4(imat,mat); + invert_m4_m4(imat, mat); } else { unit_m4(mat); @@ -3009,8 +3009,8 @@ static void brush_smooth_get(PEData *data, float mat[][4], float UNUSED(imat[][4 if (key_index) { float dvec[3]; - sub_v3_v3v3(dvec,key->co,(key-1)->co); - mul_mat3_m4_v3(mat,dvec); + sub_v3_v3v3(dvec, key->co, (key-1)->co); + mul_mat3_m4_v3(mat, dvec); add_v3_v3(data->vec, dvec); data->tot++; } @@ -3022,12 +3022,12 @@ static void brush_smooth_do(PEData *data, float UNUSED(mat[][4]), float imat[][4 if (key_index) { copy_v3_v3(vec, data->vec); - mul_mat3_m4_v3(imat,vec); + mul_mat3_m4_v3(imat, vec); - sub_v3_v3v3(dvec,key->co,(key-1)->co); + sub_v3_v3v3(dvec, key->co, (key-1)->co); - sub_v3_v3v3(dvec,vec,dvec); - mul_v3_fl(dvec,data->smoothfac); + sub_v3_v3v3(dvec, vec, dvec); + mul_v3_fl(dvec, data->smoothfac); add_v3_v3(key->co, dvec); } @@ -3063,7 +3063,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, MFace *mface= NULL; MVert *mvert= NULL; int i, totface, intersect=0; - float cur_d, cur_uv[2], v1[3], v2[3], v3[3], v4[3], min[3], max[3], p_min[3],p_max[3]; + float cur_d, cur_uv[2], v1[3], v2[3], v3[3], v4[3], min[3], max[3], p_min[3], p_max[3]; float cur_ipoint[3]; if (dm == NULL) { @@ -3084,50 +3084,50 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, if (pa_minmax==0) { - INIT_MINMAX(p_min,p_max); - DO_MINMAX(co1,p_min,p_max); - DO_MINMAX(co2,p_min,p_max); + INIT_MINMAX(p_min, p_max); + DO_MINMAX(co1, p_min, p_max); + DO_MINMAX(co2, p_min, p_max); } else { - copy_v3_v3(p_min,pa_minmax); - copy_v3_v3(p_max,pa_minmax+3); + copy_v3_v3(p_min, pa_minmax); + copy_v3_v3(p_max, pa_minmax+3); } totface=dm->getNumTessFaces(dm); - mface=dm->getTessFaceDataArray(dm,CD_MFACE); - mvert=dm->getVertDataArray(dm,CD_MVERT); + mface=dm->getTessFaceDataArray(dm, CD_MFACE); + mvert=dm->getVertDataArray(dm, CD_MVERT); /* lets intersect the faces */ - for (i=0; i<totface; i++,mface++) { + for (i=0; i<totface; i++, mface++) { if (vert_cos) { - copy_v3_v3(v1,vert_cos+3*mface->v1); - copy_v3_v3(v2,vert_cos+3*mface->v2); - copy_v3_v3(v3,vert_cos+3*mface->v3); + copy_v3_v3(v1, vert_cos+3*mface->v1); + copy_v3_v3(v2, vert_cos+3*mface->v2); + copy_v3_v3(v3, vert_cos+3*mface->v3); if (mface->v4) - copy_v3_v3(v4,vert_cos+3*mface->v4); + copy_v3_v3(v4, vert_cos+3*mface->v4); } else { - copy_v3_v3(v1,mvert[mface->v1].co); - copy_v3_v3(v2,mvert[mface->v2].co); - copy_v3_v3(v3,mvert[mface->v3].co); + copy_v3_v3(v1, mvert[mface->v1].co); + copy_v3_v3(v2, mvert[mface->v2].co); + copy_v3_v3(v3, mvert[mface->v3].co); if (mface->v4) - copy_v3_v3(v4,mvert[mface->v4].co); + copy_v3_v3(v4, mvert[mface->v4].co); } if (face_minmax==0) { - INIT_MINMAX(min,max); - DO_MINMAX(v1,min,max); - DO_MINMAX(v2,min,max); - DO_MINMAX(v3,min,max); + INIT_MINMAX(min, max); + DO_MINMAX(v1, min, max); + DO_MINMAX(v2, min, max); + DO_MINMAX(v3, min, max); if (mface->v4) DO_MINMAX(v4, min, max); - if (isect_aabb_aabb_v3(min,max,p_min,p_max)==0) + if (isect_aabb_aabb_v3(min, max, p_min, p_max)==0) continue; } else { copy_v3_v3(min, face_minmax+6*i); copy_v3_v3(max, face_minmax+6*i+3); - if (isect_aabb_aabb_v3(min,max,p_min,p_max)==0) + if (isect_aabb_aabb_v3(min, max, p_min, p_max)==0) continue; } @@ -3135,7 +3135,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, if (isect_sweeping_sphere_tri_v3(co1, co2, radius, v2, v3, v1, &cur_d, cur_ipoint)) { if (cur_d<*min_d) { *min_d=cur_d; - copy_v3_v3(ipoint,cur_ipoint); + copy_v3_v3(ipoint, cur_ipoint); *min_face=i; intersect=1; } @@ -3144,7 +3144,7 @@ static int particle_intersect_dm(Scene *scene, Object *ob, DerivedMesh *dm, if (isect_sweeping_sphere_tri_v3(co1, co2, radius, v4, v1, v3, &cur_d, cur_ipoint)) { if (cur_d<*min_d) { *min_d=cur_d; - copy_v3_v3(ipoint,cur_ipoint); + copy_v3_v3(ipoint, cur_ipoint); *min_face=i; intersect=1; } @@ -3190,8 +3190,8 @@ static int brush_add(PEData *data, short number) Object *ob= data->ob; PTCacheEdit *edit = data->edit; ParticleSystem *psys= edit->psys; - ParticleData *add_pars= MEM_callocN(number*sizeof(ParticleData),"ParticleData add"); - ParticleSystemModifierData *psmd= psys_get_modifier(ob,psys); + ParticleData *add_pars= MEM_callocN(number*sizeof(ParticleData), "ParticleData add"); + ParticleSystemModifierData *psmd= psys_get_modifier(ob, psys); ParticleSimulationData sim= {0}; ParticleEditSettings *pset= PE_settings(scene); int i, k, n= 0, totpart= psys->totpart; @@ -3202,7 +3202,7 @@ static int brush_add(PEData *data, short number) short size= pset->brush[PE_BRUSH_ADD].size; short size2= size*size; DerivedMesh *dm=0; - invert_m4_m4(imat,ob->obmat); + invert_m4_m4(imat, ob->obmat); if (psys->flag & PSYS_GLOBAL_HAIR) return 0; @@ -3235,13 +3235,13 @@ static int brush_add(PEData *data, short number) mco[1]= data->mval[1] + dmy; ED_view3d_win_to_segment_clip(data->vc.ar, data->vc.v3d, mco, co1, co2); - mul_m4_v3(imat,co1); - mul_m4_v3(imat,co2); + mul_m4_v3(imat, co1); + mul_m4_v3(imat, co2); min_d=2.0; /* warning, returns the derived mesh face */ - if (particle_intersect_dm(scene, ob,dm,0,co1,co2,&min_d,&add_pars[n].num,add_pars[n].fuv,0,0,0,0)) { - add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob,psmd->dm,add_pars[n].num,add_pars[n].fuv,NULL); + if (particle_intersect_dm(scene, ob, dm, 0, co1, co2, &min_d, &add_pars[n].num, add_pars[n].fuv, 0, 0, 0, 0)) { + add_pars[n].num_dmcache= psys_particle_dm_face_lookup(ob, psmd->dm, add_pars[n].num, add_pars[n].fuv, NULL); n++; } } @@ -3249,8 +3249,8 @@ static int brush_add(PEData *data, short number) int newtotpart=totpart+n; float hairmat[4][4], cur_co[3]; KDTree *tree=0; - ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData),"ParticleData new"); - PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint),"PTCacheEditPoint array new"); + ParticleData *pa, *new_pars= MEM_callocN(newtotpart*sizeof(ParticleData), "ParticleData new"); + PTCacheEditPoint *point, *new_points= MEM_callocN(newtotpart*sizeof(PTCacheEditPoint), "PTCacheEditPoint array new"); PTCacheEditKey *key; HairKey *hkey; @@ -3275,7 +3275,7 @@ static int brush_add(PEData *data, short number) tree=BLI_kdtree_new(psys->totpart); for (i=0, pa=psys->particles; i<totpart; i++, pa++) { - psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,cur_co,0,0,0,0,0); + psys_particle_on_dm(psmd->dm, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, cur_co, 0, 0, 0, 0, 0); BLI_kdtree_insert(tree, i, cur_co, NULL); } @@ -3303,7 +3303,7 @@ static int brush_add(PEData *data, short number) } pa->size= 1.0f; - initialize_particle(&sim, pa,i); + initialize_particle(&sim, pa, i); reset_particle(&sim, pa, 0.0, 1.0); point->flag |= PEP_EDIT_RECALC; if (pe_x_mirror(ob)) @@ -3319,8 +3319,8 @@ static int brush_add(PEData *data, short number) int w, maxw; float maxd, totw=0.0, weight[3]; - psys_particle_on_dm(psmd->dm,psys->part->from,pa->num,pa->num_dmcache,pa->fuv,pa->foffset,co1,0,0,0,0,0); - maxw= BLI_kdtree_find_n_nearest(tree,3,co1,NULL,ptn); + psys_particle_on_dm(psmd->dm, psys->part->from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, co1, 0, 0, 0, 0, 0); + maxw= BLI_kdtree_find_n_nearest(tree, 3, co1, NULL, ptn); maxd= ptn[maxw-1].dist; @@ -3379,7 +3379,7 @@ static int brush_add(PEData *data, short number) } for (k=0, hkey=pa->hair; k<pset->totaddkey; k++, hkey++) { psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); - invert_m4_m4(imat,hairmat); + invert_m4_m4(imat, hairmat); mul_m4_v3(imat, hkey->co); } } @@ -3635,7 +3635,7 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) if (pset->brushtype == PE_BRUSH_ADD && pe_x_mirror(ob)) PE_mirror_x(scene, ob, 1); - update_world_cos(ob,edit); + update_world_cos(ob, edit); psys_free_path_cache(NULL, edit); DAG_id_tag_update(&ob->id, OB_RECALC_DATA); } @@ -3931,7 +3931,7 @@ void PE_undo_push(Scene *scene, const char *str) } /* copy */ - make_PTCacheUndo(edit,edit->curundo); + make_PTCacheUndo(edit, edit->curundo); } void PE_undo_step(Scene *scene, int step) @@ -3941,7 +3941,7 @@ void PE_undo_step(Scene *scene, int step) if (!edit) return; if (step==0) { - get_PTCacheUndo(edit,edit->curundo); + get_PTCacheUndo(edit, edit->curundo); } else if (step==1) { @@ -4100,7 +4100,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, totpoint = psys ? psys->totpart : (int)((PTCacheMem*)cache->mem_cache.first)->totpoint; edit= MEM_callocN(sizeof(PTCacheEdit), "PE_create_particle_edit"); - edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint),"PTCacheEditPoints"); + edit->points=MEM_callocN(totpoint*sizeof(PTCacheEditPoint), "PTCacheEditPoints"); edit->totpoint = totpoint; if (psys && !cache) { @@ -4115,7 +4115,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, pa = psys->particles; LOOP_POINTS { point->totkey = pa->totkey; - point->keys= MEM_callocN(point->totkey*sizeof(PTCacheEditKey),"ParticleEditKeys"); + point->keys= MEM_callocN(point->totkey*sizeof(PTCacheEditKey), "ParticleEditKeys"); point->flag |= PEP_EDIT_RECALC; hkey = pa->hair; @@ -4151,7 +4151,7 @@ static void PE_create_particle_edit(Scene *scene, Object *ob, PointCache *cache, continue; if (!point->totkey) { - key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey),"ParticleEditKeys"); + key = point->keys = MEM_callocN(totframe*sizeof(PTCacheEditKey), "ParticleEditKeys"); point->flag |= PEP_EDIT_RECALC; } else diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 3d50ec26a40..3764866cb7f 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -532,7 +532,7 @@ void PARTICLE_OT_dupliob_move_down(wmOperatorType *ot) static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys) { - ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys); + ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); ParticleEditSettings *pset= PE_settings(scene); ParticleData *pa; PTCacheEdit *edit; @@ -551,7 +551,7 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys) edit = psys->edit; point= edit ? edit->points : NULL; - for (i=0, pa=psys->particles; i<psys->totpart; i++,pa++) { + for (i=0, pa=psys->particles; i<psys->totpart; i++, pa++) { if (point) { ekey = point->keys; point++; @@ -559,8 +559,8 @@ static void disconnect_hair(Scene *scene, Object *ob, ParticleSystem *psys) psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); - for (k=0,key=pa->hair; k<pa->totkey; k++,key++) { - mul_m4_v3(hairmat,key->co); + for (k=0, key=pa->hair; k<pa->totkey; k++, key++) { + mul_m4_v3(hairmat, key->co); if (ekey) { ekey->flag &= ~PEK_USE_WCO; @@ -622,7 +622,7 @@ void PARTICLE_OT_disconnect_hair(wmOperatorType *ot) static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) { - ParticleSystemModifierData *psmd = psys_get_modifier(ob,psys); + ParticleSystemModifierData *psmd = psys_get_modifier(ob, psys); ParticleData *pa; PTCacheEdit *edit; PTCacheEditPoint *point; @@ -661,7 +661,7 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) bvhtree_from_mesh_faces(&bvhtree, dm, 0.0, 2, 6); - for (i=0, pa= psys->particles; i<psys->totpart; i++,pa++) { + for (i=0, pa= psys->particles; i<psys->totpart; i++, pa++) { key = pa->hair; nearest.index = -1; @@ -675,23 +675,23 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) continue; } - mface = CDDM_get_tessface(dm,nearest.index); + mface = CDDM_get_tessface(dm, nearest.index); - copy_v3_v3(v[0], CDDM_get_vert(dm,mface->v1)->co); - copy_v3_v3(v[1], CDDM_get_vert(dm,mface->v2)->co); - copy_v3_v3(v[2], CDDM_get_vert(dm,mface->v3)->co); + copy_v3_v3(v[0], CDDM_get_vert(dm, mface->v1)->co); + copy_v3_v3(v[1], CDDM_get_vert(dm, mface->v2)->co); + copy_v3_v3(v[2], CDDM_get_vert(dm, mface->v3)->co); if (mface->v4) { - copy_v3_v3(v[3], CDDM_get_vert(dm,mface->v4)->co); - interp_weights_poly_v3( pa->fuv,v, 4, nearest.co); + copy_v3_v3(v[3], CDDM_get_vert(dm, mface->v4)->co); + interp_weights_poly_v3( pa->fuv, v, 4, nearest.co); } else - interp_weights_poly_v3( pa->fuv,v, 3, nearest.co); + interp_weights_poly_v3( pa->fuv, v, 3, nearest.co); pa->num = nearest.index; - pa->num_dmcache = psys_particle_dm_face_lookup(ob,psmd->dm,pa->num,pa->fuv,NULL); + pa->num_dmcache = psys_particle_dm_face_lookup(ob, psmd->dm, pa->num, pa->fuv, NULL); psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, pa, hairmat); - invert_m4_m4(imat,hairmat); + invert_m4_m4(imat, hairmat); sub_v3_v3v3(vec, nearest.co, key->co); @@ -700,9 +700,9 @@ static void connect_hair(Scene *scene, Object *ob, ParticleSystem *psys) point++; } - for (k=0,key=pa->hair; k<pa->totkey; k++,key++) { + for (k=0, key=pa->hair; k<pa->totkey; k++, key++) { add_v3_v3(key->co, vec); - mul_m4_v3(imat,key->co); + mul_m4_v3(imat, key->co); if (ekey) { ekey->flag |= PEK_USE_WCO; diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index c0d3e505873..9b637824b3e 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -150,8 +150,8 @@ static int fluid_is_animated_mesh(FluidsimSettings *fss) /* helper function */ void fluidsimGetGeometryObjFilename(Object *ob, char *dst) { //, char *srcname) { - //BLI_snprintf(dst,FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name); - BLI_snprintf(dst,FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name); + //BLI_snprintf(dst, FILE_MAXFILE, "%s_cfgdata_%s.bobj.gz", srcname, ob->id.name); + BLI_snprintf(dst, FILE_MAXFILE, "fluidcfgdata_%s.bobj.gz", ob->id.name); } #endif @@ -199,7 +199,7 @@ typedef struct FluidObject { #if 0 static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char *str, int entries) { - int i,j; + int i, j; int channelSize = paramsize; if (entries==3) { @@ -214,12 +214,12 @@ static void fluidsimPrintChannel(FILE *file, float *channel, int paramsize, char fprintf(file, " CHANNEL %s =\n", str); for (i=0; i<channelSize;i++) { - fprintf(file," "); + fprintf(file, " "); for (j=0;j<=entries;j++) { // also print time value - fprintf(file," %f ", channel[i*(entries+1)+j] ); - if (j==entries-1) { fprintf(file," "); } + fprintf(file, " %f ", channel[i*(entries+1)+j] ); + if (j==entries-1) { fprintf(file, " "); } } - fprintf(file,"\n"); + fprintf(file, "\n"); } fprintf(file, " ;\n" ); @@ -679,7 +679,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF if (fileCfg) { dirExist = 1; fclose(fileCfg); // remove cfg dummy from directory test - BLI_delete(targetFile, 0,0); + BLI_delete(targetFile, 0, 0); } if (targetDir[0] == '\0' || (!dirExist)) { @@ -691,7 +691,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF BLI_splitdirstring(blendDir, blendFile); BLI_replace_extension(blendFile, FILE_MAX, ""); /* strip .blend */ - BLI_snprintf(newSurfdataPath, FILE_MAX ,"//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); + BLI_snprintf(newSurfdataPath, FILE_MAX, "//fluidsimdata/%s_%s_", blendFile, fsDomain->id.name); BLI_snprintf(debugStrBuffer, 256, "fluidsimBake::error - warning resetting output dir to '%s'\n", newSurfdataPath); elbeemDebugOut(debugStrBuffer); @@ -703,7 +703,7 @@ static int fluid_init_filepaths(Object *fsDomain, char *targetDir, char *targetF if (outStringsChanged) { char dispmsg[FILE_MAX+256]; int selection=0; - BLI_strncpy(dispmsg,"Output settings set to: '", sizeof(dispmsg)); + BLI_strncpy(dispmsg, "Output settings set to: '", sizeof(dispmsg)); strcat(dispmsg, newSurfdataPath); strcat(dispmsg, "'%t|Continue with changed settings%x1|Discard and abort%x0"); @@ -792,7 +792,7 @@ int runSimulationCallback(void *data, int status, int frame) if (status == FLUIDSIM_CBSTATUS_NEWFRAME) { fluidbake_updatejob(fb, frame / (float)settings->noOfFrames); - //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d\n", status,frame, settings->domainId, settings->noOfFrames ); // DEBUG + //printf("elbeem blender cb s%d, f%d, domainid:%d noOfFrames: %d\n", status, frame, settings->domainId, settings->noOfFrames ); // DEBUG } if (fluidbake_breakjob(fb)) { @@ -898,7 +898,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor if (getenv(strEnvName)) { int dlevel = atoi(getenv(strEnvName)); elbeemSetDebugLevel(dlevel); - BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer),"fluidsimBake::msg: Debug messages activated due to envvar '%s'\n",strEnvName); + BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::msg: Debug messages activated due to envvar '%s'\n", strEnvName); elbeemDebugOut(debugStrBuffer); } @@ -935,7 +935,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* rough check of settings... */ if (domainSettings->previewresxyz > domainSettings->resolutionxyz) { - BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz , domainSettings->resolutionxyz); + BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::warning - Preview (%d) >= Resolution (%d)... setting equal.\n", domainSettings->previewresxyz, domainSettings->resolutionxyz); elbeemDebugOut(debugStrBuffer); domainSettings->previewresxyz = domainSettings->resolutionxyz; } @@ -958,7 +958,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor else { gridlevels = domainSettings->maxRefine; } - BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name , gridlevels ); + BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::msg: Baking %s, refine: %d\n", fsDomain->id.name, gridlevels ); elbeemDebugOut(debugStrBuffer); @@ -978,7 +978,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor /* ******** init domain object's matrix ******** */ copy_m4_m4(domainMat, fsDomain->obmat); if (!invert_m4_m4(invDomMat, domainMat)) { - BLI_snprintf(debugStrBuffer,sizeof(debugStrBuffer),"fluidsimBake::error - Invalid obj matrix?\n"); + BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "fluidsimBake::error - Invalid obj matrix?\n"); elbeemDebugOut(debugStrBuffer); BKE_report(reports, RPT_ERROR, "Invalid object matrix"); diff --git a/source/blender/editors/render/render_opengl.c b/source/blender/editors/render/render_opengl.c index f9737b02a01..cb98c8283eb 100644 --- a/source/blender/editors/render/render_opengl.c +++ b/source/blender/editors/render/render_opengl.c @@ -348,7 +348,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op) oglrender->is_sequencer = is_sequencer; if (is_sequencer) { - oglrender->sseq = CTX_wm_space_seq(C);; + oglrender->sseq = CTX_wm_space_seq(C); } diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 2a561a6bc6c..8a43e15eb9f 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -84,19 +84,19 @@ static void region_draw_emboss(ARegion *ar, rcti *scirct) glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA ); /* right */ - glColor4ub(0,0,0, 30); + glColor4ub(0, 0, 0, 30); sdrawline(rect.xmax, rect.ymin, rect.xmax, rect.ymax); /* bottom */ - glColor4ub(0,0,0, 30); + glColor4ub(0, 0, 0, 30); sdrawline(rect.xmin, rect.ymin, rect.xmax, rect.ymin); /* top */ - glColor4ub(255,255,255, 30); + glColor4ub(255, 255, 255, 30); sdrawline(rect.xmin, rect.ymax, rect.xmax, rect.ymax); /* left */ - glColor4ub(255,255,255, 30); + glColor4ub(255, 255, 255, 30); sdrawline(rect.xmin, rect.ymin, rect.xmin, rect.ymax); glDisable( GL_BLEND ); @@ -1530,17 +1530,17 @@ int ED_area_header_standardbuttons(const bContext *C, uiBlock *block, int yco) if (sa->flag & HEADER_NO_PULLDOWN) { but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, - ICON_DISCLOSURE_TRI_RIGHT, - xco,yco,UI_UNIT_X,UI_UNIT_Y-2, - &(sa->flag), 0, 0, 0, 0, - "Show pulldown menus"); + ICON_DISCLOSURE_TRI_RIGHT, + xco, yco, UI_UNIT_X, UI_UNIT_Y - 2, + &(sa->flag), 0, 0, 0, 0, + "Show pulldown menus"); } else { but = uiDefIconButBitS(block, TOG, HEADER_NO_PULLDOWN, 0, - ICON_DISCLOSURE_TRI_DOWN, - xco,yco,UI_UNIT_X,UI_UNIT_Y-2, - &(sa->flag), 0, 0, 0, 0, - "Hide pulldown menus"); + ICON_DISCLOSURE_TRI_DOWN, + xco, yco, UI_UNIT_X, UI_UNIT_Y - 2, + &(sa->flag), 0, 0, 0, 0, + "Hide pulldown menus"); } uiButClearFlag(but, UI_BUT_UNDO); /* skip undo on screen buttons */ @@ -1803,7 +1803,7 @@ void ED_region_info_draw(ARegion *ar, const char *text, int block, float alpha) rect.ymax = ar->winrct.ymax - ar->winrct.ymin; glEnable(GL_BLEND); - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glColor4f(0.0f, 0.0f, 0.0f, alpha); glRecti(rect.xmin, rect.ymin, rect.xmax+1, rect.ymax+1); glDisable(GL_BLEND); @@ -1820,7 +1820,7 @@ void ED_region_grid_draw(ARegion *ar, float zoomx, float zoomy) float fac, blendfac; int x1, y1, x2, y2; - /* the image is located inside (0,0),(1, 1) as set by view2d */ + /* the image is located inside (0, 0), (1, 1) as set by view2d */ UI_ThemeColorShade(TH_BACK, 20); UI_view2d_to_region_no_clip(&ar->v2d, 0.0f, 0.0f, &x1, &y1); diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 5b73645abde..50430399f09 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -81,14 +81,14 @@ GLubyte stipple_halftone[128] = { GLubyte stipple_quarttone[128] = { - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0, - 136,136,136,136,0,0,0,0,34,34,34,34,0,0,0,0}; + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0, + 136, 136, 136, 136, 0, 0, 0, 0, 34, 34, 34, 34, 0, 0, 0, 0}; GLubyte stipple_diag_stripes_pos[128] = { @@ -195,16 +195,15 @@ void fdrawcheckerboard(float x1, float y1, float x2, float y2) { unsigned char col1[4]= {40, 40, 40}, col2[4]= {50, 50, 50}; - GLubyte checker_stipple[32*32/8] = { - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, - 255,0,255,0,255,0,255,0,255,0,255,0,255,0,255,0, - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, - 0,255,0,255,0,255,0,255,0,255,0,255,0,255,0,255, - }; + GLubyte checker_stipple[32 * 32 / 8] = { + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, + 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, + 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, + 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255, 0, 255}; glColor3ubv(col1); glRectf(x1, y1, x2, y2); @@ -370,8 +369,8 @@ void fdrawXORellipse(float xofs, float yofs, float hw, float hh) set_inverted_drawing(1); glPushMatrix(); - glTranslatef(xofs, yofs, 0.0); - glScalef(1,hh/hw,1); + glTranslatef(xofs, yofs, 0.0f); + glScalef(1.0f, hh / hw, 1.0f); glutil_draw_lined_arc(0.0, M_PI*2.0, hw, 20); glPopMatrix(); @@ -786,10 +785,10 @@ void glaEnd2DDraw(gla2DDrawInfo *di) static int curmode=0; static int pointhack=0; -static GLubyte Squaredot[16] = { 0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff, - 0xff,0xff,0xff,0xff}; +static GLubyte Squaredot[16] = {0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff, + 0xff, 0xff, 0xff, 0xff}; void bglBegin(int mode) { diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 3777547fa90..49672b77d43 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -1505,13 +1505,13 @@ static int area_split_modal(bContext *C, wmOperator *op, wmEvent *event) RNA_enum_set(op->ptr, "direction", 'h'); sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_H; - WM_cursor_set(CTX_wm_window(C),CURSOR_X_MOVE); + WM_cursor_set(CTX_wm_window(C), CURSOR_X_MOVE); } else { RNA_enum_set(op->ptr, "direction", 'v'); sd->sarea->flag |= AREA_FLAG_DRAWSPLIT_V; - WM_cursor_set(CTX_wm_window(C),CURSOR_Y_MOVE); + WM_cursor_set(CTX_wm_window(C), CURSOR_Y_MOVE); } } } diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 36b38661463..10db1bb1f12 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -279,7 +279,7 @@ static int get_file_icon(struct direntry *file) static void file_draw_icon(uiBlock *block, char *path, int sx, int sy, int icon, int width, int height) { uiBut *but; - int x,y; + int x, y; /*float alpha=1.0f;*/ x = sx; @@ -301,7 +301,7 @@ static void file_draw_string(int sx, int sy, const char* string, float width, in fs.align = align; - BLI_strncpy(fname,string, FILE_MAXFILE); + BLI_strncpy(fname, string, FILE_MAXFILE); file_shorten_string(fname, width + 1.0f, 0); /* no text clipping needed, uiStyleFontDraw does it but is a bit too strict (for buttons it works) */ @@ -512,7 +512,7 @@ void file_draw_list(const bContext *C, ARegion *ar) is_icon = 0; imb = filelist_getimage(files, i); if (!imb) { - imb = filelist_geticon(files,i); + imb = filelist_geticon(files, i); is_icon = 1; } @@ -526,8 +526,8 @@ void file_draw_list(const bContext *C, ARegion *ar) UI_ThemeColor4(TH_TEXT); if (file->selflag & EDITING_FILE) { - uiBut *but = uiDefBut(block, TEX, 1, "", sx , sy-layout->tile_h-3, - textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit),0,0,""); + uiBut *but = uiDefBut(block, TEX, 1, "", sx, sy-layout->tile_h-3, + textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit), 0, 0, ""); uiButSetRenameFunc(but, renamebutton_cb, file); uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */ uiButClearFlag(but, UI_BUT_UNDO); @@ -562,14 +562,14 @@ void file_draw_list(const bContext *C, ARegion *ar) file_draw_string(sx, sy, file->mode3, layout->column_widths[COLUMN_MODE3], layout->tile_h, align); sx += layout->column_widths[COLUMN_MODE3] + 12; - file_draw_string(sx, sy, file->owner, layout->column_widths[COLUMN_OWNER] , layout->tile_h, align); + file_draw_string(sx, sy, file->owner, layout->column_widths[COLUMN_OWNER], layout->tile_h, align); sx += layout->column_widths[COLUMN_OWNER] + 12; #endif file_draw_string(sx, sy, file->date, layout->column_widths[COLUMN_DATE], layout->tile_h, align); sx += (int)layout->column_widths[COLUMN_DATE] + 12; - file_draw_string(sx, sy, file->time, layout->column_widths[COLUMN_TIME] , layout->tile_h, align); + file_draw_string(sx, sy, file->time, layout->column_widths[COLUMN_TIME], layout->tile_h, align); sx += (int)layout->column_widths[COLUMN_TIME] + 12; if (!(file->type & S_IFDIR)) { diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index 9455f6390f7..d3598ffd4e7 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -88,7 +88,7 @@ int file_previous_exec(bContext *C, struct wmOperator *unused); int file_next_exec(bContext *C, struct wmOperator *unused); int file_filename_exec(bContext *C, struct wmOperator *unused); int file_directory_exec(bContext *C, struct wmOperator *unused); -int file_directory_new_exec(bContext *C,struct wmOperator *unused); +int file_directory_new_exec(bContext *C, struct wmOperator *unused); int file_delete_exec(bContext *C, struct wmOperator *unused); int file_hilight_set(struct SpaceFile *sfile, struct ARegion *ar, int mx, int my); diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index aa1ab823ee1..f340c53f528 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -73,7 +73,7 @@ static FileSelection find_file_mouse_rect(SpaceFile *sfile, struct ARegion* ar, const rcti* rect) { FileSelection sel; - float fxmin,fymin,fxmax, fymax; + float fxmin, fymin, fxmax, fymax; View2D* v2d = &ar->v2d; rcti rect_view; @@ -1035,7 +1035,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op) SpaceFile *sfile= CTX_wm_space_file(C); if (!sfile->params) { - BKE_report(op->reports,RPT_WARNING, "No parent directory given"); + BKE_report(op->reports, RPT_WARNING, "No parent directory given"); return OPERATOR_CANCELLED; } @@ -1049,7 +1049,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op) if (generate_name) { /* create a new, non-existing folder name */ if (!new_folder_path(sfile->params->dir, path, name)) { - BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder name"); + BKE_report(op->reports, RPT_ERROR, "Couldn't create new folder name"); return OPERATOR_CANCELLED; } } @@ -1058,7 +1058,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op) BLI_dir_create_recursive(path); if (!BLI_exists(path)) { - BKE_report(op->reports,RPT_ERROR, "Couldn't create new folder"); + BKE_report(op->reports, RPT_ERROR, "Couldn't create new folder"); return OPERATOR_CANCELLED; } @@ -1330,7 +1330,7 @@ void FILE_OT_filenum(struct wmOperatorType *ot) ot->poll = ED_operator_file_active; /* <- important, handler is on window level */ /* props */ - RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100,100); + RNA_def_int(ot->srna, "increment", 1, -100, 100, "Increment", "", -100, 100); } static int file_rename_exec(bContext *C, wmOperator *UNUSED(op)) diff --git a/source/blender/editors/space_file/file_panels.c b/source/blender/editors/space_file/file_panels.c index 596721bff07..9fe1940e87b 100644 --- a/source/blender/editors/space_file/file_panels.c +++ b/source/blender/editors/space_file/file_panels.c @@ -116,7 +116,7 @@ static void file_panel_category(const bContext *C, Panel *pa, FSMenuCategory cat BLI_strncpy(dir, entry, FILE_MAX); /* create list item */ - but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0,0,UI_UNIT_X*10,UI_UNIT_Y, nr, 0, i, 0, 0, entry); + but = uiDefIconTextButS(block, LISTROW, 0, icon, dir, 0, 0, UI_UNIT_X * 10, UI_UNIT_Y, nr, 0, i, 0, 0, entry); uiButSetFunc(but, file_panel_cb, entry, NULL); uiButSetFlag(but, UI_ICON_LEFT|UI_TEXT_LEFT); diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index a05eba2daeb..c72d95f63a7 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -179,7 +179,7 @@ static int compare_name(const void *a1, const void *a2) if ( strcmp(entry1->relname, "..")==0 ) return (-1); if ( strcmp(entry2->relname, "..")==0 ) return (1); - return (BLI_natstrcmp(entry1->relname,entry2->relname)); + return (BLI_natstrcmp(entry1->relname, entry2->relname)); } static int compare_date(const void *a1, const void *a2) @@ -212,7 +212,7 @@ static int compare_date(const void *a1, const void *a2) if ( entry1->s.st_mtime < entry2->s.st_mtime) return 1; if ( entry1->s.st_mtime > entry2->s.st_mtime) return -1; - else return BLI_natstrcmp(entry1->relname,entry2->relname); + else return BLI_natstrcmp(entry1->relname, entry2->relname); } static int compare_size(const void *a1, const void *a2) @@ -244,7 +244,7 @@ static int compare_size(const void *a1, const void *a2) if ( entry1->s.st_size < entry2->s.st_size) return 1; if ( entry1->s.st_size > entry2->s.st_size) return -1; - else return BLI_natstrcmp(entry1->relname,entry2->relname); + else return BLI_natstrcmp(entry1->relname, entry2->relname); } static int compare_extension(const void *a1, const void *a2) @@ -456,7 +456,7 @@ void folderlist_pushdir(ListBase* folderlist, const char *dir) } // create next folder element - folder = (FolderList*)MEM_mallocN(sizeof(FolderList),"FolderList"); + folder = (FolderList*)MEM_mallocN(sizeof(FolderList), "FolderList"); folder->foldername = (char*)MEM_mallocN(sizeof(char)*(strlen(dir)+1), "foldername"); folder->foldername[0] = '\0'; @@ -1144,7 +1144,7 @@ void filelist_from_main(struct FileList *filelist) filelist->filelist= (struct direntry *)malloc(filelist->numfiles * sizeof(struct direntry)); for (a=0; a<filelist->numfiles; a++) { - memset( &(filelist->filelist[a]), 0 , sizeof(struct direntry)); + memset( &(filelist->filelist[a]), 0, sizeof(struct direntry)); filelist->filelist[a].type |= S_IFDIR; } @@ -1198,7 +1198,7 @@ void filelist_from_main(struct FileList *filelist) files = filelist->filelist; if (!filelist->hide_parent) { - memset( &(filelist->filelist[0]), 0 , sizeof(struct direntry)); + memset( &(filelist->filelist[0]), 0, sizeof(struct direntry)); filelist->filelist[0].relname= BLI_strdup(".."); filelist->filelist[0].type |= S_IFDIR; @@ -1212,7 +1212,7 @@ void filelist_from_main(struct FileList *filelist) ok = 1; if (ok) { if (!filelist->hide_dot || id->name[2] != '.') { - memset( files, 0 , sizeof(struct direntry)); + memset(files, 0, sizeof(struct direntry)); if (id->lib==NULL) files->relname= BLI_strdup(id->name+2); else { diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index a4da1975c56..0c94bff8803 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -315,7 +315,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) /* Adding Desktop and My Documents */ SHGetSpecialFolderPath(0, line, CSIDL_PERSONAL, 0); - fsmenu_insert_entry(fsmenu,FS_CATEGORY_BOOKMARKS, line, 1, 0); + fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); SHGetSpecialFolderPath(0, line, CSIDL_DESKTOPDIRECTORY, 0); fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); } @@ -399,7 +399,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle); - if (!CFStringGetCString(pathString,line,256,kCFStringEncodingASCII)) + if (!CFStringGetCString(pathString, line, 256, kCFStringEncodingASCII)) continue; fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, line, 1, 0); @@ -448,7 +448,7 @@ void fsmenu_read_system(struct FSMenu* fsmenu) pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle); - if (!CFStringGetCString(pathString,line,256,kCFStringEncodingASCII)) + if (!CFStringGetCString(pathString, line, 256, kCFStringEncodingASCII)) continue; fsmenu_insert_entry(fsmenu, FS_CATEGORY_BOOKMARKS, line, 1, 0); diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index e166914b36f..dac5d1e1347 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -218,7 +218,7 @@ static void file_refresh(const bContext *C, ScrArea *UNUSED(sa)) } else { if (params->display == FILE_IMGDISPLAY) { - if (!thumbnails_running(sfile->files,C)) { + if (!thumbnails_running(sfile->files, C)) { thumbnails_start(sfile->files, C); } } @@ -432,12 +432,12 @@ static void file_keymap(struct wmKeyConfig *keyconf) RNA_int_set(kmi->ptr, "increment", 10); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADPLUSKEY, KM_PRESS, KM_CTRL, 0); RNA_int_set(kmi->ptr, "increment", 100); - kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0,0); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "increment", -1); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT, 0); RNA_int_set(kmi->ptr, "increment", -10); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0); - RNA_int_set(kmi->ptr, "increment",-100); + RNA_int_set(kmi->ptr, "increment", -100); /* keys for button area (top) */ @@ -450,10 +450,10 @@ static void file_keymap(struct wmKeyConfig *keyconf) RNA_int_set(kmi->ptr, "increment", 100); kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, 0, 0); RNA_int_set(kmi->ptr, "increment", -1); - kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT,0); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_SHIFT, 0); RNA_int_set(kmi->ptr, "increment", -10); - kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL,0); - RNA_int_set(kmi->ptr, "increment",-100); + kmi = WM_keymap_add_item(keymap, "FILE_OT_filenum", PADMINUS, KM_PRESS, KM_CTRL, 0); + RNA_int_set(kmi->ptr, "increment", -100); } diff --git a/source/blender/editors/space_logic/logic_ops.c b/source/blender/editors/space_logic/logic_ops.c index cac4fe04765..1e976cebafd 100644 --- a/source/blender/editors/space_logic/logic_ops.c +++ b/source/blender/editors/space_logic/logic_ops.c @@ -198,7 +198,7 @@ static int edit_actuator_invoke_properties(bContext *C, wmOperator *op) bActuator *act = ptr.data; Object *ob = ptr.id.data; - RNA_string_set(op->ptr, "actuator",act->name); + RNA_string_set(op->ptr, "actuator", act->name); RNA_string_set(op->ptr, "object", ob->id.name+2); return 1; } diff --git a/source/blender/editors/space_logic/logic_window.c b/source/blender/editors/space_logic/logic_window.c index 9f5ae19d92c..cd01b52ddcc 100644 --- a/source/blender/editors/space_logic/logic_window.c +++ b/source/blender/editors/space_logic/logic_window.c @@ -1181,9 +1181,9 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short ts= sens->data; - // uiDefBut(block, TEX, 1, "Property:", xco,yco-22,width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); - uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:",(short)(xco + 10),(short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material"); - // uiDefButF(block, NUM, 1, "Margin:", xco+width/2,yco-44,width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity"); + // uiDefBut(block, TEX, 1, "Property:", xco, yco-22, width, 19, &ts->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); + uiDefIDPoinBut(block, test_matpoin_but, ID_MA, 1, "MA:", (short)(xco + 10), (short)(yco-44), (short)(width - 20), 19, &ts->ma, "Only look for floors with this Material"); + // uiDefButF(block, NUM, 1, "Margin:", xco+width/2, yco-44, width/2, 19, &ts->dist, 0.0, 10.0, 100, 0, "Extra margin (distance) for larger sensitivity"); yco-= ysize; break; } @@ -1200,11 +1200,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short /* The collision sensor will become a generic collision (i.e. it */ /* absorb the old touch sensor). */ - uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse",(short)(xco + 10),(short)(yco - 44), + uiDefButBitS(block, TOG, SENS_COLLISION_PULSE, B_REDR, "Pulse", (short)(xco + 10), (short)(yco - 44), (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, "Changes to the set of colliding objects generated pulses"); - uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P",(short)(xco + 10 + (0.20 * (width-20))),(short)(yco - 44), + uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P", (short)(xco + 10 + (0.20 * (width-20))), (short)(yco - 44), (short)(0.20 * (width-20)), 19, &cs->mode, 0.0, 0.0, 0, 0, "Toggle collision on material or property"); @@ -1219,7 +1219,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short "Only look for Objects with this property"); } - /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90,yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */ + /* uiDefButS(block, NUM, 1, "Damp:", xco+10+width-90, yco-24, 70, 19, &cs->damp, 0, 250, 0, 0, "For 'damp' time don't detect another collision"); */ yco-= ysize; break; @@ -1234,11 +1234,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short draw_default_sensor_header(sens, block, xco, yco, width); ns= sens->data; - uiDefBut(block, TEX, 1, "Property:",(short)(10+xco),(short)(yco-44), (short)(width-20), 19, + uiDefBut(block, TEX, 1, "Property:", (short)(10+xco), (short)(yco-44), (short)(width-20), 19, &ns->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); - uiDefButF(block, NUM, 1, "Dist",(short)(10+xco),(short)(yco-68),(short)((width-22)/2), 19, + uiDefButF(block, NUM, 1, "Dist", (short)(10+xco), (short)(yco-68), (short)((width-22)/2), 19, &ns->dist, 0.0, 1000.0, 1000, 0, "Trigger distance"); - uiDefButF(block, NUM, 1, "Reset",(short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19, + uiDefButF(block, NUM, 1, "Reset", (short)(10+xco+(width-22)/2), (short)(yco-68), (short)((width-22)/2), 19, &ns->resetdist, 0.0, 1000.0, 1000, 0, "Reset distance"); yco-= ysize; break; @@ -1255,7 +1255,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short rs= sens->data; uiDefBut(block, TEX, 1, "Prop:", - (short)(10+xco),(short)(yco-44), (short)(0.7 * (width-20)), 19, + (short)(10+xco), (short)(yco-44), (short)(0.7 * (width-20)), 19, &rs->name, 0, MAX_NAME, 0, 0, "Only look for Objects with this property"); @@ -1338,25 +1338,25 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short str= "Type %t|Equal %x0|Not Equal %x1|Interval %x2|Changed %x3"; /* str= "Type %t|Equal %x0|Not Equal %x1"; */ - uiDefButI(block, MENU, B_REDR, str, xco+30,yco-44,width-60, 19, + uiDefButI(block, MENU, B_REDR, str, xco+30, yco-44, width-60, 19, &ps->type, 0, 31, 0, 0, "Type"); if (ps->type != SENS_PROP_EXPRESSION) { - uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-68,width-60, 19, + uiDefBut(block, TEX, 1, "Prop: ", xco+30, yco-68, width-60, 19, ps->name, 0, MAX_NAME, 0, 0, "Property name"); } if (ps->type == SENS_PROP_INTERVAL) { - uiDefBut(block, TEX, 1, "Min: ", xco,yco-92,width/2, 19, + uiDefBut(block, TEX, 1, "Min: ", xco, yco-92, width/2, 19, ps->value, 0, MAX_NAME, 0, 0, "check for min value"); - uiDefBut(block, TEX, 1, "Max: ", xco+width/2,yco-92,width/2, 19, + uiDefBut(block, TEX, 1, "Max: ", xco+width/2, yco-92, width/2, 19, ps->maxvalue, 0, MAX_NAME, 0, 0, "check for max value"); } else if (ps->type == SENS_PROP_CHANGED) { /* pass */ } else { - uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-92,width-60, 19, + uiDefBut(block, TEX, 1, "Value: ", xco+30, yco-92, width-60, 19, ps->value, 0, MAX_NAME, 0, 0, "check for value"); } @@ -1390,11 +1390,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short str= "Type %t|State changed %x0|Lin error below %x1|Lin error above %x2|Rot error below %x3|Rot error above %x4"; - uiDefButI(block, MENU, B_REDR, str, xco+10,yco-66,0.4*(width-20), 19, + uiDefButI(block, MENU, B_REDR, str, xco+10, yco-66, 0.4*(width-20), 19, &arm->type, 0, 31, 0, 0, "Type"); if (arm->type != SENS_ARM_STATE_CHANGED) { - uiDefButF(block, NUM, 1, "Value: ", xco+10+0.4*(width-20),yco-66,0.6*(width-20), 19, + uiDefButF(block, NUM, 1, "Value: ", xco+10+0.4*(width-20), yco-66, 0.6*(width-20), 19, &arm->value, -10000.0, 10000.0, 100, 0, "Test the error against this value"); } } @@ -1412,7 +1412,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short draw_default_sensor_header(sens, block, xco, yco, width); as= sens->data; - uiDefBut(block, TEX, 1, "Act: ", xco+30,yco-44,width-60, 19, + uiDefBut(block, TEX, 1, "Act: ", xco+30, yco-44, width-60, 19, as->name, 0, MAX_NAME, 0, 0, "Actuator name, actuator active state modifications will be detected"); yco-= ysize; break; @@ -1428,11 +1428,11 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short draw_default_sensor_header(sens, block, xco, yco, width); ds = sens->data; - uiDefButS(block, NUM, 0, "Delay",(short)(10+xco),(short)(yco-44),(short)((width-22)*0.4+10), 19, + uiDefButS(block, NUM, 0, "Delay", (short)(10+xco), (short)(yco-44), (short)((width-22)*0.4+10), 19, &ds->delay, 0.0, 5000.0, 0, 0, "Delay in number of logic tics before the positive trigger (default 60 per second)"); - uiDefButS(block, NUM, 0, "Dur",(short)(10+xco+(width-22)*0.4+10),(short)(yco-44),(short)((width-22)*0.4-10), 19, + uiDefButS(block, NUM, 0, "Dur", (short)(10+xco+(width-22)*0.4+10), (short)(yco-44), (short)((width-22)*0.4-10), 19, &ds->duration, 0.0, 5000.0, 0, 0, "If >0, delay in number of logic tics before the negative trigger following the positive trigger"); - uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP",(short)(xco + 10 + (width-22)*0.8),(short)(yco - 44), + uiDefButBitS(block, TOG, SENS_DELAY_REPEAT, 0, "REP", (short)(xco + 10 + (width-22)*0.8), (short)(yco - 44), (short)(0.20 * (width-22)), 19, &ds->flag, 0.0, 0.0, 0, 0, "Toggle repeat option. If selected, the sensor restarts after Delay+Dur logic tics"); yco-= ysize; @@ -1462,7 +1462,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short "Specify the type of event this mouse sensor should trigger on"); if (ms->type==32) { - uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse",(short)(xco + 10) + (width*0.8f)-20,(short)(yco - 44), + uiDefButBitS(block, TOG, SENS_MOUSE_FOCUS_PULSE, B_REDR, "Pulse", (short)(xco + 10) + (width*0.8f)-20, (short)(yco - 44), (short)(0.20 * (width-20)), 19, &ms->flag, 0.0, 0.0, 0, 0, "Moving the mouse over a different object generates a pulse"); } @@ -1481,7 +1481,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short randomSensor = sens->data; /* some files were wrongly written, avoid crash now */ if (randomSensor) { - uiDefButI(block, NUM, 1, "Seed: ", xco+10,yco-44,(width-20), 19, + uiDefButI(block, NUM, 1, "Seed: ", xco+10, yco-44, (width-20), 19, &randomSensor->seed, 0, 1000, 0, 0, "Initial seed of the generator. (Choose 0 for not random)"); } @@ -1499,7 +1499,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short /* 1. property or material */ uiDefButBitS(block, TOG, SENS_COLLISION_MATERIAL, B_REDR, "M/P", - xco + 10,yco - 44, 0.20 * (width-20), 19, + xco + 10, yco - 44, 0.20 * (width-20), 19, &raySens->mode, 0.0, 0.0, 0, 0, "Toggle collision on material or property"); @@ -1516,7 +1516,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short /* X-Ray option */ uiDefButBitS(block, TOG, SENS_RAY_XRAY, 1, "X", - xco + 10,yco - 68, 0.10 * (width-20), 19, + xco + 10, yco - 68, 0.10 * (width-20), 19, &raySens->mode, 0.0, 0.0, 0, 0, "Toggle X-Ray option (see through objects that don't have the property)"); /* 2. sensing range */ @@ -1612,7 +1612,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short &joy->axis, 1, 8.0, 100, 0, "Specify which axis pair to use, 1 is useually the main direction input"); - uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19, + uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20), yco-44, 0.4 * (width-20), 19, &joy->precision, 0, 32768.0, 100, 0, "Specify the precision of the axis"); @@ -1640,7 +1640,7 @@ static short draw_sensorbuttons(Object *ob, bSensor *sens, uiBlock *block, short &joy->axis_single, 1, 16.0, 100, 0, "Specify a single axis (verticle/horizontal/other) to detect"); - uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20),yco-44, 0.4 * (width-20), 19, + uiDefButI(block, NUM, 1, "Threshold:", xco+10 + 0.6 * (width-20), yco-44, 0.4 * (width-20), 19, &joy->precision, 0, 32768.0, 100, 0, "Specify the precision of the axis"); } @@ -1668,10 +1668,10 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - /* uiDefBut(block, LABEL, 1, "Not yet...", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, ""); */ + /* uiDefBut(block, LABEL, 1, "Not yet...", xco, yco-24, 80, 19, NULL, 0, 0, 0, 0, ""); */ ec= cont->data; - /* uiDefBut(block, BUT, 1, "Variables", xco,yco-24,80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */ - uiDefBut(block, TEX, 1, "Exp:", xco + 10 , yco-21, width-20, 19, + /* uiDefBut(block, BUT, 1, "Variables", xco, yco-24, 80, 19, NULL, 0, 0, 0, 0, "Available variables for expression"); */ + uiDefBut(block, TEX, 1, "Exp:", xco + 10, yco-21, width-20, 19, ec->str, 0, sizeof(ec->str), 0, 0, "Expression"); @@ -1689,11 +1689,11 @@ static short draw_controllerbuttons(bController *cont, uiBlock *block, short xco uiBlockBeginAlign(block); - uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4,yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)"); + uiDefButI(block, MENU, B_REDR, "Execution Method%t|Script%x0|Module%x1", xco+4, yco-23, 66, 19, &pc->mode, 0, 0, 0, 0, "Python script type (textblock or module - faster)"); if (pc->mode==0) - uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70,yco-23,width-74, 19, &pc->text, "Blender textblock to run as a script"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_TXT, 1, "", xco+70, yco-23, width-74, 19, &pc->text, "Blender textblock to run as a script"); else { - uiDefBut(block, TEX, 1, "", xco+70,yco-23,(width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); + uiDefBut(block, TEX, 1, "", xco+70, yco-23, (width-70)-25, 19, pc->module, 0, sizeof(pc->module), 0, 0, "Module name and function to run e.g. \"someModule.main\". Internal texts and external python files can be used"); uiDefButBitI(block, TOG, CONT_PY_DEBUG, B_REDR, "D", (xco+width)-25, yco-23, 19, 19, &pc->flag, 0, 0, 0, 0, "Continuously reload the module from disk for editing external modules without restarting"); } uiBlockEndAlign(block); @@ -1930,7 +1930,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiDefButBitS(block, TOG, ACT_LIN_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-129, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); uiDefButBitS(block, TOG, ACT_ANG_VEL_LOCAL, 0, "L", xco+45+3*wval, yco-148, 15, 19, &oa->flag, 0.0, 0.0, 0, 0, "Local transformation"); - uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "use_additive",xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); + uiDefButBitS(block, TOG, ACT_ADD_LIN_VEL, 0, "use_additive", xco+45+3*wval+15, yco-129, 35, 19, &oa->flag, 0.0, 0.0, 0, 0, "Toggles between ADD and SET linV"); } } else if (oa->type == ACT_OBJECT_SERVO) { @@ -2014,22 +2014,22 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo if (aa->type == ACT_ACTION_FROM_PROP) { - uiDefBut(block, TEX, 0, "Prop: ",xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position"); + uiDefBut(block, TEX, 0, "Prop: ", xco+10, yco-44, width-20, 19, aa->name, 0.0, MAX_NAME, 0, 0, "Use this property to define the Action position"); } else { - uiDefButF(block, NUM, 0, "Sta: ",xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame"); - uiDefButF(block, NUM, 0, "End: ",xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame"); + uiDefButF(block, NUM, 0, "Sta: ", xco+10, yco-44, (width-20)/2, 19, &aa->sta, 1.0, MAXFRAMEF, 0, 0, "Start frame"); + uiDefButF(block, NUM, 0, "End: ", xco+10+(width-20)/2, yco-44, (width-20)/2, 19, &aa->end, 1.0, MAXFRAMEF, 0, 0, "End frame"); } uiDefButS(block, NUM, 0, "Blendin: ", xco+10, yco-64, (width-20)/2, 19, &aa->blendin, 0.0, 32767, 0.0, 0.0, "Number of frames of motion blending"); uiDefButS(block, NUM, 0, "Priority: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); - uiDefBut(block, TEX, 0, "FrameProp: ",xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property"); + uiDefBut(block, TEX, 0, "FrameProp: ", xco+10, yco-84, width-20, 19, aa->frameProp, 0.0, MAX_NAME, 0, 0, "Assign the action's current frame number to this property"); #ifdef __NLA_ACTION_BY_MOTION_ACTUATOR if (aa->type == ACT_ACTION_MOTION) { - uiDefButF(block, NUM, 0, "Cycle: ",xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); + uiDefButF(block, NUM, 0, "Cycle: ", xco+30, yco-84, (width-60)/2, 19, &aa->stridelength, 0.0, 2500.0, 0, 0, "Distance covered by a single cycle of the action"); } #endif @@ -2109,9 +2109,9 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo pa= act->data; str= "Type%t|Assign%x0|Add %x1|Copy %x2|Toggle (bool/int/float/timer)%x3"; - uiDefButI(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &pa->type, 0, 31, 0, 0, "Type"); + uiDefButI(block, MENU, B_REDR, str, xco+30, yco-24, width-60, 19, &pa->type, 0, 31, 0, 0, "Type"); - uiDefBut(block, TEX, 1, "Prop: ", xco+30,yco-44,width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name"); + uiDefBut(block, TEX, 1, "Prop: ", xco+30, yco-44, width-60, 19, pa->name, 0, MAX_NAME, 0, 0, "Property name"); if (pa->type==ACT_PROP_TOGGLE) { @@ -2123,7 +2123,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo uiDefBut(block, TEX, 1, "Prop: ", xco+10+(width-20)/2, yco-64, (width-20)/2, 19, pa->value, 0, MAX_NAME, 0, 0, "Copy this property"); } else { - uiDefBut(block, TEX, 1, "Value: ", xco+30,yco-64,width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings"); + uiDefBut(block, TEX, 1, "Value: ", xco+30, yco-64, width-60, 19, pa->value, 0, MAX_NAME, 0, 0, "change with this value, use \"\" around strings"); } yco-= ysize; @@ -2147,20 +2147,20 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo IDnames_to_pupstring(&str, "Sound files", NULL, &(bmain->sound), (ID *)sa->sound, &(sa->sndnr)); /* reset this value, it is for handling the event */ sa->sndnr = 0; - uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10,yco-22,20,19, &(sa->sndnr), 0, 0, 0, 0, ""); + uiDefButS(block, MENU, B_SOUNDACT_BROWSE, str, xco+10, yco-22, 20, 19, &(sa->sndnr), 0, 0, 0, 0, ""); uiDefButO(block, BUT, "sound.open", 0, "Load Sound", xco+wval+10, yco-22, wval, 19, "Load a sound file (remember to set caching on for small sounds that are played often)"); if (sa->sound) { char dummy_str[] = "Sound mode %t|Play Stop %x0|Play End %x1|Loop Stop %x2|" "Loop End %x3|Loop Ping Pong Stop %x5|Loop Ping Pong %x4"; - uiDefBut(block, TEX, B_IDNAME, "SO:",xco+30,yco-22,wval-20,19, + uiDefBut(block, TEX, B_IDNAME, "SO:", xco+30, yco-22, wval-20, 19, ((ID *)sa->sound)->name+2, 0.0, MAX_ID_NAME-2, 0, 0, ""); - uiDefButS(block, MENU, 1, dummy_str,xco+10,yco-44,width-20, 19, + uiDefButS(block, MENU, 1, dummy_str, xco+10, yco-44, width-20, 19, &sa->type, 0.0, 0.0, 0, 0, ""); - uiDefButF(block, NUM, 0, "Volume:", xco+10,yco-66,wval, 19, &sa->volume, + uiDefButF(block, NUM, 0, "Volume:", xco+10, yco-66, wval, 19, &sa->volume, 0.0, 1.0, 0, 0, "Sets the volume of this sound"); - uiDefButF(block, NUM, 0, "Pitch:",xco+wval+10,yco-66,wval, 19, &sa->pitch,-12.0, + uiDefButF(block, NUM, 0, "Pitch:", xco+wval+10, yco-66, wval, 19, &sa->pitch, -12.0, 12.0, 0, 0, "Sets the pitch of this sound"); uiDefButS(block, TOG | BIT, 0, "3D Sound", xco+10, yco-88, width-20, 19, &sa->flag, 0.0, 1.0, 0.0, 0.0, "Plays the sound positioned in 3D space"); @@ -2531,8 +2531,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo ysize = 48; glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file"); -// uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation"); + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44, width-20, 19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this blend file, use the \"//\" prefix for a path relative to the current blend file"); +// 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) { @@ -2540,8 +2540,8 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo glRects(xco, yco-ysize, xco+width, yco); uiEmboss((float)xco, (float)yco-ysize, (float)xco+width, (float)yco, 1); - uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44,width-20,19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file"); - uiDefBut(block, TEX, 1, "Anim: ", xco+10, yco-64,width-20,19, &(gma->loadaniname), 0, sizeof(gma->loadaniname), 0, 0, "Use this loadinganimation"); + uiDefBut(block, TEX, 1, "File: ", xco+10, yco-44, width-20, 19, &(gma->filename), 0, sizeof(gma->filename), 0, 0, "Load this file"); + 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)) { @@ -2657,7 +2657,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo randAct = act->data; /* 1. seed */ - uiDefButI(block, NUM, 1, "Seed: ", (xco+10),yco-24, 0.4 *(width-20), 19, + uiDefButI(block, NUM, 1, "Seed: ", (xco+10), yco-24, 0.4 *(width-20), 19, &randAct->seed, 0, 1000, 0, 0, "Initial seed of the random generator. Use Python for more freedom. " " (Choose 0 for not random)"); @@ -2777,21 +2777,21 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo /* line 3: Text/Property */ uiDefButBitS(block, TOG, 1, B_REDR, "T/P", - (xco+10),(yco-(myline*24)), (0.20 * (width-20)), 19, + (xco+10), (yco-(myline*24)), (0.20 * (width-20)), 19, &ma->bodyType, 0.0, 0.0, 0, 0, "Toggle message type: either Text or a PropertyName"); if (ma->bodyType == ACT_MESG_MESG) { /* line 3: Message Body */ uiDefBut(block, TEX, 1, "Body: ", - (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, + (xco+10+(0.20*(width-20))), (yco-(myline++*24)), (0.8*(width-20)), 19, &ma->body, 0, MAX_NAME, 0, 0, "Optional message body Text"); } else { /* line 3: Property body (set by property) */ uiDefBut(block, TEX, 1, "Propname: ", - (xco+10+(0.20*(width-20))),(yco-(myline++*24)),(0.8*(width-20)),19, + (xco+10+(0.20*(width-20))), (yco-(myline++*24)), (0.8*(width-20)), 19, &ma->body, 0, MAX_NAME, 0, 0, "The message body will be set by the Property Value"); } @@ -2811,11 +2811,11 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo switch (tdfa->type) { case ACT_2DFILTER_MOTIONBLUR: if (!tdfa->flag) { - uiDefButS(block, TOG, B_REDR, "D", xco+30,yco-44,19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur"); - uiDefButF(block, NUM, B_REDR, "Value:", xco+52,yco-44,width-82,19,&tdfa->float_arg,0.0,1.0,0.0,0.0,"Set motion blur value"); + uiDefButS(block, TOG, B_REDR, "D", xco+30, yco-44, 19, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Disable Motion Blur"); + uiDefButF(block, NUM, B_REDR, "Value:", xco+52, yco-44, width-82, 19, &tdfa->float_arg, 0.0, 1.0, 0.0, 0.0, "Set motion blur value"); } else { - uiDefButS(block, TOG, B_REDR, "Disabled", xco+30,yco-44,width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur"); + uiDefButS(block, TOG, B_REDR, "Disabled", xco+30, yco-44, width-60, 19, &tdfa->flag, 0.0, 0.0, 0.0, 0.0, "Enable Motion Blur"); } break; case ACT_2DFILTER_BLUR: @@ -2831,18 +2831,18 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo case ACT_2DFILTER_NOFILTER: case ACT_2DFILTER_DISABLED: case ACT_2DFILTER_ENABLED: - uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set filter order"); + uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30, yco-44, width-60, 19, &tdfa->int_arg, 0.0, MAX_RENDER_PASS-1, 0.0, 0.0, "Set filter order"); break; case ACT_2DFILTER_CUSTOMFILTER: - uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30,yco-44,width-60,19,&tdfa->int_arg,0.0,MAX_RENDER_PASS-1,0.0,0.0,"Set filter order"); - uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30,yco-64,width-60, 19, &tdfa->text, ""); + uiDefButI(block, NUM, B_REDR, "Pass Number:", xco+30, yco-44, width-60, 19, &tdfa->int_arg, 0.0, MAX_RENDER_PASS-1, 0.0, 0.0, "Set filter order"); + uiDefIDPoinBut(block, test_scriptpoin_but, ID_SCRIPT, 1, "Script: ", xco+30, yco-64, width-60, 19, &tdfa->text, ""); break; } str= "2D Filter %t|Motion Blur %x1|Blur %x2|Sharpen %x3|Dilation %x4|Erosion %x5|" "Laplacian %x6|Sobel %x7|Prewitt %x8|Gray Scale %x9|Sepia %x10|Invert %x11|Custom Filter %x12|" "Enable Filter %x-2|Disable Filter %x-1|Remove Filter %x0|"; - uiDefButS(block, MENU, B_REDR, str, xco+30,yco-24,width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type"); + uiDefButS(block, MENU, B_REDR, str, xco+30, yco-24, width-60, 19, &tdfa->type, 0.0, 0.0, 0.0, 0.0, "2D filter type"); yco -= ysize; break; @@ -2912,7 +2912,7 @@ static short draw_actuatorbuttons(Main *bmain, Object *ob, bActuator *act, uiBlo ysize += 40; break; case ACT_ARM_SETWEIGHT: - uiDefButF(block, NUM, B_REDR, "Weight:", xco+5+(width-10)*0.35,yco-24,(width-10)*0.65,19,&armAct->weight,0.0,1.0,0.0,0.0,"Set weight of this constraint"); + uiDefButF(block, NUM, B_REDR, "Weight:", xco+5+(width-10)*0.35, yco-24, (width-10)*0.65, 19, &armAct->weight, 0.0, 1.0, 0.0, 0.0, "Set weight of this constraint"); break; } } @@ -3024,7 +3024,7 @@ static uiBlock *controller_menu(bContext *C, ARegion *ar, void *UNUSED(arg)) uiBlockSetButmFunc(block, do_controller_menu, NULL); uiDefBut(block, BUTM, 1, "Show Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 0, ""); - uiDefBut(block, BUTM, 1, "Hide Objects", 0,(short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); + uiDefBut(block, BUTM, 1, "Hide Objects", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 1, 1, ""); uiDefBut(block, SEPR, 0, "", 0, (short)(yco-=6), 160, 6, NULL, 0.0, 0.0, 0, 0, ""); uiDefBut(block, BUTM, 1, "Show Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 2, 2, ""); uiDefBut(block, BUTM, 1, "Hide Controllers", 0, (short)(yco-=20), 160, 19, NULL, 0.0, 0.0, 3, 3, ""); @@ -3846,7 +3846,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext uiLayoutSetActive(sub, RNA_boolean_get(ptr, "use_force_distance")==1); uiItemR(sub, ptr, "distance", 0, "", ICON_NONE); - uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE); + uiItemR(layout, ptr, "damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE); split = uiLayoutSplit(layout, 0.15, 0); uiItemR(split, ptr, "use_material_detect", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); @@ -3867,7 +3867,7 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext uiItemR(layout, ptr, "direction_axis_pos", 0, NULL, ICON_NONE); row=uiLayoutRow(layout, 1); - uiItemR(row, ptr, "damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE); + uiItemR(row, ptr, "damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "time", 0, NULL, ICON_NONE); row=uiLayoutRow(layout, 0); @@ -3881,16 +3881,16 @@ static void draw_actuator_constraint(uiLayout *layout, PointerRNA *ptr, bContext case ACT_CONST_TYPE_FH: split=uiLayoutSplit(layout, 0.75, 0); row= uiLayoutRow(split, 0); - uiItemR(row, ptr, "fh_damping", UI_ITEM_R_SLIDER , NULL, ICON_NONE); + uiItemR(row, ptr, "fh_damping", UI_ITEM_R_SLIDER, NULL, ICON_NONE); uiItemR(row, ptr, "fh_height", 0, NULL, ICON_NONE); - uiItemR(split, ptr, "use_fh_paralel_axis", UI_ITEM_R_TOGGLE , NULL, ICON_NONE); + uiItemR(split, ptr, "use_fh_paralel_axis", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "direction_axis", 0, NULL, ICON_NONE); split = uiLayoutSplit(row, 0.9, 0); uiItemR(split, ptr, "fh_force", 0, NULL, ICON_NONE); - uiItemR(split, ptr, "use_fh_normal", UI_ITEM_R_TOGGLE , NULL, ICON_NONE); + uiItemR(split, ptr, "use_fh_normal", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); split = uiLayoutSplit(layout, 0.15, 0); uiItemR(split, ptr, "use_material_detect", UI_ITEM_R_TOGGLE, NULL, ICON_NONE); @@ -4549,7 +4549,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) uiItemR(split, &settings_ptr, "show_state_panel", UI_ITEM_R_NO_BG, "", ICON_DISCLOSURE_TRI_RIGHT); row = uiLayoutRow(split, 1); - uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers"); + uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide controllers"); if (ob == act_ob) uiItemMenuEnumO(row, "LOGIC_OT_controller_add", "type", "Add Controller", ICON_NONE); @@ -4644,7 +4644,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) if ((ob->scavisflag & OB_VIS_SENS) == 0) continue; row = uiLayoutRow(layout, 1); - uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); + uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); if (ob == act_ob) uiItemMenuEnumO(row, "LOGIC_OT_sensor_add", "type", "Add Sensor", ICON_NONE); @@ -4710,7 +4710,7 @@ static void logic_buttons_new(bContext *C, ARegion *ar) if ( (ob->scavisflag & OB_VIS_ACT) == 0) continue; row = uiLayoutRow(layout, 1); - uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); + uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); if (ob == act_ob) uiItemMenuEnumO(row, "LOGIC_OT_actuator_add", "type", "Add Actuator", ICON_NONE); @@ -4839,9 +4839,9 @@ void logic_buttons(bContext *C, ARegion *ar) /* presume it is only objects for now */ uiBlockBeginAlign(block); // if (ob->controllers.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name"); + uiDefButBitS(block, TOG, OB_SHOWCONT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Active Object name"); // if (ob->controllers.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); + uiDefButBitS(block, TOG, OB_ADDCONT, B_ADD_CONT, "Add", (short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Controller"); uiBlockEndAlign(block); yco-=20; @@ -4878,9 +4878,9 @@ void logic_buttons(bContext *C, ARegion *ar) } } uiBlockBeginAlign(block); - uiDefButBitS(block, TOG, OB_ALLSTATE, B_SET_STATE_BIT, "All",(short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); - uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini",(short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); - uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D",(short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info"); + uiDefButBitS(block, TOG, OB_ALLSTATE, B_SET_STATE_BIT, "All", (short)(xco+226), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set all state bits"); + uiDefButBitS(block, TOG, OB_INITSTBIT, B_INIT_STATE_BIT, "Ini", (short)(xco+248), yco-10, 22, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Set the initial state"); + uiDefButBitS(block, TOG, OB_DEBUGSTATE, 0, "D", (short)(xco+270), yco-10, 15, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Print state debug info"); uiBlockEndAlign(block); yco-=35; @@ -4913,7 +4913,7 @@ void logic_buttons(bContext *C, ARegion *ar) if (cont->flag & CONT_SHOW) { cont->otype= cont->type; - uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(),(short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type"); + uiDefButS(block, MENU, B_CHANGE_CONT, controller_pup(), (short)(xco+22), yco, 70, UI_UNIT_Y, &cont->type, 0, 0, 0, 0, "Controller type"); but = uiDefBut(block, TEX, 1, "", (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont->name, 0, MAX_NAME, 0, 0, "Controller name"); uiButSetFunc(but, make_unique_prop_names_cb, cont->name, (void*) 0); @@ -4923,10 +4923,10 @@ void logic_buttons(bContext *C, ARegion *ar) } else { cpack(0x999999); - glRecti(xco+22, yco, xco+width-22,yco+19); + glRecti(xco+22, yco, xco+width-22, yco+19); but = uiDefBut(block, LABEL, 0, controller_name(cont->type), (short)(xco+22), yco, 70, UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller type"); //uiButSetFunc(but, old_sca_move_controller, cont, NULL); - but = uiDefBut(block, LABEL, 0, cont->name,(short)(xco+92), yco,(short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); + but = uiDefBut(block, LABEL, 0, cont->name, (short)(xco+92), yco, (short)(width-158), UI_UNIT_Y, cont, 0, 0, 0, 0, "Controller name"); //uiButSetFunc(but, old_sca_move_controller, cont, NULL); uiBlockBeginAlign(block); @@ -4942,7 +4942,7 @@ void logic_buttons(bContext *C, ARegion *ar) but = uiDefIconBut(block, LINK, 0, ICON_LINK, (short)(xco+width), ycoo, UI_UNIT_X, UI_UNIT_Y, NULL, 0, 0, 0, 0, ""); uiSetButLink(but, NULL, (void ***)&(cont->links), &cont->totlinks, LINK_CONTROLLER, LINK_ACTUATOR); - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, ""); + uiDefIconBut(block, INLINK, 0, ICON_INLINK, (short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, cont, LINK_CONTROLLER, 0, 0, 0, ""); /* offset is >0 if at least one controller was displayed */ offset++; yco-=20; @@ -4977,9 +4977,9 @@ void logic_buttons(bContext *C, ARegion *ar) /* presume it is only objects for now */ uiBlockBeginAlign(block); // if (ob->sensors.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2,(short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); + uiDefButBitS(block, TOG, OB_SHOWSENS, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide sensors"); // if (ob->sensors.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); + uiDefButBitS(block, TOG, OB_ADDSENS, B_ADD_SENS, "Add", (short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Sensor"); uiBlockEndAlign(block); yco-=20; @@ -5014,7 +5014,7 @@ void logic_buttons(bContext *C, ARegion *ar) } else { set_col_sensor(sens->type, 1); - glRecti(xco+22, yco, xco+width-22,yco+19); + glRecti(xco + 22, yco, xco + width - 22, yco + 19); but = uiDefBut(block, LABEL, 0, sensor_name(sens->type), (short)(xco+22), yco, 80, UI_UNIT_Y, sens, 0, 0, 0, 0, ""); //uiButSetFunc(but, old_sca_move_sensor, sens, NULL); but = uiDefBut(block, LABEL, 0, sens->name, (short)(xco+102), yco, (short)(width-(pin?146:124)), UI_UNIT_Y, sens, 0, MAX_NAME, 0, 0, ""); @@ -5057,9 +5057,9 @@ void logic_buttons(bContext *C, ARegion *ar) /* presume it is only objects for now */ uiBlockBeginAlign(block); // if (ob->actuators.first) uiSetCurFont(block, UI_HELVB); - uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2,(short)(xco-10), yco,(short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); + uiDefButBitS(block, TOG, OB_SHOWACT, B_REDR, ob->id.name+2, (short)(xco-10), yco, (short)(width-30), UI_UNIT_Y, &ob->scaflag, 0, 31, 0, 0, "Object name, click to show/hide actuators"); // if (ob->actuators.first) uiSetCurFont(block, UI_HELV); - uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add",(short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator"); + uiDefButBitS(block, TOG, OB_ADDACT, B_ADD_ACT, "Add", (short)(xco+width-40), yco, 50, UI_UNIT_Y, &ob->scaflag, 0, 0, 0, 0, "Add a new Actuator"); uiBlockEndAlign(block); yco-=20; @@ -5092,7 +5092,7 @@ void logic_buttons(bContext *C, ARegion *ar) } else { set_col_actuator(act->type, 1); - glRecti((short)(xco+22), yco, (short)(xco+width-22),(short)(yco+19)); + glRecti((short)(xco+22), yco, (short)(xco+width-22), (short)(yco+19)); /* but= */ uiDefBut(block, LABEL, 0, actuator_name(act->type), (short)(xco+22), yco, 90, UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator type"); // uiButSetFunc(but, old_sca_move_actuator, act, NULL); /* but= */ uiDefBut(block, LABEL, 0, act->name, (short)(xco+112), yco, (short)(width-(pin?156:134)), UI_UNIT_Y, act, 0, 0, 0, 0, "Actuator name"); @@ -5108,7 +5108,7 @@ void logic_buttons(bContext *C, ARegion *ar) ycoo= yco; } - uiDefIconBut(block, INLINK, 0, ICON_INLINK,(short)(xco-19), ycoo, UI_UNIT_X, UI_UNIT_Y, act, LINK_ACTUATOR, 0, 0, 0, ""); + uiDefIconBut(block, INLINK, 0, ICON_INLINK, (short)(xco - 19), ycoo, UI_UNIT_X, UI_UNIT_Y, act, LINK_ACTUATOR, 0, 0, 0, ""); yco-=20; } diff --git a/source/blender/editors/space_nla/nla_channels.c b/source/blender/editors/space_nla/nla_channels.c index 1d323cb6a4f..38f9a83143e 100644 --- a/source/blender/editors/space_nla/nla_channels.c +++ b/source/blender/editors/space_nla/nla_channels.c @@ -211,7 +211,7 @@ static int mouse_nla_channels (bAnimContext *ac, float x, int channel_index, sho /* offset for start of channel (on LHS of channel-list) */ if (ale->id) { /* special exception for materials and particles */ - if (ELEM(GS(ale->id->name),ID_MA,ID_PA)) + if (ELEM(GS(ale->id->name), ID_MA, ID_PA)) offset= 21 + NLACHANNEL_BUTTON_WIDTH; else offset= 14; diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c index 91ece361aac..d37a2dc0e5e 100644 --- a/source/blender/editors/space_node/drawnode.c +++ b/source/blender/editors/space_node/drawnode.c @@ -266,7 +266,7 @@ static void node_draw_socket_new(bNodeSocket *sock, float size) /* 16 values of sin function */ static float si[16] = { - 0.00000000f, 0.39435585f,0.72479278f,0.93775213f, + 0.00000000f, 0.39435585f, 0.72479278f,0.93775213f, 0.99871650f,0.89780453f,0.65137248f,0.29936312f, -0.10116832f,-0.48530196f,-0.79077573f,-0.96807711f, -0.98846832f,-0.84864425f,-0.57126821f,-0.20129852f @@ -1647,7 +1647,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) uiLayout *row, *col; uiItemL(layout, "Despill Channel:", ICON_NONE); - row = uiLayoutRow(layout,0); + row = uiLayoutRow(layout, 0); uiItemR(row, ptr, "channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); col= uiLayoutColumn(layout, 0); @@ -1655,7 +1655,7 @@ static void node_composit_buts_color_spill(uiLayout *layout, bContext *UNUSED(C) if (RNA_enum_get(ptr, "limit_method")==0) { uiItemL(col, "Limiting Channel:", ICON_NONE); - row=uiLayoutRow(col,0); + row=uiLayoutRow(col, 0); uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } @@ -1710,7 +1710,7 @@ static void node_composit_buts_channel_matte(uiLayout *layout, bContext *UNUSED( uiItemR(col, ptr, "limit_method", 0, NULL, ICON_NONE); if (RNA_enum_get(ptr, "limit_method")==0) { uiItemL(col, "Limiting Channel:", ICON_NONE); - row=uiLayoutRow(col,0); + row=uiLayoutRow(col, 0); uiItemR(row, ptr, "limit_channel", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } diff --git a/source/blender/editors/space_node/node_draw.c b/source/blender/editors/space_node/node_draw.c index 040f921b6ac..c8bc2104d73 100644 --- a/source/blender/editors/space_node/node_draw.c +++ b/source/blender/editors/space_node/node_draw.c @@ -459,17 +459,17 @@ static void node_circle_draw(float x, float y, float size, char *col, int highli { /* 16 values of sin function */ static float si[16] = { - 0.00000000f, 0.39435585f,0.72479278f,0.93775213f, - 0.99871650f,0.89780453f,0.65137248f,0.29936312f, - -0.10116832f,-0.48530196f,-0.79077573f,-0.96807711f, - -0.98846832f,-0.84864425f,-0.57126821f,-0.20129852f + 0.00000000f, 0.39435585f, 0.72479278f, 0.93775213f, + 0.99871650f, 0.89780453f, 0.65137248f, 0.29936312f, + -0.10116832f, -0.48530196f, -0.79077573f, -0.96807711f, + -0.98846832f, -0.84864425f, -0.57126821f, -0.20129852f }; /* 16 values of cos function */ static float co[16] ={ - 1.00000000f,0.91895781f,0.68896691f,0.34730525f, - -0.05064916f,-0.44039415f,-0.75875812f,-0.95413925f, - -0.99486932f,-0.87434661f,-0.61210598f,-0.25065253f, - 0.15142777f,0.52896401f,0.82076344f,0.97952994f, + 1.00000000f, 0.91895781f, 0.68896691f, 0.34730525f, + -0.05064916f, -0.44039415f, -0.75875812f, -0.95413925f, + -0.99486932f, -0.87434661f, -0.61210598f, -0.25065253f, + 0.15142777f, 0.52896401f, 0.82076344f, 0.97952994f, }; int a; diff --git a/source/blender/editors/space_node/node_select.c b/source/blender/editors/space_node/node_select.c index 4df60e6eede..a540f18b3a5 100644 --- a/source/blender/editors/space_node/node_select.c +++ b/source/blender/editors/space_node/node_select.c @@ -517,7 +517,7 @@ static int node_select_invoke(bContext *C, wmOperator *op, wmEvent *event) RNA_int_set(op->ptr, "mouse_x", event->mval[0]); RNA_int_set(op->ptr, "mouse_y", event->mval[1]); - return node_select_exec(C,op); + return node_select_exec(C, op); } diff --git a/source/blender/editors/space_outliner/outliner_draw.c b/source/blender/editors/space_outliner/outliner_draw.c index 7b2bbf3e285..52089c87f61 100644 --- a/source/blender/editors/space_outliner/outliner_draw.c +++ b/source/blender/editors/space_outliner/outliner_draw.c @@ -77,7 +77,7 @@ static void outliner_height(SpaceOops *soops, ListBase *lb, int *h) TreeElement *te= lb->first; while (te) { TreeStoreElem *tselem= TREESTORE(te); - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) outliner_height(soops, &te->subtree, h); (*h) += UI_UNIT_Y; te= te->next; @@ -92,7 +92,7 @@ static void outliner_width(SpaceOops *soops, ListBase *lb, int *w) // TreeStoreElem *tselem= TREESTORE(te); // XXX fixme... te->xend is not set yet - if (!TSELEM_OPEN(tselem,soops)) { + if (!TSELEM_OPEN(tselem, soops)) { if (te->xend > *w) *w = te->xend; } @@ -117,7 +117,7 @@ static void outliner_rna_width(SpaceOops *soops, ListBase *lb, int *w, int start if (startx+100 > *w) *w = startx+100; - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) outliner_rna_width(soops, &te->subtree, w, startx+UI_UNIT_X); te= te->next; } @@ -505,7 +505,7 @@ static void outliner_draw_restrictbuts(uiBlock *block, Scene *scene, ARegion *ar } } - if (TSELEM_OPEN(tselem,soops)) outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree); + if (TSELEM_OPEN(tselem, soops)) outliner_draw_restrictbuts(block, scene, ar, soops, &te->subtree); } } @@ -546,7 +546,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa ptr= &te->rnaptr; prop= te->directdata; - if (!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem,soops))) ) + if (!(RNA_property_type(prop) == PROP_POINTER && (TSELEM_OPEN(tselem, soops))) ) uiDefAutoButR(block, ptr, prop, -1, "", ICON_NONE, sizex, (int)te->ys, OL_RNA_COL_SIZEX, UI_UNIT_Y-1); } else if (tselem->type == TSE_RNA_ARRAY_ELEM) { @@ -557,7 +557,7 @@ static void outliner_draw_rnabuts(uiBlock *block, Scene *scene, ARegion *ar, Spa } } - if (TSELEM_OPEN(tselem,soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree); + if (TSELEM_OPEN(tselem, soops)) outliner_draw_rnabuts(block, scene, ar, soops, sizex, &te->subtree); } } @@ -783,7 +783,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo break; case OL_KM_MOUSE: str= keymap_mouse_menu(); - uiDefButS(block, MENU, 0, str, xstart,(int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->type, 0, 0, 0, 0, "Mouse button"); + uiDefButS(block, MENU, 0, str, xstart, (int)te->ys+1, butw2, UI_UNIT_Y-1, &kmi->type, 0, 0, 0, 0, "Mouse button"); xstart+= butw2+5; break; case OL_KM_TWEAK: @@ -814,7 +814,7 @@ static void outliner_draw_keymapbuts(uiBlock *block, ARegion *ar, SpaceOops *soo } } - if (TSELEM_OPEN(tselem,soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree); + if (TSELEM_OPEN(tselem, soops)) outliner_draw_keymapbuts(block, ar, soops, &te->subtree); } } @@ -857,7 +857,7 @@ static void outliner_buttons(const bContext *C, uiBlock *block, ARegion *ar, Spa } } - if (TSELEM_OPEN(tselem,soops)) outliner_buttons(C, block, ar, soops, &te->subtree); + if (TSELEM_OPEN(tselem, soops)) outliner_buttons(C, block, ar, soops, &te->subtree); } } @@ -1332,7 +1332,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene icon_x = startx+5*ufac; // icons a bit higher - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) UI_icon_draw((float)icon_x, (float)*starty+2*ufac, ICON_DISCLOSURE_TRI_DOWN); else UI_icon_draw((float)icon_x, (float)*starty+2*ufac, ICON_DISCLOSURE_TRI_RIGHT); @@ -1371,7 +1371,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene offsx+= (int)(UI_UNIT_X + UI_GetStringWidth(te->name)); /* closed item, we draw the icons, not when it's a scene, or master-server list though */ - if (!TSELEM_OPEN(tselem,soops)) { + if (!TSELEM_OPEN(tselem, soops)) { if (te->subtree.first) { if (tselem->type==0 && te->idcode==ID_SCE); else if (tselem->type!=TSE_R_LAYER) { /* this tree element always has same amount of branches, so don't draw */ @@ -1397,7 +1397,7 @@ static void outliner_draw_tree_element(bContext *C, uiBlock *block, Scene *scene te->ys= (float)*starty; te->xend= startx+offsx; - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { *starty-= UI_UNIT_Y; for (ten= te->subtree.first; ten; ten= ten->next) @@ -1430,7 +1430,7 @@ static void outliner_draw_hierarchy(SpaceOops *soops, ListBase *lb, int startx, *starty-= UI_UNIT_Y; - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) outliner_draw_hierarchy(soops, &te->subtree, startx+UI_UNIT_X, starty); } @@ -1454,12 +1454,12 @@ static void outliner_draw_struct_marks(ARegion *ar, SpaceOops *soops, ListBase * tselem= TREESTORE(te); /* selection status */ - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) if (tselem->type == TSE_RNA_STRUCT) glRecti(0, *starty+1, (int)ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, *starty+UI_UNIT_Y-1); *starty-= UI_UNIT_Y; - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { outliner_draw_struct_marks(ar, soops, &te->subtree, starty); if (tselem->type == TSE_RNA_STRUCT) fdrawline(0, (float)*starty+UI_UNIT_Y, ar->v2d.cur.xmax+V2D_SCROLL_WIDTH, (float)*starty+UI_UNIT_Y); @@ -1480,7 +1480,7 @@ static void outliner_draw_selection(ARegion *ar, SpaceOops *soops, ListBase *lb, glRecti(0, *starty+1, (int)ar->v2d.cur.xmax, *starty+UI_UNIT_Y-1); } *starty-= UI_UNIT_Y; - if (TSELEM_OPEN(tselem,soops)) outliner_draw_selection(ar, soops, &te->subtree, starty); + if (TSELEM_OPEN(tselem, soops)) outliner_draw_selection(ar, soops, &te->subtree, starty); } } diff --git a/source/blender/editors/space_outliner/outliner_edit.c b/source/blender/editors/space_outliner/outliner_edit.c index 62d93f62d0f..7b200e9593d 100644 --- a/source/blender/editors/space_outliner/outliner_edit.c +++ b/source/blender/editors/space_outliner/outliner_edit.c @@ -652,7 +652,7 @@ static void outliner_set_coordinates_element(SpaceOops *soops, TreeElement *te, te->ys= (float)(*starty); *starty-= UI_UNIT_Y; - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { TreeElement *ten; for (ten= te->subtree.first; ten; ten= ten->next) { outliner_set_coordinates_element(soops, ten, startx+UI_UNIT_X, starty); @@ -875,7 +875,7 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOops *soops, ListBase } else tselem->flag |= TSE_CLOSED; - if (TSELEM_OPEN(tselem,soops)) tree_element_show_hierarchy(scene, soops, &te->subtree); + if (TSELEM_OPEN(tselem, soops)) tree_element_show_hierarchy(scene, soops, &te->subtree); } } @@ -1140,7 +1140,7 @@ static void do_outliner_drivers_editop(SpaceOops *soops, ListBase *tree, ReportL } /* go over sub-tree */ - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) do_outliner_drivers_editop(soops, &te->subtree, reports, mode); } } @@ -1308,7 +1308,7 @@ static void do_outliner_keyingset_editop(SpaceOops *soops, KeyingSet *ks, ListBa } /* go over sub-tree */ - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) do_outliner_keyingset_editop(soops, ks, &te->subtree, mode); } } diff --git a/source/blender/editors/space_outliner/outliner_select.c b/source/blender/editors/space_outliner/outliner_select.c index 5515ec45269..00b3979b074 100644 --- a/source/blender/editors/space_outliner/outliner_select.c +++ b/source/blender/editors/space_outliner/outliner_select.c @@ -99,7 +99,7 @@ static int outliner_select(SpaceOops *soops, ListBase *lb, int *index, short *se change |= 1; } } - else if (TSELEM_OPEN(tselem,soops)) { + else if (TSELEM_OPEN(tselem, soops)) { /* Only try selecting sub-elements if we haven't hit the right element yet * * Hack warning: diff --git a/source/blender/editors/space_outliner/outliner_tools.c b/source/blender/editors/space_outliner/outliner_tools.c index 13e86209f3a..88e3bac7910 100644 --- a/source/blender/editors/space_outliner/outliner_tools.c +++ b/source/blender/editors/space_outliner/outliner_tools.c @@ -115,9 +115,9 @@ static void set_operation_types(SpaceOops *soops, ListBase *lb, } } } - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { set_operation_types(soops, &te->subtree, - scenelevel, objectlevel, idlevel, datalevel); + scenelevel, objectlevel, idlevel, datalevel); } } } @@ -230,7 +230,7 @@ static void outliner_do_libdata_operation(bContext *C, Scene *scene, SpaceOops * operation_cb(C, scene, te, tsep, tselem); } } - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { outliner_do_libdata_operation(C, scene, soops, &te->subtree, operation_cb); } } @@ -388,7 +388,7 @@ void outliner_do_object_operation(bContext *C, Scene *scene_act, SpaceOops *soop operation_cb(C, scene_owner ? scene_owner : scene_act, te, NULL, tselem); } } - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { outliner_do_object_operation(C, scene_act, soops, &te->subtree, operation_cb); } } @@ -495,7 +495,7 @@ static void outliner_do_data_operation(SpaceOops *soops, int type, int event, Li operation_cb(event, te, tselem); } } - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { outliner_do_data_operation(soops, type, event, &te->subtree, operation_cb); } } @@ -870,7 +870,7 @@ static void outliner_do_id_set_operation(SpaceOops *soops, int type, ListBase *l operation_cb(te, tselem, tsep, newid); } } - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { outliner_do_id_set_operation(soops, type, &te->subtree, newid, operation_cb); } } diff --git a/source/blender/editors/space_outliner/outliner_tree.c b/source/blender/editors/space_outliner/outliner_tree.c index e2d43386c5e..026132e1f16 100644 --- a/source/blender/editors/space_outliner/outliner_tree.c +++ b/source/blender/editors/space_outliner/outliner_tree.c @@ -538,7 +538,7 @@ static void outliner_add_object_contents(SpaceOops *soops, TreeElement *te, Tree int index; temod->name = "Modifiers"; - for (index=0,md=ob->modifiers.first; md; index++,md=md->next) { + for (index=0, md=ob->modifiers.first; md; index++, md=md->next) { TreeElement *te = outliner_add_element(soops, &temod->subtree, ob, temod, TSE_MODIFIER, index); te->name= md->name; te->directdata = md; @@ -956,7 +956,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i te->name= RNA_struct_ui_name(ptr->type); /* If searching don't expand RNA entries */ - if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH; + if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA", te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH; iterprop= RNA_struct_iterator_property(ptr->type); tot= RNA_property_collection_length(ptr, iterprop); @@ -966,7 +966,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i if (!tselem->used) tselem->flag &= ~TSE_CLOSED; - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { for (a=0; a<tot; a++) outliner_add_element(soops, &te->subtree, (void*)ptr, te, TSE_RNA_PROPERTY, a); } @@ -988,13 +988,13 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i te->rnaptr= *ptr; /* If searching don't expand RNA entries */ - if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA",te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH; + if (SEARCHING_OUTLINER(soops) && BLI_strcasecmp("RNA", te->name)==0) tselem->flag &= ~TSE_CHILDSEARCH; if (proptype == PROP_POINTER) { pptr= RNA_property_pointer_get(ptr, prop); if (pptr.data) { - if (TSELEM_OPEN(tselem,soops)) + if (TSELEM_OPEN(tselem, soops)) outliner_add_element(soops, &te->subtree, (void*)&pptr, te, TSE_RNA_STRUCT, -1); else te->flag |= TE_LAZY_CLOSED; @@ -1003,7 +1003,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i else if (proptype == PROP_COLLECTION) { tot= RNA_property_collection_length(ptr, prop); - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { for (a=0; a<tot; a++) { RNA_property_collection_lookup_int(ptr, prop, a, &pptr); outliner_add_element(soops, &te->subtree, (void*)&pptr, te, TSE_RNA_STRUCT, a); @@ -1015,7 +1015,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i else if (ELEM3(proptype, PROP_BOOLEAN, PROP_INT, PROP_FLOAT)) { tot= RNA_property_array_length(ptr, prop); - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { for (a=0; a<tot; a++) outliner_add_element(soops, &te->subtree, (void*)ptr, te, TSE_RNA_ARRAY_ELEM, a); } @@ -1048,7 +1048,7 @@ static TreeElement *outliner_add_element(SpaceOops *soops, ListBase *lb, void *i te->directdata= idv; te->name= km->idname; - if (TSELEM_OPEN(tselem,soops)) { + if (TSELEM_OPEN(tselem, soops)) { a= 0; for (kmi = km->items.first; kmi; kmi = kmi->next, a++) { @@ -1351,7 +1351,7 @@ static int outliner_filter_tree(SpaceOops *soops, ListBase *lb) /* flag as not a found item */ tselem->flag &= ~TSE_SEARCHMATCH; - if ((!TSELEM_OPEN(tselem,soops)) || outliner_filter_tree(soops, &te->subtree)==0) { + if ((!TSELEM_OPEN(tselem, soops)) || outliner_filter_tree(soops, &te->subtree)==0) { outliner_free_tree(&te->subtree); BLI_remlink(lb, te); diff --git a/source/blender/editors/space_sequencer/sequencer_intern.h b/source/blender/editors/space_sequencer/sequencer_intern.h index c40a809e6af..e63a3052d26 100644 --- a/source/blender/editors/space_sequencer/sequencer_intern.h +++ b/source/blender/editors/space_sequencer/sequencer_intern.h @@ -51,7 +51,7 @@ struct ARegion *sequencer_has_buttons_region(struct ScrArea *sa); /* sequencer_draw.c */ void draw_timeline_seq(const struct bContext *C, struct ARegion *ar); -void draw_image_seq(const struct bContext* C, struct Scene *scene,struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset); +void draw_image_seq(const struct bContext* C, struct Scene *scene, struct ARegion *ar, struct SpaceSeq *sseq, int cfra, int offset); void seq_reset_imageofs(struct SpaceSeq *sseq); diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index 6d810d9103c..13129616843 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -333,7 +333,7 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Y:", 0, yi -= buth, 200, buth, &(tfp->ve_median[1]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); - but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:",0, yi -= buth, 200, buth, + but = uiDefButF(block, NUM, B_OBJECTPANELMEDIAN, "Z:", 0, yi -= buth, 200, buth, &(tfp->ve_median[2]), -lim, lim, 10, RNA_TRANSLATION_PREC_DEFAULT, ""); uiButSetUnitType(but, PROP_UNIT_LENGTH); diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index fd21bd1922f..6d72ca99678 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -1189,12 +1189,12 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) size = -size; case RIGHT: glBegin(GL_LINES); - glVertex2s( offset, 0); - glVertex2s( offset + length, 0); - glVertex2s( offset + length, 0); - glVertex2s( offset + length - size, -size); - glVertex2s( offset + length, 0); - glVertex2s( offset + length - size, size); + glVertex2s(offset, 0); + glVertex2s(offset + length, 0); + glVertex2s(offset + length, 0); + glVertex2s(offset + length - size, -size); + glVertex2s(offset + length, 0); + glVertex2s(offset + length - size, size); glEnd(); break; case DOWN: @@ -1203,12 +1203,12 @@ static void drawArrow(ArrowDirection d, short offset, short length, short size) size = -size; case UP: glBegin(GL_LINES); - glVertex2s( 0, offset); - glVertex2s( 0, offset + length); - glVertex2s( 0, offset + length); + glVertex2s(0, offset); + glVertex2s(0, offset + length); + glVertex2s(0, offset + length); glVertex2s(-size, offset + length - size); - glVertex2s( 0, offset + length); - glVertex2s( size, offset + length - size); + glVertex2s(0, offset + length); + glVertex2s(size, offset + length - size); glEnd(); break; } @@ -1221,20 +1221,20 @@ static void drawArrowHead(ArrowDirection d, short size) size = -size; case RIGHT: glBegin(GL_LINES); - glVertex2s( 0, 0); - glVertex2s( -size, -size); - glVertex2s( 0, 0); - glVertex2s( -size, size); + glVertex2s(0, 0); + glVertex2s(-size, -size); + glVertex2s(0, 0); + glVertex2s(-size, size); glEnd(); break; case DOWN: size = -size; case UP: glBegin(GL_LINES); - glVertex2s( 0, 0); + glVertex2s(0, 0); glVertex2s(-size, -size); - glVertex2s( 0, 0); - glVertex2s( size, -size); + glVertex2s(0, 0); + glVertex2s(size, -size); glEnd(); break; } @@ -1248,9 +1248,9 @@ static void drawArc(float size, float angle_start, float angle_end, int segments glBegin(GL_LINE_STRIP); for ( angle = angle_start; angle < angle_end; angle += delta) { - glVertex2f( cosf(angle) * size, sinf(angle) * size); + glVertex2f(cosf(angle) * size, sinf(angle) * size); } - glVertex2f( cosf(angle_end) * size, sinf(angle_end) * size); + glVertex2f(cosf(angle_end) * size, sinf(angle_end) * size); glEnd(); } @@ -1943,8 +1943,8 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl /* axis-angle get limited with euler... */ float eul[3], oldeul[3]; - axis_angle_to_eulO( eul, EULER_ORDER_DEFAULT,axis, *angle); - axis_angle_to_eulO( oldeul, EULER_ORDER_DEFAULT,oldAxis, oldAngle); + axis_angle_to_eulO(eul, EULER_ORDER_DEFAULT, axis, *angle); + axis_angle_to_eulO(oldeul, EULER_ORDER_DEFAULT, oldAxis, oldAngle); if (protectflag & OB_LOCK_ROTX) eul[0]= oldeul[0]; @@ -1953,7 +1953,7 @@ static void protectedAxisAngleBits(short protectflag, float axis[3], float *angl if (protectflag & OB_LOCK_ROTZ) eul[2]= oldeul[2]; - eulO_to_axis_angle( axis, angle,eul, EULER_ORDER_DEFAULT); + eulO_to_axis_angle(axis, angle, eul, EULER_ORDER_DEFAULT); /* when converting to axis-angle, we need a special exception for the case when there is no axis */ if (IS_EQF(axis[0], axis[1]) && IS_EQF(axis[1], axis[2])) { @@ -1999,7 +1999,7 @@ static void protectedQuaternionBits(short protectflag, float *quat, float *oldqu if (protectflag & OB_LOCK_ROTZ) eul[2]= oldeul[2]; - eul_to_quat( quat,eul); + eul_to_quat(quat, eul); /* restore original quat size */ mul_qt_fl(quat, qlen); @@ -2175,15 +2175,15 @@ static void constraintRotLim(TransInfo *UNUSED(t), TransData *td) /* copy results from cob->matrix */ if (td->ext->rotOrder == ROT_MODE_QUAT) { /* quats */ - mat4_to_quat( td->ext->quat,cob.matrix); + mat4_to_quat(td->ext->quat, cob.matrix); } else if (td->ext->rotOrder == ROT_MODE_AXISANGLE) { /* axis angle */ - mat4_to_axis_angle( &td->ext->quat[1], &td->ext->quat[0],cob.matrix); + mat4_to_axis_angle(&td->ext->quat[1], &td->ext->quat[0], cob.matrix); } else { /* eulers */ - mat4_to_eulO( td->ext->rot, td->ext->rotOrder,cob.matrix); + mat4_to_eulO(td->ext->rot, td->ext->rotOrder, cob.matrix); } } } @@ -2209,7 +2209,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td) if (td->flag & TD_SINGLESIZE) return; - size_to_mat4( cob.matrix,td->ext->size); + size_to_mat4(cob.matrix, td->ext->size); } /* Evaluate valid constraints */ @@ -2260,7 +2260,7 @@ static void constraintSizeLim(TransInfo *t, TransData *td) if (td->flag & TD_SINGLESIZE) return; - mat4_to_size( td->ext->size,cob.matrix); + mat4_to_size(td->ext->size, cob.matrix); } } } @@ -2628,7 +2628,7 @@ static void headerResize(TransInfo *t, float vec[3], char *str) #define VECSIGNFLIP(a, b) ((SIGN(a[0]) & SIGN(b[0]))==0 || (SIGN(a[1]) & SIGN(b[1]))==0 || (SIGN(a[2]) & SIGN(b[2]))==0) /* smat is reference matrix, only scaled */ -static void TransMat3ToSize( float mat[][3], float smat[][3], float *size) +static void TransMat3ToSize(float mat[][3], float smat[][3], float *size) { float vec[3]; @@ -2688,7 +2688,7 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) //print_v3("fsize", fsize); } else { - mat3_to_size( fsize,tmat); + mat3_to_size(fsize, tmat); } protectedSizeBits(td->protectflag, fsize); @@ -2775,7 +2775,7 @@ int Resize(TransInfo *t, const int mval[2]) copy_v3_v3(t->values, size); - size_to_mat3( mat,size); + size_to_mat3(mat, size); if (t->con.applySize) { t->con.applySize(t, NULL, mat); @@ -2797,7 +2797,7 @@ int Resize(TransInfo *t, const int mval[2]) /* evil hack - redo resize if cliping needed */ if (t->flag & T_CLIP_UV && clipUVTransform(t, size, 1)) { - size_to_mat3( mat,size); + size_to_mat3(mat, size); if (t->con.applySize) t->con.applySize(t, NULL, mat); @@ -2966,14 +2966,14 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short add_v3_v3v3(td->loc, vec, center); - sub_v3_v3v3(vec,td->loc,td->iloc); + sub_v3_v3v3(vec, td->loc, td->iloc); protectedTransBits(td->protectflag, vec); add_v3_v3v3(td->loc, td->iloc, vec); if (td->flag & TD_USEQUAT) { mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); - mat3_to_quat( quat,fmat); // Actual transform + mat3_to_quat(quat, fmat); // Actual transform if (td->ext->quat) { mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat); @@ -3040,7 +3040,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short if (td->ext->rotOrder == ROT_MODE_QUAT) { mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); - mat3_to_quat( quat,fmat); // Actual transform + mat3_to_quat(quat, fmat); // Actual transform mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat); /* this function works on end result */ @@ -3054,10 +3054,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle); mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); - mat3_to_quat( quat,fmat); // Actual transform + mat3_to_quat(quat, fmat); // Actual transform mul_qt_qtqt(tquat, quat, iquat); - quat_to_axis_angle( td->ext->rotAxis, td->ext->rotAngle,tquat); + quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat); /* this function works on end result */ protectedAxisAngleBits(td->protectflag, td->ext->rotAxis, td->ext->rotAngle, td->ext->irotAxis, td->ext->irotAngle); @@ -3070,12 +3070,12 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* calculate the total rotatation in eulers */ copy_v3_v3(eul, td->ext->irot); - eulO_to_mat3( eulmat,eul, td->ext->rotOrder); + eulO_to_mat3(eulmat, eul, td->ext->rotOrder); /* mat = transform, obmat = bone rotation */ mul_m3_m3m3(fmat, smat, eulmat); - mat3_to_compatible_eulO( eul, td->ext->rot, td->ext->rotOrder,fmat); + mat3_to_compatible_eulO(eul, td->ext->rot, td->ext->rotOrder, fmat); /* and apply (to end result only) */ protectedRotateBits(td->protectflag, eul, td->ext->irot); @@ -3108,7 +3108,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* euler or quaternion? */ if ((td->ext->rotOrder == ROT_MODE_QUAT) || (td->flag & TD_USEQUAT)) { mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); - mat3_to_quat( quat,fmat); // Actual transform + mat3_to_quat(quat, fmat); // Actual transform mul_qt_qtqt(td->ext->quat, quat, td->ext->iquat); /* this function works on end result */ @@ -3121,10 +3121,10 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short axis_angle_to_quat(iquat, td->ext->irotAxis, td->ext->irotAngle); mul_serie_m3(fmat, td->mtx, mat, td->smtx, NULL, NULL, NULL, NULL, NULL); - mat3_to_quat( quat,fmat); // Actual transform + mat3_to_quat(quat, fmat); // Actual transform mul_qt_qtqt(tquat, quat, iquat); - quat_to_axis_angle( td->ext->rotAxis, td->ext->rotAngle,tquat); + quat_to_axis_angle(td->ext->rotAxis, td->ext->rotAngle, tquat); /* this function works on end result */ protectedAxisAngleBits(td->protectflag, td->ext->rotAxis, td->ext->rotAngle, td->ext->irotAxis, td->ext->irotAngle); @@ -3137,11 +3137,11 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short /* calculate the total rotatation in eulers */ add_v3_v3v3(eul, td->ext->irot, td->ext->drot); /* we have to correct for delta rot */ - eulO_to_mat3( obmat,eul, td->ext->rotOrder); + eulO_to_mat3(obmat, eul, td->ext->rotOrder); /* mat = transform, obmat = object rotation */ mul_m3_m3m3(fmat, smat, obmat); - mat3_to_compatible_eulO( eul, td->ext->rot, td->ext->rotOrder,fmat); + mat3_to_compatible_eulO(eul, td->ext->rot, td->ext->rotOrder, fmat); /* correct back for delta rot */ sub_v3_v3v3(eul, eul, td->ext->drot); @@ -3162,7 +3162,7 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) float mat[3][3]; int i; - vec_rot_to_mat3( mat,axis, angle); + vec_rot_to_mat3(mat, axis, angle); for (i = 0 ; i < t->total; i++, td++) { @@ -3174,10 +3174,10 @@ static void applyRotation(TransInfo *t, float angle, float axis[3]) if (t->con.applyRot) { t->con.applyRot(t, td, axis, NULL); - vec_rot_to_mat3( mat,axis, angle * td->factor); + vec_rot_to_mat3(mat, axis, angle * td->factor); } else if (t->flag & T_PROP_EDIT) { - vec_rot_to_mat3( mat,axis, angle * td->factor); + vec_rot_to_mat3(mat, axis, angle * td->factor); } ElementRotation(t, td, mat, t->around); @@ -3263,8 +3263,8 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a float mat[3][3], smat[3][3], totmat[3][3]; int i; - vec_rot_to_mat3( smat,axis1, angles[0]); - vec_rot_to_mat3( totmat,axis2, angles[1]); + vec_rot_to_mat3(smat, axis1, angles[0]); + vec_rot_to_mat3(totmat, axis2, angles[1]); mul_m3_m3m3(mat, smat, totmat); @@ -3276,8 +3276,8 @@ static void applyTrackball(TransInfo *t, float axis1[3], float axis2[3], float a continue; if (t->flag & T_PROP_EDIT) { - vec_rot_to_mat3( smat,axis1, td->factor * angles[0]); - vec_rot_to_mat3( totmat,axis2, td->factor * angles[1]); + vec_rot_to_mat3(smat, axis1, td->factor * angles[0]); + vec_rot_to_mat3(totmat, axis2, td->factor * angles[1]); mul_m3_m3m3(mat, smat, totmat); } @@ -3324,8 +3324,8 @@ int Trackball(TransInfo *t, const int UNUSED(mval[2])) } (void)spos; - vec_rot_to_mat3( smat,axis1, phi[0]); - vec_rot_to_mat3( totmat,axis2, phi[1]); + vec_rot_to_mat3(smat, axis1, phi[0]); + vec_rot_to_mat3(totmat, axis2, phi[1]); mul_m3_m3m3(mat, smat, totmat); @@ -3483,7 +3483,7 @@ static void applyTranslation(TransInfo *t, float vec[3]) axis_angle_to_quat(quat, axis, angle); - quat_to_mat3( mat,quat); + quat_to_mat3(mat, quat); ElementRotation(t, td, mat, V3D_LOCAL); } @@ -3924,7 +3924,7 @@ int handleEventBevel(TransInfo *t, wmEvent *event) int Bevel(TransInfo *t, const int UNUSED(mval[2])) { - float distance,d; + float distance, d; int i; char str[128]; const char *mode; @@ -4177,9 +4177,9 @@ static void ElementBoneSize(TransInfo *t, TransData *td, float mat[3][3]) /* we've tucked the scale in loc */ oldy= td->iloc[1]; - size_to_mat3( sizemat,td->iloc); + size_to_mat3(sizemat, td->iloc); mul_m3_m3m3(tmat, tmat, sizemat); - mat3_to_size( td->loc,tmat); + mat3_to_size(td->loc, tmat); td->loc[1]= oldy; } @@ -4209,7 +4209,7 @@ int BoneSize(TransInfo *t, const int mval[2]) constraintNumInput(t, size); } - size_to_mat3( mat,size); + size_to_mat3(mat, size); if (t->con.applySize) { t->con.applySize(t, NULL, mat); @@ -4861,7 +4861,7 @@ void freeSlideVerts(TransInfo *t) LinkNode *look = sld->vertlist; GHash *vertgh = sld->vhash; while (look) { - sv = BLI_ghash_lookup(vertgh,(EditVert*)look->link); + sv = BLI_ghash_lookup(vertgh, (EditVert*)look->link); if (sv != NULL) { sv->up->f &= !SELECT; sv->down->f &= !SELECT; @@ -5167,7 +5167,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2])) if (t->con.mode & CON_APPLY) { size[0] = size[1] = size[2] = -1; - size_to_mat3( mat,size); + size_to_mat3(mat, size); if (t->con.applySize) { t->con.applySize(t, NULL, mat); @@ -5192,7 +5192,7 @@ int Mirror(TransInfo *t, const int UNUSED(mval[2])) else { size[0] = size[1] = size[2] = 1; - size_to_mat3( mat,size); + size_to_mat3(mat, size); for (i = 0, td=t->data; i < t->total; i++, td++) { if (td->flag & TD_NOACTION) @@ -5460,7 +5460,7 @@ static void doAnimEdit_SnapFrame(TransInfo *t, TransData *td, TransData2D *td2d, /* do the snapping to nearest frame/second */ if (doTime) { - val= (float)( floor((val/secf) + 0.5f) * secf ); + val= (float)(floor((val/secf) + 0.5f) * secf); } else #endif @@ -5599,9 +5599,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) if (autosnap == SACTSNAP_STEP) { if (doTime) - deltax= (float)( floor((deltax/secf) + 0.5f) * secf ); + deltax= (float)(floor((deltax/secf) + 0.5f) * secf); else - deltax= (float)( floor(deltax + 0.5f) ); + deltax= (float)(floor(deltax + 0.5f)); } val = BKE_nla_tweakedit_remap(adt, td->ival, NLATIME_CONVERT_MAP); @@ -5613,9 +5613,9 @@ static void applyTimeTranslate(TransInfo *t, float UNUSED(sval)) if (autosnap == SACTSNAP_STEP) { if (doTime) - val= (float)( floor((deltax/secf) + 0.5f) * secf ); + val= (float)(floor((deltax/secf) + 0.5f) * secf); else - val= (float)( floor(val + 0.5f) ); + val= (float)(floor(val + 0.5f)); } *(td->val) = td->ival + val; @@ -5865,9 +5865,9 @@ static void applyTimeScale(TransInfo *t) if (autosnap == SACTSNAP_STEP) { if (doTime) - fac= (float)( floor(fac/secf + 0.5f) * secf ); + fac= (float)(floor(fac/secf + 0.5f) * secf); else - fac= (float)( floor(fac + 0.5f) ); + fac= (float)(floor(fac + 0.5f)); } /* check if any need to apply nla-mapping */ diff --git a/source/blender/editors/transform/transform.h b/source/blender/editors/transform/transform.h index 0bef33149d7..69af8cf2489 100644 --- a/source/blender/editors/transform/transform.h +++ b/source/blender/editors/transform/transform.h @@ -68,7 +68,7 @@ struct ReportList; struct SmallHash; typedef struct TransSnapPoint { - struct TransSnapPoint *next,*prev; + struct TransSnapPoint *next, *prev; float co[3]; } TransSnapPoint; diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index ebded7b0a6e..b18d132f8df 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -664,7 +664,7 @@ void drawConstraint(TransInfo *t) else { if (tc->mode & CON_SELECT) { float vec[3]; - char col2[3] = {255,255,255}; + char col2[3] = {255, 255, 255}; int depth_test_enabled; convertViewVec(t, vec, (t->mval[0] - t->con.imval[0]), (t->mval[1] - t->con.imval[1])); @@ -767,7 +767,7 @@ static void drawObjectConstraint(TransInfo *t) td++; - for (i=1;i<t->total;i++,td++) { + for (i=1; i < t->total; i++, td++) { if (t->con.mode & CON_AXIS0) { drawLine(t, td->ob->obmat[3], td->axismtx[0], 'X', 0); } diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index c4edeefa598..d38d3917177 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -266,7 +266,7 @@ static void createTransTexspace(TransInfo *t) } id = ob->data; - if (id == NULL || !ELEM3( GS(id->name), ID_ME, ID_CU, ID_MB )) { + if (id == NULL || !ELEM3(GS(id->name), ID_ME, ID_CU, ID_MB )) { t->total = 0; return; } @@ -418,7 +418,7 @@ static short apply_targetless_ik(Object *ob) /* pose_mat(b) = pose_mat(b-1) * offs_bone * channel * constraint * IK */ /* we put in channel the entire result of rmat= (channel * constraint * IK) */ /* pose_mat(b) = pose_mat(b-1) * offs_bone * rmat */ - /* rmat = pose_mat(b) * inv( pose_mat(b-1) * offs_bone ) */ + /* rmat = pose_mat(b) * inv(pose_mat(b-1) * offs_bone ) */ parchan= chanlist[segcount-1]; bone= parchan->bone; @@ -439,25 +439,25 @@ static short apply_targetless_ik(Object *ob) * and applied poses. */ if (parchan->rotmode > 0) - mat3_to_eulO(parchan->eul, parchan->rotmode,rmat3); + mat3_to_eulO(parchan->eul, parchan->rotmode, rmat3); else if (parchan->rotmode == ROT_MODE_AXISANGLE) - mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle,rmat3); + mat3_to_axis_angle(parchan->rotAxis, &parchan->rotAngle, rmat3); else - mat3_to_quat(parchan->quat,rmat3); + mat3_to_quat(parchan->quat, rmat3); /* for size, remove rotation */ /* causes problems with some constraints (so apply only if needed) */ if (data->flag & CONSTRAINT_IK_STRETCH) { if (parchan->rotmode > 0) - eulO_to_mat3( qrmat,parchan->eul, parchan->rotmode); + eulO_to_mat3(qrmat, parchan->eul, parchan->rotmode); else if (parchan->rotmode == ROT_MODE_AXISANGLE) - axis_angle_to_mat3( qrmat,parchan->rotAxis, parchan->rotAngle); + axis_angle_to_mat3(qrmat, parchan->rotAxis, parchan->rotAngle); else - quat_to_mat3( qrmat,parchan->quat); + quat_to_mat3(qrmat, parchan->quat); invert_m3_m3(imat3, qrmat); mul_m3_m3m3(smat, rmat3, imat3); - mat3_to_size( parchan->size,smat); + mat3_to_size(parchan->size, smat); } /* causes problems with some constraints (e.g. childof), so disable this */ @@ -548,10 +548,10 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr if (constraints_list_needinv(t, &pchan->constraints)) { copy_m3_m4(tmat, pchan->constinv); invert_m3_m3(cmat, tmat); - mul_serie_m3(td->mtx, pmat, omat, cmat, NULL,NULL,NULL,NULL,NULL); + mul_serie_m3(td->mtx, pmat, omat, cmat, NULL, NULL, NULL, NULL, NULL); } else - mul_serie_m3(td->mtx, pmat, omat, NULL, NULL,NULL,NULL,NULL,NULL); + mul_serie_m3(td->mtx, pmat, omat, NULL, NULL, NULL, NULL, NULL, NULL); } invert_m3_m3(td->smtx, td->mtx); @@ -681,7 +681,7 @@ int count_set_pose_transflags(int *out_mode, short around, Object *ob) total++; if (mode == TFM_TRANSLATION) { - if ( has_targetless_ik(pchan)==NULL ) { + if (has_targetless_ik(pchan) == NULL) { if (pchan->parent && (pchan->bone->flag & BONE_CONNECTED)) { if (pchan->bone->flag & BONE_HINGE_CHILD_TRANSFORM) hastranslation = 1; @@ -1616,7 +1616,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) PTCacheEditPoint *point; PTCacheEditKey *key; float mat[4][4]; - int i,k, transformparticle; + int i, k, transformparticle; int count = 0, hasselected = 0; int propmode = t->flag & T_PROP_EDIT; @@ -1625,7 +1625,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) psys = edit->psys; if (psys) - psmd = psys_get_modifier(ob,psys); + psmd = psys_get_modifier(ob, psys); base->flag |= BA_HAS_RECALC_DATA; @@ -1665,7 +1665,7 @@ static void createTransParticleVerts(bContext *C, TransInfo *t) unit_m4(mat); - invert_m4_m4(ob->imat,ob->obmat); + invert_m4_m4(ob->imat, ob->obmat); for (i=0, point=edit->points; i<edit->totpoint; i++, point++) { TransData *head, *tail; @@ -1748,7 +1748,7 @@ void flushTransParticles(TransInfo *t) if (psys && !(psys->flag & PSYS_GLOBAL_HAIR)) { psys_mat_hair_to_global(ob, psmd->dm, psys->part->from, psys->particles + i, mat); - invert_m4_m4(imat,mat); + invert_m4_m4(imat, mat); for (k=0, key=point->keys; k<point->totkey; k++, key++) { copy_v3_v3(co, key->world_co); @@ -2055,7 +2055,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) * the modifiers that support deform matrices (defcos) */ if (totleft > 0) { mappedcos= crazyspace_get_mapped_editverts(t->scene, t->obedit); - quats= MEM_mallocN( (t->total)*sizeof(float)*4, "crazy quats"); + quats= MEM_mallocN((t->total)*sizeof(float)*4, "crazy quats"); crazyspace_set_quats_editmesh(em, (float*)defcos, mappedcos, quats); /* BMESH_TODO, abuses vertex index, should use an int array */ if (mappedcos) MEM_freeN(mappedcos); @@ -2133,7 +2133,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) } /* Mirror? */ - if ( (mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { + if ((mirror>0 && tob->iloc[0]>0.0f) || (mirror<0 && tob->iloc[0]<0.0f)) { BMVert *vmir= EDBM_verts_mirror_get(em, eve); //t->obedit, em, eve, tob->iloc, a); if (vmir && vmir != eve) { tob->extra = vmir; @@ -2147,7 +2147,7 @@ static void createTransEditVerts(bContext *C, TransInfo *t) if (mirror != 0) { tob = t->data; - for ( a = 0; a < t->total; a++, tob++ ) + for (a = 0; a < t->total; a++, tob++ ) { if (ABS(tob->loc[0]) <= 0.00001f) { @@ -2294,7 +2294,7 @@ void flushTransSeq(TransInfo *t) if (seq->depth==0) { /* test overlap, displayes red outline */ seq->flag &= ~SEQ_OVERLAP; - if ( seq_test_overlap(seqbasep, seq) ) { + if (seq_test_overlap(seqbasep, seq)) { seq->flag |= SEQ_OVERLAP; } } @@ -2994,7 +2994,7 @@ void flushTransGPactionData (TransInfo *t) /* find the first one to start from */ if (t->mode == TFM_TIME_SLIDE) - tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 ); + tfd= (tGPFtransdata *)((float *)(t->customData) + 2); else tfd= (tGPFtransdata *)(t->customData); @@ -3113,7 +3113,7 @@ static void createTransActionData(bContext *C, TransInfo *t) if (ac.datatype == ANIMCONT_GPENCIL) { if (t->mode == TFM_TIME_SLIDE) { t->customData= MEM_callocN((sizeof(float)*2)+(sizeof(tGPFtransdata)*count), "TimeSlide + tGPFtransdata"); - tfd= (tGPFtransdata *)( (float *)(t->customData) + 2 ); + tfd= (tGPFtransdata *)((float *)(t->customData) + 2); } else { t->customData= MEM_callocN(sizeof(tGPFtransdata)*count, "tGPFtransdata"); @@ -3468,9 +3468,9 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * then check if we're using auto-handles. * - If so, change them auto-handles to aligned handles so that handles get affected too */ - if ( ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && - ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) && - ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) + if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && + ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) && + ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) { if (hdata && (sel1) && (sel3)) { bezt->h1= HD_ALIGN; @@ -3559,8 +3559,8 @@ static void sort_time_beztmaps (BeztMap *bezms, int totvert, const short UNUSED( * optimization: this only needs to be performed in the first loop */ if (bezm->swapHs == 0) { - if ( (bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && - (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) ) + if ((bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && + (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0]) ) { /* handles need to be swapped */ bezm->swapHs = 1; @@ -3714,9 +3714,9 @@ void flushTransGraphData(TransInfo *t) switch (sipo->autosnap) { case SACTSNAP_FRAME: /* snap to nearest frame (or second if drawing seconds) */ if (sipo->flag & SIPO_DRAWTIME) - td2d->loc[0]= (float)( floor((td2d->loc[0]/secf) + 0.5f) * secf ); + td2d->loc[0]= (float)(floor((td2d->loc[0]/secf) + 0.5f) * secf); else - td2d->loc[0]= (float)( floor(td2d->loc[0]+0.5f) ); + td2d->loc[0]= (float)(floor(td2d->loc[0]+0.5f)); break; case SACTSNAP_MARKER: /* snap to nearest marker */ @@ -3879,7 +3879,7 @@ static int SeqTransCount(TransInfo *t, Sequence *parent, ListBase *seqbase, int for (seq= seqbase->first; seq; seq= seq->next) { seq->depth= depth; - /* seq->tmp is used by seq_tx_get_final_{left,right} to check sequence's range and clamp to it if needed. + /* seq->tmp is used by seq_tx_get_final_{left, right} to check sequence's range and clamp to it if needed. * it's first place where digging into sequences tree, so store link to parent here */ seq->tmp = parent; @@ -4173,9 +4173,9 @@ static void createTransSeqData(bContext *C, TransInfo *t) int i; for (i=0; i<3; i++) { seq_user= *((&seq->seq1) + i); - if ( seq_user && (seq_user->flag & SELECT) && - !(seq_user->flag & SEQ_LOCK) && - !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL))) + if (seq_user && (seq_user->flag & SELECT) && + !(seq_user->flag & SEQ_LOCK) && + !(seq_user->flag & (SEQ_LEFTSEL|SEQ_RIGHTSEL))) { seq->flag |= SELECT; } @@ -4473,8 +4473,8 @@ static int count_proportional_objects(TransInfo *t) /* mark all children */ for (base= scene->base.first; base; base= base->next) { /* all base not already selected or marked that is editable */ - if ( (base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && - (BASE_EDITABLE_BGMODE(v3d, scene, base))) + if ((base->object->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && + (BASE_EDITABLE_BGMODE(v3d, scene, base))) { mark_children(base->object); } @@ -4485,8 +4485,8 @@ static int count_proportional_objects(TransInfo *t) Object *ob= base->object; /* if base is not selected, not a parent of selection or not a child of selection and it is editable */ - if ( (ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && - (BASE_EDITABLE_BGMODE(v3d, scene, base))) + if ((ob->flag & (SELECT|BA_TRANSFORM_CHILD|BA_TRANSFORM_PARENT)) == 0 && + (BASE_EDITABLE_BGMODE(v3d, scene, base))) { /* used for flush, depgraph will change recalcs if needed :) */ @@ -4877,8 +4877,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these */ - if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && - ((canceled == 0) || (duplicate)) ) + if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 && + ((canceled == 0) || (duplicate)) ) { if (adt) { ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 1); @@ -4908,8 +4908,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these */ - if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && - ((canceled == 0) || (duplicate)) ) + if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 && + ((canceled == 0) || (duplicate))) { posttrans_action_clean(&ac, (bAction *)ac.data); } @@ -4921,8 +4921,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these */ - if ( (saction->flag & SACTION_NOTRANSKEYCULL)==0 && - ((canceled == 0) || (duplicate)) ) + if ((saction->flag & SACTION_NOTRANSKEYCULL)==0 && + ((canceled == 0) || (duplicate))) { bGPdata *gpd; @@ -4989,8 +4989,8 @@ void special_aftertrans_update(bContext *C, TransInfo *t) * 2) canceled == 0 -> user confirmed the transform, so duplicates should be removed * 3) canceled + duplicate -> user canceled the transform, but we made duplicates, so get rid of these */ - if ( (sipo->flag & SIPO_NOTRANSKEYCULL)==0 && - ((canceled == 0) || (duplicate)) ) + if ((sipo->flag & SIPO_NOTRANSKEYCULL)==0 && + ((canceled == 0) || (duplicate))) { if (adt) { ANIM_nla_mapping_apply_fcurve(adt, fcu, 0, 0); @@ -5101,10 +5101,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t) DAG_id_tag_update(&ob->id, OB_RECALC_DATA); } - else if ( (t->scene->basact) && - (ob = t->scene->basact->object) && - (ob->mode & OB_MODE_PARTICLE_EDIT) && - PE_get_current(t->scene, ob)) + else if ((t->scene->basact) && + (ob = t->scene->basact->object) && + (ob->mode & OB_MODE_PARTICLE_EDIT) && + PE_get_current(t->scene, ob)) { /* do nothing */ } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index f8a982c6b71..f15397f1fd6 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -297,7 +297,7 @@ int calc_manipulator_stats(const bContext *C) if (obedit->type==OB_MESH) { BMEditMesh *em = BMEdit_FromObject(obedit); BMEditSelection ese; - float vec[3]= {0,0,0}; + float vec[3]= {0, 0, 0}; /* USE LAST SELECTE WITH ACTIVE */ if ((v3d->around == V3D_ACTIVE) && BM_select_history_active_get(em->bm, &ese)) { @@ -508,7 +508,7 @@ int calc_manipulator_stats(const bContext *C) if (edit) { point = edit->points; - for (a=0; a<edit->totpoint; a++,point++) { + for (a=0; a<edit->totpoint; a++, point++) { if (point->flag & PEP_HIDE) continue; for (k=0, ek=point->keys; k<point->totkey; k++, ek++) { @@ -1512,7 +1512,7 @@ void BIF_draw_manipulator(const bContext *C) if (v3d->twflag & V3D_DRAW_MANIPULATOR) { - glBlendFunc(GL_SRC_ALPHA,GL_ONE_MINUS_SRC_ALPHA); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_BLEND); if (v3d->twtype & V3D_MANIP_ROTATE) { diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index b9ae3180591..83d4a5dfa6e 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -145,7 +145,7 @@ static int snap_type_exec(bContext *C, wmOperator *op) { ToolSettings *ts= CTX_data_tool_settings(C); - ts->snap_mode = RNA_enum_get(op->ptr,"type"); + ts->snap_mode = RNA_enum_get(op->ptr, "type"); WM_event_add_notifier(C, NC_SCENE|ND_TOOLSETTINGS, NULL); /* header redraw */ diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index db974626b14..2b8c03a56ae 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -573,7 +573,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], BMEditMesh *em = me->edit_btmesh; BMVert *eve; BMEditSelection ese; - float vec[3]= {0,0,0}; + float vec[3]= {0, 0, 0}; /* USE LAST SELECTED WITH ACTIVE */ if (activeOnly && BM_select_history_active_get(em->bm, &ese)) { @@ -769,7 +769,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], float mat[4][4]; /* Rotation of MetaElem is stored in quat */ - quat_to_mat4( mat,ml_sel->quat); + quat_to_mat4( mat, ml_sel->quat); copy_v3_v3(normal, mat[2]); diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 0a5613bca22..a24679878bc 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -216,7 +216,7 @@ void drawSnapping(const struct bContext *C, TransInfo *t) cpack(0xFFFFFF); glTranslatef(t->tsnap.snapPoint[0], t->tsnap.snapPoint[1], 0.0f); - //glRectf(0,0,1,1); + //glRectf(0, 0, 1, 1); setlinestyle(0); cpack(0x0); @@ -700,7 +700,7 @@ static float RotationBetween(TransInfo *t, float p1[3], float p2[3]) mul_m3_v3(mtx, end); mul_m3_v3(mtx, start); - angle = atan2(start[1],start[0]) - atan2(end[1],end[0]); + angle = atan2(start[1], start[0]) - atan2(end[1], end[0]); } if (angle > (float)M_PI) { @@ -1055,9 +1055,9 @@ static int snapFace(ARegion *ar, float v1co[3], float v2co[3], float v3co[3], fl copy_v3_v3(location, intersect); if (v4co) - normal_quad_v3( normal,v1co, v2co, v3co, v4co); + normal_quad_v3(normal, v1co, v2co, v3co, v4co); else - normal_tri_v3( normal,v1co, v2co, v3co); + normal_tri_v3(normal, v1co, v2co, v3co); mul_m4_v3(obmat, location); @@ -1738,9 +1738,9 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], copy_v3_v3(location, intersect); if (f->v4) - normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co); + normal_quad_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co); else - normal_tri_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co); + normal_tri_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co); mul_m4_v3(obmat, location); @@ -1767,13 +1767,13 @@ static int peelDerivedMesh(Object *ob, DerivedMesh *dm, float obmat[][4], copy_v3_v3(location, intersect); if (f->v4) - normal_quad_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co); + normal_quad_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co, verts[f->v4].co); else - normal_tri_v3( normal,verts[f->v1].co, verts[f->v2].co, verts[f->v3].co); + normal_tri_v3(normal, verts[f->v1].co, verts[f->v2].co, verts[f->v3].co); mul_m4_v3(obmat, location); - new_depth = len_v3v3(location, ray_start); + new_depth = len_v3v3(location, ray_start); mul_m3_v3(timat, normal); normalize_v3(normal); |