Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-10-28 16:40:15 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-10-28 16:40:15 +0400
commit0d63bb005ff7c45ca0ebcfbe4eaf1215dfe2d3e2 (patch)
tree39e55a1385696d10833080d7482ada1e031f9bd9 /source/blender/editors
parent565fcd8907c4cbd105bef9330e13ccbd893a6f3e (diff)
replace VECCOPY and QUATCOPY with inline funcs.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/armature/poseSlide.c4
-rw-r--r--source/blender/editors/armature/poseUtils.c20
-rw-r--r--source/blender/editors/armature/poseobject.c26
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c4
-rw-r--r--source/blender/editors/object/object_constraint.c7
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c2
-rw-r--r--source/blender/editors/space_view3d/view3d_snap.c42
-rw-r--r--source/blender/editors/transform/transform.c4
-rw-r--r--source/blender/editors/transform/transform_conversions.c8
-rw-r--r--source/blender/editors/transform/transform_generics.c2
10 files changed, 60 insertions, 59 deletions
diff --git a/source/blender/editors/armature/poseSlide.c b/source/blender/editors/armature/poseSlide.c
index 0497c0507dc..efc8ffe4c7d 100644
--- a/source/blender/editors/armature/poseSlide.c
+++ b/source/blender/editors/armature/poseSlide.c
@@ -421,7 +421,7 @@ static void pose_slide_apply_quat (tPoseSlideOp *pso, tPChanFCurveLink *pfl)
sub_qt_qtqt(quat_diff, pchan->quat, quat_prev);
/* make a copy of the original rotation */
- QUATCOPY(quat_orig, pchan->quat);
+ copy_qt_qt(quat_orig, pchan->quat);
/* increase the original by the delta transform, by an amount determined by percentage */
add_qt_qtqt(pchan->quat, quat_orig, quat_diff, pso->percentage);
@@ -436,7 +436,7 @@ static void pose_slide_apply_quat (tPoseSlideOp *pso, tPChanFCurveLink *pfl)
interp_qt_qtqt(quat_interp, quat_prev, quat_next, (cframe-pso->prevFrame) / (pso->nextFrame-pso->prevFrame) );
/* make a copy of the original rotation */
- QUATCOPY(quat_orig, pchan->quat);
+ copy_qt_qt(quat_orig, pchan->quat);
/* tricky interpolations - blending between original and new */
interp_qt_qtqt(pchan->quat, quat_orig, quat_interp, 1.0f/6.0f);
diff --git a/source/blender/editors/armature/poseUtils.c b/source/blender/editors/armature/poseUtils.c
index 5c98fdc08bd..71cdda7fe15 100644
--- a/source/blender/editors/armature/poseUtils.c
+++ b/source/blender/editors/armature/poseUtils.c
@@ -111,11 +111,11 @@ static void fcurves_to_pchan_links_get (ListBase *pfLinks, Object *ob, bAction *
pchan->flag |= POSE_SIZE;
/* store current transforms */
- VECCOPY(pfl->oldloc, pchan->loc);
- VECCOPY(pfl->oldrot, pchan->eul);
- VECCOPY(pfl->oldscale, pchan->size);
- QUATCOPY(pfl->oldquat, pchan->quat);
- VECCOPY(pfl->oldaxis, pchan->rotAxis);
+ copy_v3_v3(pfl->oldloc, pchan->loc);
+ copy_v3_v3(pfl->oldrot, pchan->eul);
+ copy_v3_v3(pfl->oldscale, pchan->size);
+ copy_qt_qt(pfl->oldquat, pchan->quat);
+ copy_v3_v3(pfl->oldaxis, pchan->rotAxis);
pfl->oldangle = pchan->rotAngle;
/* make copy of custom properties */
@@ -205,11 +205,11 @@ void poseAnim_mapping_reset (ListBase *pfLinks)
bPoseChannel *pchan= pfl->pchan;
/* just copy all the values over regardless of whether they changed or not */
- VECCOPY(pchan->loc, pfl->oldloc);
- VECCOPY(pchan->eul, pfl->oldrot);
- VECCOPY(pchan->size, pfl->oldscale);
- QUATCOPY(pchan->quat, pfl->oldquat);
- VECCOPY(pchan->rotAxis, pfl->oldaxis);
+ copy_v3_v3(pchan->loc, pfl->oldloc);
+ copy_v3_v3(pchan->eul, pfl->oldrot);
+ copy_v3_v3(pchan->size, pfl->oldscale);
+ copy_qt_qt(pchan->quat, pfl->oldquat);
+ copy_v3_v3(pchan->rotAxis, pfl->oldaxis);
pchan->rotAngle = pfl->oldangle;
/* just overwrite values of properties from the stored copies (there should be some) */
diff --git a/source/blender/editors/armature/poseobject.c b/source/blender/editors/armature/poseobject.c
index beae9c12bfe..e89674e8a37 100644
--- a/source/blender/editors/armature/poseobject.c
+++ b/source/blender/editors/armature/poseobject.c
@@ -783,14 +783,14 @@ static void pose_copy_menu(Scene *scene)
{
switch (nr) {
case 1: /* Local Location */
- VECCOPY(pchan->loc, pchanact->loc);
+ copy_v3_v3(pchan->loc, pchanact->loc);
break;
case 2: /* Local Rotation */
- QUATCOPY(pchan->quat, pchanact->quat);
- VECCOPY(pchan->eul, pchanact->eul);
+ copy_qt_qt(pchan->quat, pchanact->quat);
+ copy_v3_v3(pchan->eul, pchanact->eul);
break;
case 3: /* Local Size */
- VECCOPY(pchan->size, pchanact->size);
+ copy_v3_v3(pchan->size, pchanact->size);
break;
case 4: /* All Constraints */
{
@@ -822,9 +822,9 @@ static void pose_copy_menu(Scene *scene)
case 7: /* IK (DOF) settings */
{
pchan->ikflag = pchanact->ikflag;
- VECCOPY(pchan->limitmin, pchanact->limitmin);
- VECCOPY(pchan->limitmax, pchanact->limitmax);
- VECCOPY(pchan->stiffness, pchanact->stiffness);
+ copy_v3_v3(pchan->limitmin, pchanact->limitmin);
+ copy_v3_v3(pchan->limitmax, pchanact->limitmax);
+ copy_v3_v3(pchan->stiffness, pchanact->stiffness);
pchan->ikstretch= pchanact->ikstretch;
pchan->ikrotweight= pchanact->ikrotweight;
pchan->iklinweight= pchanact->iklinweight;
@@ -861,7 +861,7 @@ static void pose_copy_menu(Scene *scene)
armature_mat_pose_to_bone(pchan, pchanact->pose_mat, delta_mat);
mat4_to_size( size,delta_mat);
- VECCOPY(pchan->size, size);
+ copy_v3_v3(pchan->size, size);
}
}
}
@@ -1014,22 +1014,22 @@ static bPoseChannel *pose_bone_do_paste (Object *ob, bPoseChannel *chan, short s
/* only loc rot size
* - only copies transform info for the pose
*/
- VECCOPY(pchan->loc, chan->loc);
- VECCOPY(pchan->size, chan->size);
+ copy_v3_v3(pchan->loc, chan->loc);
+ copy_v3_v3(pchan->size, chan->size);
pchan->flag= chan->flag;
/* check if rotation modes are compatible (i.e. do they need any conversions) */
if (pchan->rotmode == chan->rotmode) {
/* copy the type of rotation in use */
if (pchan->rotmode > 0) {
- VECCOPY(pchan->eul, chan->eul);
+ copy_v3_v3(pchan->eul, chan->eul);
}
else if (pchan->rotmode == ROT_MODE_AXISANGLE) {
- VECCOPY(pchan->rotAxis, chan->rotAxis);
+ copy_v3_v3(pchan->rotAxis, chan->rotAxis);
pchan->rotAngle = chan->rotAngle;
}
else {
- QUATCOPY(pchan->quat, chan->quat);
+ copy_qt_qt(pchan->quat, chan->quat);
}
}
else if (pchan->rotmode > 0) {
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 07858f7182c..64da61f8f55 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -580,8 +580,8 @@ static void gp_draw_data (bGPdata *gpd, int offsx, int offsy, int winx, int winy
/* set color, stroke thickness, and point size */
glLineWidth(lthick);
- QUATCOPY(color, gpl->color); // just for copying 4 array elements
- QUATCOPY(tcolor, gpl->color); // additional copy of color (for ghosting)
+ copy_v4_v4(color, gpl->color); // just for copying 4 array elements
+ copy_v4_v4(tcolor, gpl->color); // additional copy of color (for ghosting)
glColor4fv(color);
glPointSize((float)(gpl->thickness + 2));
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index ab9c071ab30..50b798c5bea 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -1268,9 +1268,10 @@ static short get_new_constraint_target(bContext *C, int con_type, Object **tar_o
else
mul_v3_m4v3(obt->loc, obact->obmat, pchanact->pose_head);
}
- else
- VECCOPY(obt->loc, obact->obmat[3]);
-
+ else {
+ copy_v3_v3(obt->loc, obact->obmat[3]);
+ }
+
/* restore, add_object sets active */
BASACT= base;
base->flag |= SELECT;
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index e08f6fcbffa..d49ce0cf49a 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -5583,7 +5583,7 @@ static int texture_paint_image_from_view_exec(bContext *C, wmOperator *op)
if(h > maxsize) h= maxsize;
ibuf= ED_view3d_draw_offscreen_imbuf(CTX_data_scene(C), CTX_wm_view3d(C), CTX_wm_region(C), w, h, IB_rect, err_out);
- if(!ibuf || 1) {
+ if(!ibuf) {
/* Mostly happens when OpenGL offscreen buffer was failed to create, */
/* but could be other reasons. Should be handled in the future. nazgul */
BKE_reportf(op->reports, RPT_ERROR, "Failed to create OpenGL offscreen buffer: %s", err_out);
diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c
index 8000a3b03f1..1b726cd90b3 100644
--- a/source/blender/editors/space_view3d/view3d_snap.c
+++ b/source/blender/editors/space_view3d/view3d_snap.c
@@ -168,11 +168,11 @@ static void special_transvert_update(Object *obedit)
if ((ebo->flag & BONE_CONNECTED) && ebo->parent){
/* If this bone has a parent tip that has been moved */
if (ebo->parent->flag & BONE_TIPSEL){
- VECCOPY (ebo->head, ebo->parent->tail);
+ copy_v3_v3(ebo->head, ebo->parent->tail);
}
/* If this bone has a parent tip that has NOT been moved */
else{
- VECCOPY (ebo->parent->tail, ebo->head);
+ copy_v3_v3(ebo->parent->tail, ebo->head);
}
}
}
@@ -250,7 +250,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
for(eve= em->verts.first; eve; eve= eve->next) {
if(eve->f1) {
- VECCOPY(tv->oldloc, eve->co);
+ copy_v3_v3(tv->oldloc, eve->co);
tv->loc= eve->co;
if(eve->no[0] != 0.0f || eve->no[1] != 0.0f ||eve->no[2] != 0.0f)
tv->nor= eve->no; // note this is a hackish signal (ton)
@@ -280,7 +280,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
* location as heads.
*/
if (rootok) {
- VECCOPY (tv->oldloc, ebo->head);
+ copy_v3_v3(tv->oldloc, ebo->head);
tv->loc= ebo->head;
tv->nor= NULL;
tv->flag= 1;
@@ -289,7 +289,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
if ((mode & TM_ALL_JOINTS) && (tipsel)) {
- VECCOPY (tv->oldloc, ebo->tail);
+ copy_v3_v3(tv->oldloc, ebo->tail);
tv->loc= ebo->tail;
tv->nor= NULL;
tv->flag= 1;
@@ -298,7 +298,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
}
}
else if (tipsel) {
- VECCOPY (tv->oldloc, ebo->tail);
+ copy_v3_v3(tv->oldloc, ebo->tail);
tv->loc= ebo->tail;
tv->nor= NULL;
tv->flag= 1;
@@ -333,14 +333,14 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
skip_handle= mode & TM_SKIP_HANDLES;
if((bezt->f1 & SELECT) && !skip_handle) {
- VECCOPY(tv->oldloc, bezt->vec[0]);
+ copy_v3_v3(tv->oldloc, bezt->vec[0]);
tv->loc= bezt->vec[0];
tv->flag= bezt->f1 & SELECT;
tv++;
tottrans++;
}
if(bezt->f2 & SELECT) {
- VECCOPY(tv->oldloc, bezt->vec[1]);
+ copy_v3_v3(tv->oldloc, bezt->vec[1]);
tv->loc= bezt->vec[1];
tv->val= &(bezt->alfa);
tv->oldval= bezt->alfa;
@@ -349,7 +349,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
tottrans++;
}
if((bezt->f3 & SELECT) && !skip_handle) {
- VECCOPY(tv->oldloc, bezt->vec[2]);
+ copy_v3_v3(tv->oldloc, bezt->vec[2]);
tv->loc= bezt->vec[2];
tv->flag= bezt->f3 & SELECT;
tv++;
@@ -365,7 +365,7 @@ static void make_trans_verts(Object *obedit, float *min, float *max, int mode)
while(a--) {
if(bp->hide==0) {
if(bp->f1 & SELECT) {
- VECCOPY(tv->oldloc, bp->vec);
+ copy_v3_v3(tv->oldloc, bp->vec);
tv->loc= bp->vec;
tv->val= &(bp->alfa);
tv->oldval= bp->alfa;
@@ -474,7 +474,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
tv= transvmain;
for(a=0; a<tottrans; a++, tv++) {
- VECCOPY(vec, tv->loc);
+ copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
vec[0]= gridf*floorf(0.5f+ vec[0]/gridf);
@@ -483,7 +483,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
sub_v3_v3(vec, obedit->obmat[3]);
mul_m3_v3(imat, vec);
- VECCOPY(tv->loc, vec);
+ copy_v3_v3(tv->loc, vec);
}
special_transvert_update(obedit);
@@ -507,7 +507,7 @@ static int snap_sel_to_grid(bContext *C, wmOperator *UNUSED(op))
float vecN[3], nLoc[3];
/* get nearest grid point to snap to */
- VECCOPY(nLoc, pchan->pose_mat[3]);
+ copy_v3_v3(nLoc, pchan->pose_mat[3]);
vec[0]= gridf * (float)(floor(0.5f+ nLoc[0]/gridf));
vec[1]= gridf * (float)(floor(0.5f+ nLoc[1]/gridf));
vec[2]= gridf * (float)(floor(0.5f+ nLoc[2]/gridf));
@@ -632,7 +632,7 @@ static int snap_sel_to_curs(bContext *C, wmOperator *UNUSED(op))
float cursp[3];
invert_m4_m4(ob->imat, ob->obmat);
- VECCOPY(cursp, curs);
+ copy_v3_v3(cursp, curs);
mul_m4_v3(ob->imat, cursp);
for (pchan = ob->pose->chanbase.first; pchan; pchan=pchan->next) {
@@ -779,7 +779,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
tv= transvmain;
for(a=0; a<tottrans; a++, tv++) {
- VECCOPY(vec, tv->loc);
+ copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
add_v3_v3(centroid, vec);
@@ -788,7 +788,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
if(v3d->around==V3D_CENTROID) {
mul_v3_fl(centroid, 1.0f/(float)tottrans);
- VECCOPY(curs, centroid);
+ copy_v3_v3(curs, centroid);
}
else {
mid_v3_v3v3(curs, min, max);
@@ -805,7 +805,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
for (pchan = obact->pose->chanbase.first; pchan; pchan=pchan->next) {
if(arm->layer & pchan->bone->layer) {
if(pchan->bone->flag & BONE_SELECTED) {
- VECCOPY(vec, pchan->pose_head);
+ copy_v3_v3(vec, pchan->pose_head);
mul_m4_v3(obact->obmat, vec);
add_v3_v3(centroid, vec);
DO_MINMAX(vec, min, max);
@@ -816,7 +816,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
}
else {
CTX_DATA_BEGIN(C, Object*, ob, selected_objects) {
- VECCOPY(vec, ob->obmat[3]);
+ copy_v3_v3(vec, ob->obmat[3]);
add_v3_v3(centroid, vec);
DO_MINMAX(vec, min, max);
count++;
@@ -826,7 +826,7 @@ static int snap_curs_to_sel(bContext *C, wmOperator *UNUSED(op))
if(count) {
if(v3d->around==V3D_CENTROID) {
mul_v3_fl(centroid, 1.0f/(float)count);
- VECCOPY(curs, centroid);
+ copy_v3_v3(curs, centroid);
}
else {
mid_v3_v3v3(curs, min, max);
@@ -881,7 +881,7 @@ static int snap_curs_to_active(bContext *C, wmOperator *UNUSED(op))
}
else {
if (obact) {
- VECCOPY(curs, obact->obmat[3]);
+ copy_v3_v3(curs, obact->obmat[3]);
}
}
@@ -958,7 +958,7 @@ int minmax_verts(Object *obedit, float *min, float *max)
tv= transvmain;
for(a=0; a<tottrans; a++, tv++) {
- VECCOPY(vec, tv->loc);
+ copy_v3_v3(vec, tv->loc);
mul_m3_v3(bmat, vec);
add_v3_v3(vec, obedit->obmat[3]);
add_v3_v3(centroid, vec);
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c
index 2fc1182a280..9c1d5adcd1b 100644
--- a/source/blender/editors/transform/transform.c
+++ b/source/blender/editors/transform/transform.c
@@ -1690,8 +1690,8 @@ int initTransform(bContext *C, TransInfo *t, wmOperator *op, wmEvent *event, int
values[0]= RNA_float_get(op->ptr, "value");
}
- QUATCOPY(t->values, values);
- QUATCOPY(t->auto_values, values);
+ copy_v4_v4(t->values, values);
+ copy_v4_v4(t->auto_values, values);
t->flag |= T_AUTOVALUES;
}
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c
index a9f9208346c..6de854ff6c9 100644
--- a/source/blender/editors/transform/transform_conversions.c
+++ b/source/blender/editors/transform/transform_conversions.c
@@ -555,7 +555,7 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr
td->ext->rotAngle= NULL;
td->ext->quat= pchan->quat;
- QUATCOPY(td->ext->iquat, pchan->quat);
+ copy_qt_qt(td->ext->iquat, pchan->quat);
}
td->ext->rotOrder= pchan->rotmode;
@@ -1305,7 +1305,7 @@ static void createTransMBallVerts(TransInfo *t)
/* quat is used for rotation of MetaElem */
tx->quat = ml->quat;
- QUATCOPY(tx->iquat, ml->quat);
+ copy_qt_qt(tx->iquat, ml->quat);
tx->rot = NULL;
@@ -4299,8 +4299,8 @@ static void ObjectToTransData(TransInfo *t, TransData *td, Object *ob)
td->ext->rotAngle= NULL;
td->ext->quat= ob->quat;
- QUATCOPY(td->ext->iquat, ob->quat);
- QUATCOPY(td->ext->dquat, ob->dquat);
+ copy_qt_qt(td->ext->iquat, ob->quat);
+ copy_qt_qt(td->ext->dquat, ob->dquat);
}
td->ext->rotOrder=ob->rotmode;
diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c
index 103556accd8..2c69cc85214 100644
--- a/source/blender/editors/transform/transform_generics.c
+++ b/source/blender/editors/transform/transform_generics.c
@@ -1299,7 +1299,7 @@ static void restoreElement(TransData *td)
copy_v3_v3(td->ext->size, td->ext->isize);
}
if (td->ext->quat) {
- QUATCOPY(td->ext->quat, td->ext->iquat);
+ copy_qt_qt(td->ext->quat, td->ext->iquat);
}
}