replace macros for bli math functions in editors

This commit is contained in:
2011-11-06 16:34:44 +00:00
parent 3d1e45c414
commit 7c88bc5952
13 changed files with 97 additions and 97 deletions

View File

@@ -1241,8 +1241,8 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, float
memset(&isec, 0, sizeof(isec));
isec.labda= 1e10f;
VECADD(isec.start, co1, epsilon);
VECADD(end, co2, epsilon);
add_v3_v3v3(isec.start, co1, epsilon);
add_v3_v3v3(end, co2, epsilon);
sub_v3_v3v3(isec.vec, end, isec.start);
if(meshdeform_intersect(mdb, &isec)) {

View File

@@ -944,7 +944,7 @@ static void ui_apply_button(bContext *C, uiBlock *block, uiBut *but, uiHandleBut
data->origstr= NULL;
data->value= data->origvalue;
data->origvalue= 0.0;
VECCOPY(data->vec, data->origvec);
copy_v3_v3(data->vec, data->origvec);
data->origvec[0]= data->origvec[1]= data->origvec[2]= 0.0f;
}
else {
@@ -2121,7 +2121,7 @@ static void ui_blockopen_begin(bContext *C, uiBut *but, uiHandleButtonData *data
break;
case COL:
ui_get_but_vectorf(but, data->origvec);
VECCOPY(data->vec, data->origvec);
copy_v3_v3(data->vec, data->origvec);
but->editvec= data->vec;
handlefunc= ui_block_func_COL;
@@ -5727,7 +5727,7 @@ static void ui_handle_button_return_submenu(bContext *C, wmEvent *event, uiBut *
/* copy over return values from the closing menu */
if(menu->menuretval == UI_RETURN_OK || menu->menuretval == UI_RETURN_UPDATE) {
if(but->type == COL)
VECCOPY(data->vec, menu->retvec)
copy_v3_v3(data->vec, menu->retvec);
else if(ELEM3(but->type, MENU, ICONROW, ICONTEXTROW))
data->value= menu->retvalue;
}

View File

@@ -2126,7 +2126,7 @@ uiBlock *ui_block_func_COL(bContext *C, uiPopupBlockHandle *handle, void *arg_bu
uiBlockSetFlag(block, UI_BLOCK_MOVEMOUSE_QUIT);
VECCOPY(handle->retvec, but->editvec);
copy_v3_v3(handle->retvec, but->editvec);
uiBlockPicker(block, handle->retvec, &but->rnapoin, but->rnaprop);

View File

@@ -1874,38 +1874,38 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha)
break;
case UI_GRAD_H:
hsv_to_rgb(0.0, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]);
VECCOPY(col1[1], col1[0]);
VECCOPY(col1[2], col1[0]);
VECCOPY(col1[3], col1[0]);
copy_v3_v3(col1[1], col1[0]);
copy_v3_v3(col1[2], col1[0]);
copy_v3_v3(col1[3], col1[0]);
break;
case UI_GRAD_S:
hsv_to_rgb(1.0, 0.0, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]);
VECCOPY(col1[0], col1[1]);
VECCOPY(col1[2], col1[1]);
VECCOPY(col1[3], col1[1]);
copy_v3_v3(col1[0], col1[1]);
copy_v3_v3(col1[2], col1[1]);
copy_v3_v3(col1[3], col1[1]);
break;
case UI_GRAD_V:
hsv_to_rgb(1.0, 1.0, 0.0, &col1[2][0], &col1[2][1], &col1[2][2]);
VECCOPY(col1[0], col1[2]);
VECCOPY(col1[1], col1[2]);
VECCOPY(col1[3], col1[2]);
copy_v3_v3(col1[0], col1[2]);
copy_v3_v3(col1[1], col1[2]);
copy_v3_v3(col1[3], col1[2]);
break;
default:
assert(!"invalid 'type' argument");
hsv_to_rgb(1.0, 1.0, 1.0, &col1[2][0], &col1[2][1], &col1[2][2]);
VECCOPY(col1[0], col1[2]);
VECCOPY(col1[1], col1[2]);
VECCOPY(col1[3], col1[2]);
copy_v3_v3(col1[0], col1[2]);
copy_v3_v3(col1[1], col1[2]);
copy_v3_v3(col1[3], col1[2]);
}
/* old below */
for(dx=0.0f; dx<1.0f; dx+= 0.05f) {
// previous color
VECCOPY(col0[0], col1[0]);
VECCOPY(col0[1], col1[1]);
VECCOPY(col0[2], col1[2]);
VECCOPY(col0[3], col1[3]);
copy_v3_v3(col0[0], col1[0]);
copy_v3_v3(col0[1], col1[1]);
copy_v3_v3(col0[2], col1[2]);
copy_v3_v3(col0[3], col1[3]);
// new color
switch(type) {
@@ -1929,21 +1929,21 @@ void ui_draw_gradient(rcti *rect, float *hsv, int type, float alpha)
break;
case UI_GRAD_H:
hsv_to_rgb(dx, 1.0, 1.0, &col1[0][0], &col1[0][1], &col1[0][2]);
VECCOPY(col1[1], col1[0]);
VECCOPY(col1[2], col1[0]);
VECCOPY(col1[3], col1[0]);
copy_v3_v3(col1[1], col1[0]);
copy_v3_v3(col1[2], col1[0]);
copy_v3_v3(col1[3], col1[0]);
break;
case UI_GRAD_S:
hsv_to_rgb(h, dx, 1.0, &col1[1][0], &col1[1][1], &col1[1][2]);
VECCOPY(col1[0], col1[1]);
VECCOPY(col1[2], col1[1]);
VECCOPY(col1[3], col1[1]);
copy_v3_v3(col1[0], col1[1]);
copy_v3_v3(col1[2], col1[1]);
copy_v3_v3(col1[3], col1[1]);
break;
case UI_GRAD_V:
hsv_to_rgb(h, 1.0, dx, &col1[2][0], &col1[2][1], &col1[2][2]);
VECCOPY(col1[0], col1[2]);
VECCOPY(col1[1], col1[2]);
VECCOPY(col1[3], col1[2]);
copy_v3_v3(col1[0], col1[2]);
copy_v3_v3(col1[1], col1[2]);
copy_v3_v3(col1[3], col1[2]);
break;
}

View File

@@ -1130,19 +1130,19 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->recalc |= OB_RECALC_OB;
if(event==1) { /* loc */
VECCOPY(base->object->loc, ob->loc);
VECCOPY(base->object->dloc, ob->dloc);
copy_v3_v3(base->object->loc, ob->loc);
copy_v3_v3(base->object->dloc, ob->dloc);
}
else if(event==2) { /* rot */
VECCOPY(base->object->rot, ob->rot);
VECCOPY(base->object->drot, ob->drot);
copy_v3_v3(base->object->rot, ob->rot);
copy_v3_v3(base->object->drot, ob->drot);
QUATCOPY(base->object->quat, ob->quat);
QUATCOPY(base->object->dquat, ob->dquat);
copy_qt_qt(base->object->quat, ob->quat);
copy_qt_qt(base->object->dquat, ob->dquat);
}
else if(event==3) { /* size */
VECCOPY(base->object->size, ob->size);
VECCOPY(base->object->dsize, ob->dsize);
copy_v3_v3(base->object->size, ob->size);
copy_v3_v3(base->object->dsize, ob->dsize);
}
else if(event==4) { /* drawtype */
base->object->dt= ob->dt;
@@ -1331,7 +1331,7 @@ static void copy_attr(Main *bmain, Scene *scene, View3D *v3d, short event)
base->object->index= ob->index;
}
else if(event==31) { /* object color */
QUATCOPY(base->object->col, ob->col);
copy_v4_v4(base->object->col, ob->col);
}
}
}

View File

@@ -133,7 +133,7 @@ static void object_clear_rot(Object *ob)
float eul[3], oldeul[3], quat1[4] = {0};
if (ob->rotmode == ROT_MODE_QUAT) {
QUATCOPY(quat1, ob->quat);
copy_qt_qt(quat1, ob->quat);
quat_to_eul(oldeul, ob->quat);
}
else if (ob->rotmode == ROT_MODE_AXISANGLE) {

View File

@@ -607,7 +607,7 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w
best_face_index = face_index;
best_side = 0;
z_depth_best = z_depth;
VECCOPY(w, w_tmp);
copy_v3_v3(w, w_tmp);
}
}
else if (mf->v4) {
@@ -621,7 +621,7 @@ static int project_paint_PickFace(const ProjPaintState *ps, float pt[2], float w
best_face_index = face_index;
best_side= 1;
z_depth_best = z_depth;
VECCOPY(w, w_tmp);
copy_v3_v3(w, w_tmp);
}
}
}
@@ -722,7 +722,7 @@ static int project_paint_PickColor(const ProjPaintState *ps, float pt[2], float
if (rgba_fp) {
if (ibuf->rect_float) {
QUATCOPY(rgba_fp, ((float *)ibuf->rect_float + ((xi + yi * ibuf->x) * 4)));
copy_v4_v4(rgba_fp, ((float *)ibuf->rect_float + ((xi + yi * ibuf->x) * 4)));
}
else {
char *tmp_ch= ((char *)ibuf->rect) + ((xi + yi * ibuf->x) * 4);
@@ -1431,7 +1431,7 @@ static ProjPixel *project_paint_uvpixel_init(
}
/* screenspace unclamped, we could keep its z and w values but dont need them at the moment */
VECCOPY2D(projPixel->projCoSS, pixelScreenCo);
copy_v2_v2(projPixel->projCoSS, pixelScreenCo);
projPixel->x_px = x_px;
projPixel->y_px = y_px;
@@ -1530,8 +1530,8 @@ static int line_clip_rect2f(
if (fabsf(l1[0]-l2[0]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
if (BLI_in_rctf(rect, l1[0], l1[1])) {
VECCOPY2D(l1_clip, l1);
VECCOPY2D(l2_clip, l2);
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
return 1;
}
else {
@@ -1539,8 +1539,8 @@ static int line_clip_rect2f(
}
}
VECCOPY2D(l1_clip, l1);
VECCOPY2D(l2_clip, l2);
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
CLAMP(l1_clip[0], rect->xmin, rect->xmax);
CLAMP(l2_clip[0], rect->xmin, rect->xmax);
return 1;
@@ -1558,8 +1558,8 @@ static int line_clip_rect2f(
if (fabsf(l1[1]-l2[1]) < PROJ_GEOM_TOLERANCE) { /* this is a single point (or close to)*/
if (BLI_in_rctf(rect, l1[0], l1[1])) {
VECCOPY2D(l1_clip, l1);
VECCOPY2D(l2_clip, l2);
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
return 1;
}
else {
@@ -1567,8 +1567,8 @@ static int line_clip_rect2f(
}
}
VECCOPY2D(l1_clip, l1);
VECCOPY2D(l2_clip, l2);
copy_v2_v2(l1_clip, l1);
copy_v2_v2(l2_clip, l2);
CLAMP(l1_clip[1], rect->ymin, rect->ymax);
CLAMP(l2_clip[1], rect->ymin, rect->ymax);
return 1;
@@ -1582,12 +1582,12 @@ static int line_clip_rect2f(
/* are either of the points inside the rectangle ? */
if (BLI_in_rctf(rect, l1[0], l1[1])) {
VECCOPY2D(l1_clip, l1);
copy_v2_v2(l1_clip, l1);
ok1 = 1;
}
if (BLI_in_rctf(rect, l2[0], l2[1])) {
VECCOPY2D(l2_clip, l2);
copy_v2_v2(l2_clip, l2);
ok2 = 1;
}
@@ -1912,14 +1912,14 @@ static void project_bucket_clip_face(
if (inside_bucket_flag == ISECT_ALL3) {
/* all screenspace points are inside the bucket bounding box, this means we dont need to clip and can simply return the UVs */
if (flip) { /* facing the back? */
VECCOPY2D(bucket_bounds_uv[0], uv3co);
VECCOPY2D(bucket_bounds_uv[1], uv2co);
VECCOPY2D(bucket_bounds_uv[2], uv1co);
copy_v2_v2(bucket_bounds_uv[0], uv3co);
copy_v2_v2(bucket_bounds_uv[1], uv2co);
copy_v2_v2(bucket_bounds_uv[2], uv1co);
}
else {
VECCOPY2D(bucket_bounds_uv[0], uv1co);
VECCOPY2D(bucket_bounds_uv[1], uv2co);
VECCOPY2D(bucket_bounds_uv[2], uv3co);
copy_v2_v2(bucket_bounds_uv[0], uv1co);
copy_v2_v2(bucket_bounds_uv[1], uv2co);
copy_v2_v2(bucket_bounds_uv[2], uv3co);
}
*tot = 3;
@@ -1983,33 +1983,33 @@ static void project_bucket_clip_face(
(*tot) = 0;
if (inside_face_flag & ISECT_1) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[0]); (*tot)++; }
if (inside_face_flag & ISECT_2) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[1]); (*tot)++; }
if (inside_face_flag & ISECT_3) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[2]); (*tot)++; }
if (inside_face_flag & ISECT_4) { VECCOPY2D(isectVCosSS[*tot], bucket_bounds_ss[3]); (*tot)++; }
if (inside_face_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[0]); (*tot)++; }
if (inside_face_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[1]); (*tot)++; }
if (inside_face_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[2]); (*tot)++; }
if (inside_face_flag & ISECT_4) { copy_v2_v2(isectVCosSS[*tot], bucket_bounds_ss[3]); (*tot)++; }
if (inside_bucket_flag & ISECT_1) { VECCOPY2D(isectVCosSS[*tot], v1coSS); (*tot)++; }
if (inside_bucket_flag & ISECT_2) { VECCOPY2D(isectVCosSS[*tot], v2coSS); (*tot)++; }
if (inside_bucket_flag & ISECT_3) { VECCOPY2D(isectVCosSS[*tot], v3coSS); (*tot)++; }
if (inside_bucket_flag & ISECT_1) { copy_v2_v2(isectVCosSS[*tot], v1coSS); (*tot)++; }
if (inside_bucket_flag & ISECT_2) { copy_v2_v2(isectVCosSS[*tot], v2coSS); (*tot)++; }
if (inside_bucket_flag & ISECT_3) { copy_v2_v2(isectVCosSS[*tot], v3coSS); (*tot)++; }
if ((inside_bucket_flag & (ISECT_1|ISECT_2)) != (ISECT_1|ISECT_2)) {
if (line_clip_rect2f(bucket_bounds, v1coSS, v2coSS, v1_clipSS, v2_clipSS)) {
if ((inside_bucket_flag & ISECT_1)==0) { VECCOPY2D(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_2)==0) { VECCOPY2D(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_1)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_2)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
}
}
if ((inside_bucket_flag & (ISECT_2|ISECT_3)) != (ISECT_2|ISECT_3)) {
if (line_clip_rect2f(bucket_bounds, v2coSS, v3coSS, v1_clipSS, v2_clipSS)) {
if ((inside_bucket_flag & ISECT_2)==0) { VECCOPY2D(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_3)==0) { VECCOPY2D(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_2)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_3)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
}
}
if ((inside_bucket_flag & (ISECT_3|ISECT_1)) != (ISECT_3|ISECT_1)) {
if (line_clip_rect2f(bucket_bounds, v3coSS, v1coSS, v1_clipSS, v2_clipSS)) {
if ((inside_bucket_flag & ISECT_3)==0) { VECCOPY2D(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_1)==0) { VECCOPY2D(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_3)==0) { copy_v2_v2(isectVCosSS[*tot], v1_clipSS); (*tot)++; }
if ((inside_bucket_flag & ISECT_1)==0) { copy_v2_v2(isectVCosSS[*tot], v2_clipSS); (*tot)++; }
}
}
@@ -2538,8 +2538,8 @@ static void project_paint_face_init(const ProjPaintState *ps, const int thread_i
//fac = line_point_factor_v2(uv, uv_seam_quad[0], uv_seam_quad[1]);
fac = line_point_factor_v2(uv, seam_subsection[0], seam_subsection[1]);
if (fac < 0.0f) { VECCOPY(pixelScreenCo, edge_verts_inset_clip[0]); }
else if (fac > 1.0f) { VECCOPY(pixelScreenCo, edge_verts_inset_clip[1]); }
if (fac < 0.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[0]); }
else if (fac > 1.0f) { copy_v3_v3(pixelScreenCo, edge_verts_inset_clip[1]); }
else { interp_v3_v3v3(pixelScreenCo, edge_verts_inset_clip[0], edge_verts_inset_clip[1], fac); }
if (!is_ortho) {
@@ -3035,7 +3035,7 @@ static void project_paint_begin(ProjPaintState *ps)
normalize_v3(ps->viewDir);
/* viewPos - object relative */
VECCOPY(ps->viewPos, viewinv[3]);
copy_v3_v3(ps->viewPos, viewinv[3]);
copy_m3_m4(mat, ps->ob->imat);
mul_m3_v3(mat, ps->viewPos);
add_v3_v3(ps->viewPos, ps->ob->imat[3]);
@@ -3393,7 +3393,7 @@ static void project_paint_end(ProjPaintState *ps)
if (is_float) {
float *rgba_fp = (float *)tilerect + (((projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE)) * 4;
QUATCOPY(rgba_fp, projPixel->origColor.f);
copy_v4_v4(rgba_fp, projPixel->origColor.f);
}
else {
((unsigned int *)tilerect)[ (projPixel->x_px - x_round) + (projPixel->y_px - y_round) * IMAPAINT_TILE_SIZE ] = projPixel->origColor.uint;
@@ -3728,7 +3728,7 @@ static void do_projectpaint_draw_f(ProjPaintState *ps, ProjPixel *projPixel, flo
srgb_to_linearrgb_v3_v3(rgba, ps->brush->rgb);
}
else {
VECCOPY(rgba, ps->brush->rgb);
copy_v3_v3(rgba, ps->brush->rgb);
}
rgba[3] = 1.0;
}

View File

@@ -124,7 +124,7 @@ float paint_get_tex_pixel(Brush* br, float u, float v)
static void imapaint_project(Object *ob, float *model, float *proj, float *co, float *pco)
{
VECCOPY(pco, co);
copy_v3_v3(pco, co);
pco[3]= 1.0f;
mul_m4_v3(ob->obmat, pco);
@@ -166,7 +166,7 @@ static void imapaint_tri_weights(Object *ob, float *v1, float *v2, float *v3, fl
invert_m3_m3(invwmat, wmat);
mul_m3_v3(invwmat, h);
VECCOPY(w, h);
copy_v3_v3(w, h);
/* w is still divided by perspdiv, make it sum to one */
divw= w[0] + w[1] + w[2];

View File

@@ -2320,7 +2320,7 @@ void sculpt_vertcos_to_key(Object *ob, KeyBlock *kb, float (*vertCos)[3])
MVert *mvert= me->mvert;
for (a= 0; a < me->totvert; a++, mvert++)
VECCOPY(mvert->co, vertCos[a]);
copy_v3_v3(mvert->co, vertCos[a]);
mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
}

View File

@@ -4847,7 +4847,7 @@ int doEdgeSlide(TransInfo *t, float perc)
interp_v2_v2v2(uv_tmp, suv->origuv, (perc>=0)?suv->uv_up:suv->uv_down, fabs(perc));
fuv_link = suv->fuv_list;
while (fuv_link) {
VECCOPY2D(((float *)fuv_link->link), uv_tmp);
copy_v2_v2(((float *)fuv_link->link), uv_tmp);
fuv_link = fuv_link->next;
}
}
@@ -4878,7 +4878,7 @@ int doEdgeSlide(TransInfo *t, float perc)
interp_v2_v2v2(uv_tmp, suv->uv_down, suv->uv_up, fabs(newlen));
fuv_link = suv->fuv_list;
while (fuv_link) {
VECCOPY2D(((float *)fuv_link->link), uv_tmp);
copy_v2_v2(((float *)fuv_link->link), uv_tmp);
fuv_link = fuv_link->next;
}
}
@@ -4895,7 +4895,7 @@ int doEdgeSlide(TransInfo *t, float perc)
interp_v2_v2v2(uv_tmp, suv->uv_up, suv->uv_down, fabs(newlen));
fuv_link = suv->fuv_list;
while (fuv_link) {
VECCOPY2D(((float *)fuv_link->link), uv_tmp);
copy_v2_v2(((float *)fuv_link->link), uv_tmp);
fuv_link = fuv_link->next;
}
}

View File

@@ -2960,8 +2960,8 @@ static TransData *ActionFCurveToTransData(TransData *td, TransData2D **td2dv, FC
td2d->h1 = bezt->vec[0];
td2d->h2 = bezt->vec[2];
VECCOPY2D(td2d->ih1, td2d->h1);
VECCOPY2D(td2d->ih2, td2d->h2);
copy_v2_v2(td2d->ih1, td2d->h1);
copy_v2_v2(td2d->ih2, td2d->h2);
td++;
td2d++;
@@ -3217,14 +3217,14 @@ static void bezt_to_transdata (TransData *td, TransData2D *td2d, AnimData *adt,
if (td->flag & TD_MOVEHANDLE1) {
td2d->h1 = bezt->vec[0];
VECCOPY2D(td2d->ih1, td2d->h1);
copy_v2_v2(td2d->ih1, td2d->h1);
}
else
td2d->h1 = NULL;
if (td->flag & TD_MOVEHANDLE2) {
td2d->h2 = bezt->vec[2];
VECCOPY2D(td2d->ih2, td2d->h2);
copy_v2_v2(td2d->ih2, td2d->h2);
}
else
td2d->h2 = NULL;

View File

@@ -606,9 +606,9 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
{
if(efa->f & SELECT)
{
VECADD(normal, normal, efa->n);
add_v3_v3(normal, efa->n);
sub_v3_v3v3(vec, efa->v2->co, efa->v1->co);
VECADD(plane, plane, vec);
add_v3_v3(plane, vec);
}
}
@@ -662,7 +662,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
if(eed->f & SELECT) {
/* use average vert normals as plane and edge vector as normal */
copy_v3_v3(plane, eed->v1->no);
VECADD(plane, plane, eed->v2->no);
add_v3_v3(plane, eed->v2->no);
sub_v3_v3v3(normal, eed->v2->co, eed->v1->co);
break;
}
@@ -683,7 +683,7 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3],
v2 = eve;
copy_v3_v3(plane, v1->no);
VECADD(plane, plane, v2->no);
add_v3_v3(plane, v2->no);
sub_v3_v3v3(normal, v2->co, v1->co);
break;
}

View File

@@ -2530,11 +2530,11 @@ static int snap_uvs_to_cursor(Scene *scene, Image *ima, Object *obedit, SpaceIma
for(efa= em->faces.first; efa; efa= efa->next) {
tface= CustomData_em_get(&em->fdata, efa->data, CD_MTFACE);
if(uvedit_face_visible(scene, ima, efa, tface)) {
if(uvedit_uv_selected(scene, efa, tface, 0)) VECCOPY2D(tface->uv[0], sima->cursor);
if(uvedit_uv_selected(scene, efa, tface, 1)) VECCOPY2D(tface->uv[1], sima->cursor);
if(uvedit_uv_selected(scene, efa, tface, 2)) VECCOPY2D(tface->uv[2], sima->cursor);
if(uvedit_uv_selected(scene, efa, tface, 0)) copy_v2_v2(tface->uv[0], sima->cursor);
if(uvedit_uv_selected(scene, efa, tface, 1)) copy_v2_v2(tface->uv[1], sima->cursor);
if(uvedit_uv_selected(scene, efa, tface, 2)) copy_v2_v2(tface->uv[2], sima->cursor);
if(efa->v4)
if(uvedit_uv_selected(scene, efa, tface, 3)) VECCOPY2D(tface->uv[3], sima->cursor);
if(uvedit_uv_selected(scene, efa, tface, 3)) copy_v2_v2(tface->uv[3], sima->cursor);
change= 1;
}