diff options
Diffstat (limited to 'source/blender/editors/transform')
6 files changed, 49 insertions, 55 deletions
diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index ccadf9704b7..c47d49de99f 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -4542,7 +4542,7 @@ static int createSlideVerts(TransInfo *t) sv = BLI_ghash_lookup(vertgh, ev); if(sv) { - float co[3], co2[3], vec[3]; + float co[3], co2[3], tvec[3]; ev = (EditVert*)look->link; @@ -4559,12 +4559,12 @@ static int createSlideVerts(TransInfo *t) } if (ev == tempsv->up->v1) { - sub_v3_v3v3(vec, co, co2); + sub_v3_v3v3(tvec, co, co2); } else { - sub_v3_v3v3(vec, co2, co); + sub_v3_v3v3(tvec, co2, co); } - add_v3_v3(start, vec); + add_v3_v3(start, tvec); if (v3d) { view3d_project_float(t->ar, tempsv->down->v1->co, co, projectMat); @@ -4572,12 +4572,12 @@ static int createSlideVerts(TransInfo *t) } if (ev == tempsv->down->v1) { - sub_v3_v3v3(vec, co2, co); + sub_v3_v3v3(tvec, co2, co); } else { - sub_v3_v3v3(vec, co, co2); + sub_v3_v3v3(tvec, co, co2); } - add_v3_v3(end, vec); + add_v3_v3(end, tvec); totvec += 1.0f; nearest = (EditVert*)look->link; @@ -5853,7 +5853,7 @@ void BIF_TransformSetUndo(char *UNUSED(str)) } -void NDofTransform() +void NDofTransform(void) { #if 0 // TRANSFORM_FIX_ME float fval[7]; diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 305a9331d1d..1f05f8bb668 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -446,7 +446,7 @@ static short apply_targetless_ik(Object *ob) /* apply and decompose, doesn't work for constraints or non-uniform scale well */ { - float rmat3[3][3], qrmat[3][3], imat[3][3], smat[3][3]; + float rmat3[3][3], qrmat[3][3], imat3[3][3], smat[3][3]; copy_m3_m4(rmat3, rmat); @@ -473,8 +473,8 @@ static short apply_targetless_ik(Object *ob) else quat_to_mat3( qrmat,parchan->quat); - invert_m3_m3(imat, qrmat); - mul_m3_m3m3(smat, rmat3, imat); + invert_m3_m3(imat3, qrmat); + mul_m3_m3m3(smat, rmat3, imat3); mat3_to_size( parchan->size,smat); } @@ -5051,10 +5051,10 @@ void special_aftertrans_update(bContext *C, TransInfo *t) for (i = 0; i < t->total; i++) { TransData *td = t->data + i; - Object *ob = td->ob; ListBase pidlist; PTCacheID *pid; - + ob = td->ob; + if (td->flag & TD_NOACTION) break; diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index 9e37f289351..21ec46de6af 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -321,8 +321,7 @@ static int fcu_test_selected(FCurve *fcu) /* called for updating while transform acts, once per redraw */ void recalcData(TransInfo *t) { - Scene *scene = t->scene; - Base *base = scene->basact; + Base *base = t->scene->basact; if (t->spacetype==SPACE_NODE) { flushTransNodes(t); @@ -785,9 +784,9 @@ void recalcData(TransInfo *t) DAG_id_flush_update(&ob->id, OB_RECALC_DATA); /* sets recalc flags */ } else - where_is_pose(scene, ob); + where_is_pose(t->scene, ob); } - else if(base && (base->object->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(scene, base->object)) { + else if(base && (base->object->mode & OB_MODE_PARTICLE_EDIT) && PE_get_current(t->scene, base->object)) { if(t->state != TRANS_CANCEL) { applyProject(t); } diff --git a/source/blender/editors/transform/transform_manipulator.c b/source/blender/editors/transform/transform_manipulator.c index 25d19f18d34..ce8a484eb88 100644 --- a/source/blender/editors/transform/transform_manipulator.c +++ b/source/blender/editors/transform/transform_manipulator.c @@ -793,7 +793,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, GLUquadricObj *qobj; double plane[4]; float matt[4][4]; - float size, vec[3], unitmat[4][4]; + float size, unitmat[4][4]; float cywid= 0.33f*0.01f*(float)U.tw_handlesize; float cusize= cywid*0.65f; int arcs= (G.rt!=2); @@ -814,8 +814,7 @@ static void draw_manipulator_rotate(View3D *v3d, RegionView3D *rv3d, int moving, gluQuadricDrawStyle(qobj, GLU_FILL); /* prepare for screen aligned draw */ - VECCOPY(vec, rv3d->twmat[0]); - size= normalize_v3(vec); + size= len_v3(rv3d->twmat[0]); glPushMatrix(); glTranslatef(rv3d->twmat[3][0], rv3d->twmat[3][1], rv3d->twmat[3][2]); diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index dcfad455575..de6c56246a0 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -316,28 +316,24 @@ void BIF_removeTransformOrientation(bContext *C, TransformOrientation *target) { void BIF_removeTransformOrientationIndex(bContext *C, int index) { ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; - TransformOrientation *ts = transform_spaces->first; - int i; - - for (i = 0, ts = transform_spaces->first; ts; ts = ts->next, i++) { - if (i == index) { - View3D *v3d = CTX_wm_view3d(C); - if(v3d) { - int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); - - // Transform_fix_me NEED TO DO THIS FOR ALL VIEW3D - if (selected_index == i) { - v3d->twmode = V3D_MANIP_GLOBAL; /* fallback to global */ - } - else if (selected_index > i) { - v3d->twmode--; - } - - } + TransformOrientation *ts= BLI_findlink(transform_spaces, index); - BLI_freelinkN(transform_spaces, ts); - break; + if (ts) { + View3D *v3d = CTX_wm_view3d(C); + if(v3d) { + int selected_index = (v3d->twmode - V3D_MANIP_CUSTOM); + + // Transform_fix_me NEED TO DO THIS FOR ALL VIEW3D + if (selected_index == index) { + v3d->twmode = V3D_MANIP_GLOBAL; /* fallback to global */ + } + else if (selected_index > index) { + v3d->twmode--; + } + } + + BLI_freelinkN(transform_spaces, ts); } } @@ -809,14 +805,14 @@ int getTransformOrientation(const bContext *C, float normal[3], float plane[3], { if (ebone->flag & BONE_SELECTED) { - float mat[3][3]; + float tmat[3][3]; float vec[3]; sub_v3_v3v3(vec, ebone->tail, ebone->head); normalize_v3(vec); add_v3_v3(normal, vec); - vec_roll_to_mat3(vec, ebone->roll, mat); - add_v3_v3(plane, mat[2]); + vec_roll_to_mat3(vec, ebone->roll, tmat); + add_v3_v3(plane, tmat[2]); } } } diff --git a/source/blender/editors/transform/transform_snap.c b/source/blender/editors/transform/transform_snap.c index 6128c62f670..f2beb5b1053 100644 --- a/source/blender/editors/transform/transform_snap.c +++ b/source/blender/editors/transform/transform_snap.c @@ -706,7 +706,7 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) ListBase depth_peels; DepthPeel *p1, *p2; float *last_p = NULL; - float dist = FLT_MAX; + float max_dist = FLT_MAX; float p[3] = {0.0f, 0.0f, 0.0f}; depth_peels.first = depth_peels.last = NULL; @@ -770,21 +770,21 @@ void CalcSnapGeometry(TransInfo *t, float *UNUSED(vec)) if (last_p == NULL) { VECCOPY(p, vec); - dist = 0; + max_dist = 0; break; } new_dist = len_v3v3(last_p, vec); - if (new_dist < dist) + if (new_dist < max_dist) { VECCOPY(p, vec); - dist = new_dist; + max_dist = new_dist; } } } - if (dist != FLT_MAX) + if (max_dist != FLT_MAX) { VECCOPY(loc, p); /* XXX, is there a correct normal in this case ???, for now just z up */ @@ -1814,25 +1814,25 @@ int peelObjects(Scene *scene, View3D *v3d, ARegion *ar, Object *obedit, ListBase for(dupli_ob = lb->first; dupli_ob; dupli_ob = dupli_ob->next) { - Object *ob = dupli_ob->ob; + Object *dob = dupli_ob->ob; - if (ob->type == OB_MESH) { + if (dob->type == OB_MESH) { EditMesh *em; DerivedMesh *dm = NULL; int val; - if (ob != obedit) + if (dob != obedit) { - dm = mesh_get_derived_final(scene, ob, CD_MASK_BAREMESH); + dm = mesh_get_derived_final(scene, dob, CD_MASK_BAREMESH); - val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels); + val = peelDerivedMesh(dob, dm, dob->obmat, ray_start, ray_normal, mval, depth_peels); } else { - em = ((Mesh *)ob->data)->edit_mesh; + em = ((Mesh *)dob->data)->edit_mesh; dm = editmesh_get_derived_cage(scene, obedit, em, CD_MASK_BAREMESH); - val = peelDerivedMesh(ob, dm, ob->obmat, ray_start, ray_normal, mval, depth_peels); + val = peelDerivedMesh(dob, dm, dob->obmat, ray_start, ray_normal, mval, depth_peels); } retval = retval || val; |