Numpad - . (dot) now centers on selected vertices/controlpoints in editmode.
It already centered on selected objects outside of editmode, so this is just a consistency feature.
This commit is contained in:
@@ -44,6 +44,7 @@ void mergemenu(void);
|
||||
void delete_context_selected(void);
|
||||
void duplicate_context_selected(void);
|
||||
void toggle_shading(void);
|
||||
void minmax_verts(float *min, float *max);
|
||||
|
||||
#endif /* BSE_EDIT_H */
|
||||
|
||||
|
||||
@@ -1236,3 +1236,34 @@ void toggle_shading(void) {
|
||||
else G.vd->drawtype= OB_SOLID;
|
||||
}
|
||||
}
|
||||
|
||||
void minmax_verts(float *min, float *max)
|
||||
{
|
||||
extern TransVert *transvmain;
|
||||
extern int tottrans;
|
||||
TransVert *tv;
|
||||
float centroid[3], vec[3], bmat[3][3];
|
||||
int a;
|
||||
|
||||
tottrans=0;
|
||||
#ifdef __NLA
|
||||
if ELEM5(G.obedit->type, OB_ARMATURE, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE) make_trans_verts(bmat[0], bmat[1], 0);
|
||||
#else
|
||||
if ELEM4(G.obedit->type, OB_LATTICE, OB_MESH, OB_SURF, OB_CURVE) make_trans_verts(bmat[0], bmat[1], 0);
|
||||
#endif
|
||||
if(tottrans==0) return;
|
||||
|
||||
Mat3CpyMat4(bmat, G.obedit->obmat);
|
||||
|
||||
tv= transvmain;
|
||||
for(a=0; a<tottrans; a++, tv++) {
|
||||
VECCOPY(vec, tv->loc);
|
||||
Mat3MulVecfl(bmat, vec);
|
||||
VecAddf(vec, vec, G.obedit->obmat[3]);
|
||||
VecAddf(centroid, centroid, vec);
|
||||
DO_MINMAX(vec, min, max);
|
||||
}
|
||||
|
||||
MEM_freeN(transvmain);
|
||||
transvmain= 0;
|
||||
}
|
||||
@@ -955,7 +955,8 @@ void centreview() /* like a localview without local! */
|
||||
max[0]= max[1]= max[2]= -1.0e10;
|
||||
|
||||
if(G.obedit) {
|
||||
minmax_object(G.obedit, min, max);
|
||||
minmax_verts(min, max);
|
||||
//minmax_object(G.obedit, min, max);
|
||||
|
||||
ok= 1;
|
||||
}
|
||||
@@ -1122,5 +1123,4 @@ void view3d_align_axis_to_vector(View3D *v3d, int axisidx, float vec[3])
|
||||
|
||||
v3d->view= 0;
|
||||
if (v3d->persp>=2) v3d->persp= 0; /* switch out of camera mode */
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user