diff options
Diffstat (limited to 'source/blender')
24 files changed, 82 insertions, 88 deletions
diff --git a/source/blender/blenkernel/intern/anim.c b/source/blender/blenkernel/intern/anim.c index 34dcf41d441..8619ab1eb1c 100644 --- a/source/blender/blenkernel/intern/anim.c +++ b/source/blender/blenkernel/intern/anim.c @@ -727,9 +727,8 @@ static void vertex_dupli__mapFunc(void *userData, int index, float *co, float *n vertexDupliData *vdd= userData; float vec[3], q2[4], mat[3][3], tmat[4][4], obmat[4][4]; - VECCOPY(vec, co); - mul_m4_v3(vdd->pmat, vec); - sub_v3_v3v3(vec, vec, vdd->pmat[3]); + mul_v3_m4v3(vec, vdd->pmat, co); + sub_v3_v3(vec, vdd->pmat[3]); add_v3_v3(vec, vdd->obmat[3]); copy_m4_m4(obmat, vdd->obmat); diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index 3f89fc4f226..ba295d4b09a 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -850,9 +850,8 @@ static float dist_bone_deform(bPoseChannel *pchan, float *vec, DualQuat *dq, flo mul_m4_v3(pchan->chan_mat, cop); // Make this a delta from the base position - sub_v3_v3v3(cop, cop, co); - cop[0]*=fac; cop[1]*=fac; cop[2]*=fac; - add_v3_v3(vec, cop); + sub_v3_v3(cop, co); + madd_v3_v3fl(vec, cop, fac); if(mat) pchan_deform_mat_add(pchan, fac, bbonemat, mat); @@ -1110,7 +1109,7 @@ void armature_deform_verts(Object *armOb, Object *target, DerivedMesh *dm, if(armature_weight != 1.0f) { VECCOPY(dco, co); mul_v3m3_dq( dco, (defMats)? summat: NULL,dq); - sub_v3_v3v3(dco, dco, co); + sub_v3_v3(dco, co); mul_v3_fl(dco, armature_weight); add_v3_v3(co, dco); } diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index b18ab8767e3..82602a6951d 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -400,8 +400,8 @@ static int rule_flock(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Parti mul_v3_fl(loc, 1.0f/((float)neighbors - 1.0f)); mul_v3_fl(vec, 1.0f/((float)neighbors - 1.0f)); - sub_v3_v3v3(loc, loc, pa->prev_state.co); - sub_v3_v3v3(vec, vec, pa->prev_state.vel); + sub_v3_v3(loc, pa->prev_state.co); + sub_v3_v3(vec, pa->prev_state.vel); add_v3_v3(bbd->wanted_co, vec); add_v3_v3(bbd->wanted_co, loc); @@ -573,7 +573,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va if(asbr->level > 0.0f && psys_uses_gravity(bbd->sim)) { project_v3_v3v3(vec, bbd->wanted_co, bbd->sim->scene->physics_settings.gravity); mul_v3_fl(vec, asbr->level); - sub_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec); + sub_v3_v3(bbd->wanted_co, vec); } } else { @@ -590,7 +590,7 @@ static int rule_average_speed(BoidRule *rule, BoidBrainData *bbd, BoidValues *va if(asbr->level > 0.0f && psys_uses_gravity(bbd->sim)) { project_v3_v3v3(vec, bbd->wanted_co, bbd->sim->scene->physics_settings.gravity); mul_v3_fl(vec, asbr->level); - sub_v3_v3v3(bbd->wanted_co, bbd->wanted_co, vec); + sub_v3_v3(bbd->wanted_co, vec); } } @@ -765,10 +765,10 @@ static Object *boid_find_ground(BoidBrainData *bbd, ParticleData *pa, float *gro if(!bbd->sim->colliders) return NULL; - VECCOPY(col.co1, pa->state.co); - VECCOPY(col.co2, pa->state.co); + copy_v3_v3(col.co1, pa->state.co); + copy_v3_v3(col.co2, pa->state.co); add_v3_v3(col.co1, zvec); - sub_v3_v3v3(col.co2, col.co2, zvec); + sub_v3_v3(col.co2, zvec); sub_v3_v3v3(ray_dir, col.co2, col.co1); col.t = 0.0f; hit.index = -1; diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c index 353adf932a5..44a52964f2a 100644 --- a/source/blender/blenkernel/intern/colortools.c +++ b/source/blender/blenkernel/intern/colortools.c @@ -467,7 +467,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) if(vec[0] < bezt[0].vec[1][0]) vec[0]= bezt[0].vec[1][0]; - sub_v3_v3v3(vec, vec, bezt[0].vec[1]); + sub_v3_v3(vec, bezt[0].vec[1]); nlen= len_v3(vec); if(nlen>FLT_EPSILON) { mul_v3_fl(vec, hlen/nlen); @@ -484,7 +484,7 @@ static void curvemap_make_table(CurveMap *cuma, rctf *clipr) if(vec[0] > bezt[a].vec[1][0]) vec[0]= bezt[a].vec[1][0]; - sub_v3_v3v3(vec, vec, bezt[a].vec[1]); + sub_v3_v3(vec, bezt[a].vec[1]); nlen= len_v3(vec); if(nlen>FLT_EPSILON) { mul_v3_fl(vec, hlen/nlen); diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index c1baced8f05..6206696e109 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2341,12 +2341,12 @@ void minmax_object(Object *ob, float *min, float *max) default: DO_MINMAX(ob->obmat[3], min, max); - VECCOPY(vec, ob->obmat[3]); + copy_v3_v3(vec, ob->obmat[3]); add_v3_v3(vec, ob->size); DO_MINMAX(vec, min, max); - VECCOPY(vec, ob->obmat[3]); - sub_v3_v3v3(vec, vec, ob->size); + copy_v3_v3(vec, ob->obmat[3]); + sub_v3_v3(vec, ob->size); DO_MINMAX(vec, min, max); break; } diff --git a/source/blender/blenkernel/intern/sketch.c b/source/blender/blenkernel/intern/sketch.c index 6032a0eea3d..33871f78864 100644 --- a/source/blender/blenkernel/intern/sketch.c +++ b/source/blender/blenkernel/intern/sketch.c @@ -336,7 +336,7 @@ void sk_flattenStroke(SK_Stroke *stk, int start, int end) VECCOPY(offset, normal); mul_v3_fl(offset, d); - sub_v3_v3v3(p, p, distance); + sub_v3_v3(p, distance); add_v3_v3(p, offset); } } diff --git a/source/blender/editors/armature/editarmature.c b/source/blender/editors/armature/editarmature.c index 6363732de8d..5e03dcfbefc 100644 --- a/source/blender/editors/armature/editarmature.c +++ b/source/blender/editors/armature/editarmature.c @@ -457,8 +457,8 @@ void docenter_armature (Scene *scene, View3D *v3d, Object *ob, int centermode) /* Do the adjustments */ for (ebone= arm->edbo->first; ebone; ebone=ebone->next) { - sub_v3_v3v3(ebone->head, ebone->head, cent); - sub_v3_v3v3(ebone->tail, ebone->tail, cent); + sub_v3_v3(ebone->head, cent); + sub_v3_v3(ebone->tail, cent); } /* Turn the list into an armature */ @@ -469,9 +469,7 @@ void docenter_armature (Scene *scene, View3D *v3d, Object *ob, int centermode) copy_m3_m4(omat, ob->obmat); mul_m3_v3(omat, cent); - ob->loc[0] += cent[0]; - ob->loc[1] += cent[1]; - ob->loc[2] += cent[2]; + add_v3_v3(ob->loc, cent); } else ED_armature_edit_free(ob); diff --git a/source/blender/editors/armature/editarmature_generate.c b/source/blender/editors/armature/editarmature_generate.c index d432b2fa653..c48e7686ca9 100644 --- a/source/blender/editors/armature/editarmature_generate.c +++ b/source/blender/editors/armature/editarmature_generate.c @@ -60,7 +60,7 @@ void setBoneRollFromNormal(EditBone *bone, float *no, float invmat[][4], float t sub_v3_v3v3(tangent, bone->tail, bone->head); project_v3_v3v3(vec, tangent, normal); - sub_v3_v3v3(normal, normal, vec); + sub_v3_v3(normal, vec); normalize_v3(normal); @@ -102,7 +102,7 @@ float calcArcCorrelation(BArcIterator *iter, int start, int end, float v0[3], fl IT_peek(iter, i); sub_v3_v3v3(v, iter->p, v0); project_v3_v3v3(d, v, n); - sub_v3_v3v3(v, v, d); + sub_v3_v3(v, d); dt = len_v3(d) - avg_t; diff --git a/source/blender/editors/armature/editarmature_sketch.c b/source/blender/editors/armature/editarmature_sketch.c index 307abe809ec..521241373d0 100644 --- a/source/blender/editors/armature/editarmature_sketch.c +++ b/source/blender/editors/armature/editarmature_sketch.c @@ -568,8 +568,8 @@ void sk_drawStroke(SK_Stroke *stk, int id, float color[3], int start, int end) { float d_rgb[3] = {1, 1, 1}; - VECCOPY(rgb, color); - sub_v3_v3v3(d_rgb, d_rgb, rgb); + copy_v3_v3(rgb, color); + sub_v3_v3(d_rgb, rgb); mul_v3_fl(d_rgb, 1.0f / (float)stk->nb_points); for (i = 0; i < stk->nb_points; i++) diff --git a/source/blender/editors/armature/reeb.c b/source/blender/editors/armature/reeb.c index 8842e08d5eb..8c1171e967b 100644 --- a/source/blender/editors/armature/reeb.c +++ b/source/blender/editors/armature/reeb.c @@ -632,7 +632,7 @@ void addVertToBucket(EmbedBucket *b, float co[3]) void removeVertFromBucket(EmbedBucket *b, float co[3]) { mul_v3_fl(b->p, (float)b->nv); - sub_v3_v3v3(b->p, b->p, co); + sub_v3_v3(b->p, co); b->nv--; mul_v3_fl(b->p, 1.0f / (float)b->nv); } diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index 32572da573d..e37363cf0a2 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -3423,13 +3423,13 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) nu->pntsu++; if(mode=='e') { - VECCOPY(newbezt->vec[0], bezt->vec[0]); - VECCOPY(newbezt->vec[1], bezt->vec[1]); - VECCOPY(newbezt->vec[2], bezt->vec[2]); + copy_v3_v3(newbezt->vec[0], bezt->vec[0]); + copy_v3_v3(newbezt->vec[1], bezt->vec[1]); + copy_v3_v3(newbezt->vec[2], bezt->vec[2]); } else { - VECCOPY(newbezt->vec[1], location); - sub_v3_v3v3(newbezt->vec[1],newbezt->vec[1], obedit->obmat[3]); + copy_v3_v3(newbezt->vec[1], location); + sub_v3_v3(newbezt->vec[1], obedit->obmat[3]); mul_m3_v3(imat,newbezt->vec[1]); sub_v3_v3v3(temp, newbezt->vec[1],temp); add_v3_v3v3(newbezt->vec[0], bezt->vec[0],temp); @@ -3471,11 +3471,11 @@ static int addvert_Nurb(bContext *C, short mode, float location[3]) makeknots(nu, 1); if(mode=='e') { - VECCOPY(newbp->vec, bp->vec); + copy_v3_v3(newbp->vec, bp->vec); } else { - VECCOPY(newbp->vec, location); - sub_v3_v3v3(newbp->vec, newbp->vec, obedit->obmat[3]); + copy_v3_v3(newbp->vec, location); + sub_v3_v3(newbp->vec, obedit->obmat[3]); mul_m3_v3(imat,newbp->vec); newbp->vec[3]= 1.0; } diff --git a/source/blender/editors/mesh/editmesh_lib.c b/source/blender/editors/mesh/editmesh_lib.c index 2fc8452f734..a5c6a3e5a02 100644 --- a/source/blender/editors/mesh/editmesh_lib.c +++ b/source/blender/editors/mesh/editmesh_lib.c @@ -996,7 +996,7 @@ void EM_free_data_layer(EditMesh *em, CustomData *data, int type) static void add_normal_aligned(float *nor, float *add) { if( INPR(nor, add) < -0.9999f) - sub_v3_v3v3(nor, nor, add); + sub_v3_v3(nor, add); else add_v3_v3(nor, add); } diff --git a/source/blender/editors/mesh/editmesh_tools.c b/source/blender/editors/mesh/editmesh_tools.c index 6b8d0522f2b..823bc3eea06 100644 --- a/source/blender/editors/mesh/editmesh_tools.c +++ b/source/blender/editors/mesh/editmesh_tools.c @@ -660,7 +660,7 @@ void extrude_mesh(Scene *scene, Object *obedit, EditMesh *em, wmOperator *op, sh // initTransform(TFM_TRANSLATION, CTX_NO_PET|CTX_NO_MIRROR); if(transmode=='n') { mul_m4_v3(obedit->obmat, nor); - sub_v3_v3v3(nor, nor, obedit->obmat[3]); + sub_v3_v3(nor, obedit->obmat[3]); // BIF_setSingleAxisConstraint(nor, "along normal"); } // Transform(); diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index c363a9858cb..72d6eb5d74d 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -760,7 +760,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) } for(eve= em->verts.first; eve; eve= eve->next) { - sub_v3_v3v3(eve->co, eve->co, cent); + sub_v3_v3(eve->co, cent); } recalc_editnormals(em); @@ -806,7 +806,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) mvert= me->mvert; for(a=0; a<me->totvert; a++, mvert++) { - sub_v3_v3v3(mvert->co, mvert->co, cent); + sub_v3_v3(mvert->co, cent); } if (me->key) { @@ -815,7 +815,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) float *fp= kb->data; for (a=0; a<kb->totelem; a++, fp+=3) { - sub_v3_v3v3(fp, fp, cent); + sub_v3_v3(fp, cent); } } } @@ -857,7 +857,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if(tme && (tme->flag & ME_ISDONE)==0) { mvert= tme->mvert; for(a=0; a<tme->totvert; a++, mvert++) { - sub_v3_v3v3(mvert->co, mvert->co, cent); + sub_v3_v3(mvert->co, cent); } if (tme->key) { @@ -866,7 +866,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) float *fp= kb->data; for (a=0; a<kb->totelem; a++, fp+=3) { - sub_v3_v3v3(fp, fp, cent); + sub_v3_v3(fp, cent); } } } @@ -926,15 +926,15 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if(nu->type == CU_BEZIER) { a= nu->pntsu; while (a--) { - sub_v3_v3v3(nu->bezt[a].vec[0], nu->bezt[a].vec[0], cent); - sub_v3_v3v3(nu->bezt[a].vec[1], nu->bezt[a].vec[1], cent); - sub_v3_v3v3(nu->bezt[a].vec[2], nu->bezt[a].vec[2], cent); + sub_v3_v3(nu->bezt[a].vec[0], cent); + sub_v3_v3(nu->bezt[a].vec[1], cent); + sub_v3_v3(nu->bezt[a].vec[2], cent); } } else { a= nu->pntsu*nu->pntsv; while (a--) - sub_v3_v3v3(nu->bp[a].vec, nu->bp[a].vec, cent); + sub_v3_v3(nu->bp[a].vec, cent); } nu= nu->next; } diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index a5598dc9d0c..c7a174626a0 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -542,7 +542,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) conjugate_qt(q1); /* conj == inv for unit quat */ VECCOPY(rv3d->ofs, vod->ofs); - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs); + sub_v3_v3(rv3d->ofs, vod->dyn_ofs); mul_qt_v3(q1, rv3d->ofs); add_v3_v3(rv3d->ofs, vod->dyn_ofs); } @@ -575,7 +575,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) if (vod->use_dyn_ofs) { conjugate_qt(q1); /* conj == inv for unit quat */ - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs); + sub_v3_v3(rv3d->ofs, vod->dyn_ofs); mul_qt_v3(q1, rv3d->ofs); add_v3_v3(rv3d->ofs, vod->dyn_ofs); } @@ -589,7 +589,7 @@ static void viewrotate_apply(ViewOpsData *vod, int x, int y) if (vod->use_dyn_ofs) { conjugate_qt(q1); - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, vod->dyn_ofs); + sub_v3_v3(rv3d->ofs, vod->dyn_ofs); mul_qt_v3(q1, rv3d->ofs); add_v3_v3(rv3d->ofs, vod->dyn_ofs); } @@ -1675,7 +1675,7 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) window_to_3d_delta(ar, dvec, (rect.xmin+rect.xmax-vb[0])/2, (rect.ymin+rect.ymax-vb[1])/2); /* center the view to the center of the rectangle */ - sub_v3_v3v3(new_ofs, new_ofs, dvec); + sub_v3_v3(new_ofs, dvec); } /* work out the ratios, so that everything selected fits when we zoom */ @@ -2298,7 +2298,7 @@ static int set_3dcursor_invoke(bContext *C, wmOperator *op, wmEvent *event) if(depth_used==0) { window_to_3d_delta(ar, dvec, mval[0]-mx, mval[1]-my); - sub_v3_v3v3(fp, fp, dvec); + sub_v3_v3(fp, dvec); } } else { @@ -2706,7 +2706,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode) upvec[2] = rv3d->dist; copy_m3_m4(mat, rv3d->viewinv); mul_m3_v3(mat, upvec); - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, upvec); + sub_v3_v3(rv3d->ofs, upvec); rv3d->dist = 0.0; } @@ -2748,7 +2748,7 @@ void viewmoveNDOFfly(ARegion *ar, View3D *v3d, int mode) // translate the view - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, tvec); + sub_v3_v3(rv3d->ofs, tvec); /*---------------------------------------------------- @@ -2929,7 +2929,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode) if (use_sel) { conjugate_qt(q1); /* conj == inv for unit quat */ - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs); + sub_v3_v3(rv3d->ofs, obofs); mul_qt_v3(q1, rv3d->ofs); add_v3_v3(rv3d->ofs, obofs); } @@ -2954,7 +2954,7 @@ void viewmoveNDOF(Scene *scene, ARegion *ar, View3D *v3d, int mode) if (use_sel) { conjugate_qt(q1); - sub_v3_v3v3(rv3d->ofs, rv3d->ofs, obofs); + sub_v3_v3(rv3d->ofs, obofs); mul_qt_v3(q1, rv3d->ofs); add_v3_v3(rv3d->ofs, obofs); } diff --git a/source/blender/editors/space_view3d/view3d_select.c b/source/blender/editors/space_view3d/view3d_select.c index d0c69c9a4cb..495f240a97a 100644 --- a/source/blender/editors/space_view3d/view3d_select.c +++ b/source/blender/editors/space_view3d/view3d_select.c @@ -105,7 +105,7 @@ void view3d_get_view_aligned_coordinate(ViewContext *vc, float *fp, short mval[2 if(mval[0]!=IS_CLIPPED) { window_to_3d_delta(vc->ar, dvec, mval[0]-mx, mval[1]-my); - sub_v3_v3v3(fp, fp, dvec); + sub_v3_v3(fp, dvec); } } diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index ab991be7dad..5bce1992b53 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -452,7 +452,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *op) vec[0]= gridf*floor(.5+ vec[0]/gridf); vec[1]= gridf*floor(.5+ vec[1]/gridf); vec[2]= gridf*floor(.5+ vec[2]/gridf); - sub_v3_v3v3(vec, vec, obedit->obmat[3]); + sub_v3_v3(vec, obedit->obmat[3]); mul_m3_v3(imat, vec); VECCOPY(tv->loc, vec); diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index 02ef62b22d3..6a661f18959 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -166,7 +166,7 @@ static void view_settings_from_ob(Object *ob, float *ofs, float *quat, float *di vec[0]= vec[1] = 0.0; vec[2]= -(*dist); mul_m3_v3(tmat, vec); - sub_v3_v3v3(ofs, ofs, vec); + sub_v3_v3(ofs, vec); } /* Lens */ @@ -536,7 +536,7 @@ void viewline(ARegion *ar, View3D *v3d, float mval[2], float ray_start[3], float mul_v3_fl(vec, 1.0f / vec[3]); copy_v3_v3(ray_start, rv3d->viewinv[3]); - sub_v3_v3v3(vec, vec, ray_start); + sub_v3_v3(vec, ray_start); normalize_v3(vec); VECADDFAC(ray_start, rv3d->viewinv[3], vec, v3d->near); @@ -2044,12 +2044,12 @@ static int initFlyInfo (bContext *C, FlyInfo *fly, wmOperator *op, wmEvent *even if (fly->rv3d->persp==RV3D_ORTHO) fly->rv3d->persp= RV3D_PERSP; /*if ortho projection, make perspective */ QUATCOPY(fly->rot_backup, fly->rv3d->viewquat); - VECCOPY(fly->ofs_backup, fly->rv3d->ofs); - fly->rv3d->dist= 0.0; + copy_v3_v3(fly->ofs_backup, fly->rv3d->ofs); + fly->rv3d->dist= 0.0f; upvec[2]= fly->dist_backup; /*x and y are 0*/ mul_m3_v3(mat, upvec); - sub_v3_v3v3(fly->rv3d->ofs, fly->rv3d->ofs, upvec); + sub_v3_v3(fly->rv3d->ofs, upvec); /*Done with correcting for the dist*/ } diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 09e196c6d1a..7c98ca44fba 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -2145,7 +2145,7 @@ void initWarp(TransInfo *t) VECCOPY(center, t->data[i].center); mul_m3_v3(t->data[i].mtx, center); mul_m4_v3(t->viewmat, center); - sub_v3_v3v3(center, center, t->viewmat[3]); + sub_v3_v3(center, t->viewmat[3]); if (i) minmax_v3_v3v3(min, max, center); else { @@ -2201,12 +2201,12 @@ int Warp(TransInfo *t, short mval[2]) VECCOPY(cursor, curs); VECCOPY(gcursor, cursor); if (t->flag & T_EDIT) { - sub_v3_v3v3(cursor, cursor, t->obedit->obmat[3]); - sub_v3_v3v3(gcursor, gcursor, t->obedit->obmat[3]); + sub_v3_v3(cursor, t->obedit->obmat[3]); + sub_v3_v3(gcursor, t->obedit->obmat[3]); mul_m3_v3(t->data->smtx, gcursor); } mul_m4_v3(t->viewmat, cursor); - sub_v3_v3v3(cursor, cursor, t->viewmat[3]); + sub_v3_v3(cursor, t->viewmat[3]); /* amount of radians for warp */ circumfac = t->values[0]; @@ -2245,7 +2245,7 @@ int Warp(TransInfo *t, short mval[2]) VECCOPY(vec, td->iloc); mul_m3_v3(td->mtx, vec); mul_m4_v3(t->viewmat, vec); - sub_v3_v3v3(vec, vec, t->viewmat[3]); + sub_v3_v3(vec, t->viewmat[3]); dist= vec[0]-cursor[0]; @@ -2261,10 +2261,10 @@ int Warp(TransInfo *t, short mval[2]) loc[2]= vec[2]; mul_m4_v3(t->viewinv, loc); - sub_v3_v3v3(loc, loc, t->viewinv[3]); + sub_v3_v3(loc, t->viewinv[3]); mul_m3_v3(td->smtx, loc); - sub_v3_v3v3(loc, loc, td->iloc); + sub_v3_v3(loc, td->iloc); mul_v3_fl(loc, td->factor); add_v3_v3v3(td->loc, td->iloc, loc); } @@ -2390,7 +2390,7 @@ int Shear(TransInfo *t, short mval[2]) mul_m3_v3(tmat, vec); add_v3_v3(vec, t->center); - sub_v3_v3v3(vec, vec, td->center); + sub_v3_v3(vec, td->center); mul_v3_fl(vec, td->factor); @@ -2571,9 +2571,9 @@ static void ElementResize(TransInfo *t, TransData *td, float mat[3][3]) { add_v3_v3(vec, center); if (t->flag & T_POINTS) - sub_v3_v3v3(vec, vec, td->iloc); + sub_v3_v3(vec, td->iloc); else - sub_v3_v3v3(vec, vec, td->center); + sub_v3_v3(vec, td->center); mul_v3_fl(vec, td->factor); @@ -2935,7 +2935,7 @@ static void ElementRotation(TransInfo *t, TransData *td, float mat[3][3], short mul_m3_v3(mat, vec); add_v3_v3(vec, center); /* vec now is the location where the object has to be */ - sub_v3_v3v3(vec, vec, td->center); + sub_v3_v3(vec, td->center); mul_m3_v3(td->smtx, vec); protectedTransBits(td->protectflag, vec); @@ -3687,7 +3687,7 @@ int PushPull(TransInfo *t, short mval[2]) if (isLockConstraint(t)) { float dvec[3]; project_v3_v3v3(dvec, vec, axis); - sub_v3_v3v3(vec, vec, dvec); + sub_v3_v3(vec, dvec); } else { project_v3_v3v3(vec, vec, axis); diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index b745d396a48..338454f0e6a 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -206,7 +206,7 @@ static void sphere_do( if(flag & MOD_CAST_USE_OB_TRANSFORM) { mul_m4_v3(mat, tmp_co); } else { - sub_v3_v3v3(tmp_co, tmp_co, center); + sub_v3_v3(tmp_co, center); } } @@ -261,7 +261,7 @@ static void sphere_do( if(flag & MOD_CAST_USE_OB_TRANSFORM) { mul_m4_v3(mat, tmp_co); } else { - sub_v3_v3v3(tmp_co, tmp_co, center); + sub_v3_v3(tmp_co, center); } } @@ -413,7 +413,7 @@ static void cuboid_do( if(flag & MOD_CAST_USE_OB_TRANSFORM) { mul_m4_v3(mat, tmp_co); } else { - sub_v3_v3v3(tmp_co, tmp_co, center); + sub_v3_v3(tmp_co, center); } } diff --git a/source/blender/modifiers/intern/MOD_screw.c b/source/blender/modifiers/intern/MOD_screw.c index ce0667c4fbc..b70f145b67b 100644 --- a/source/blender/modifiers/intern/MOD_screw.c +++ b/source/blender/modifiers/intern/MOD_screw.c @@ -605,7 +605,7 @@ static DerivedMesh *applyModifier(ModifierData *md, Object *ob, * Use the edge order to make the subtraction, flip the normal the right way * edge should be there but check just in case... */ if (vc->e && vc->e[0]->v1 == i) { - sub_v3_v3v3(tmp_vec1, tmp_vec1, tmp_vec2); + sub_v3_v3(tmp_vec1, tmp_vec2); } else { sub_v3_v3v3(tmp_vec1, tmp_vec2, tmp_vec1); diff --git a/source/blender/nodes/intern/SHD_nodes/SHD_material.c b/source/blender/nodes/intern/SHD_nodes/SHD_material.c index 3182fca8272..4395eef0a5f 100644 --- a/source/blender/nodes/intern/SHD_nodes/SHD_material.c +++ b/source/blender/nodes/intern/SHD_nodes/SHD_material.c @@ -138,7 +138,7 @@ static void node_shader_exec_material(void *data, bNode *node, bNodeStack **in, if(node->custom1 & SH_NODE_MAT_DIFF) { VECCOPY(col, shrnode.combined); if(!(node->custom1 & SH_NODE_MAT_SPEC)) { - sub_v3_v3v3(col, col, shrnode.spec); + sub_v3_v3(col, shrnode.spec); } } else if(node->custom1 & SH_NODE_MAT_SPEC) { diff --git a/source/blender/render/intern/source/envmap.c b/source/blender/render/intern/source/envmap.c index 3ab03aaed78..1accb0fdb60 100644 --- a/source/blender/render/intern/source/envmap.c +++ b/source/blender/render/intern/source/envmap.c @@ -721,7 +721,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe add_v3_v3(vec, dxt); face1= envcube_isect(env, vec, sco); - sub_v3_v3v3(vec, vec, dxt); + sub_v3_v3(vec, dxt); if(face!=face1) { ibuf= env->cube[face1]; @@ -734,7 +734,7 @@ int envmaptex(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexRe add_v3_v3(vec, dyt); face1= envcube_isect(env, vec, sco); - sub_v3_v3v3(vec, vec, dyt); + sub_v3_v3(vec, dyt); if(face!=face1) { ibuf= env->cube[face1]; diff --git a/source/blender/render/intern/source/pointdensity.c b/source/blender/render/intern/source/pointdensity.c index d22b24bf544..6ae9038437b 100644 --- a/source/blender/render/intern/source/pointdensity.c +++ b/source/blender/render/intern/source/pointdensity.c @@ -142,9 +142,7 @@ static void pointdensity_cache_psys(Render *re, PointDensity *pd, Object *ob, Pa if (pd->psys_cache_space == TEX_PD_OBJECTSPACE) mul_m4_v3(ob->imat, partco); else if (pd->psys_cache_space == TEX_PD_OBJECTLOC) { - float obloc[3]; - VECCOPY(obloc, ob->loc); - sub_v3_v3v3(partco, partco, obloc); + sub_v3_v3(partco, ob->loc); } else { /* TEX_PD_WORLDSPACE */ } @@ -209,7 +207,7 @@ static void pointdensity_cache_object(Render *re, PointDensity *pd, Object *ob) break; case TEX_PD_OBJECTLOC: mul_m4_v3(ob->obmat, co); - sub_v3_v3v3(co, co, ob->loc); + sub_v3_v3(co, ob->loc); break; case TEX_PD_WORLDSPACE: default: |