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:
authorRoel Spruit <roel@spruitje.nl>2003-12-12 23:54:12 +0300
committerRoel Spruit <roel@spruitje.nl>2003-12-12 23:54:12 +0300
commitf574f38a39cbccdbbd604789b1c3bf0edccd635d (patch)
tree21a0779183053ec2fe9b4a8e9837e53be7ac9b29 /source/blender
parent8d94f3723d2535677a5610abfaf1d20a53b0267f (diff)
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.
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/include/BSE_edit.h1
-rw-r--r--source/blender/src/edit.c31
-rw-r--r--source/blender/src/view.c6
3 files changed, 35 insertions, 3 deletions
diff --git a/source/blender/include/BSE_edit.h b/source/blender/include/BSE_edit.h
index e776f99ad28..e14571c7f67 100644
--- a/source/blender/include/BSE_edit.h
+++ b/source/blender/include/BSE_edit.h
@@ -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 */
diff --git a/source/blender/src/edit.c b/source/blender/src/edit.c
index 3fa195c1cb5..a7d13e15da1 100644
--- a/source/blender/src/edit.c
+++ b/source/blender/src/edit.c
@@ -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;
+} \ No newline at end of file
diff --git a/source/blender/src/view.c b/source/blender/src/view.c
index 63b6870f347..8578fad828e 100644
--- a/source/blender/src/view.c
+++ b/source/blender/src/view.c
@@ -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 */
-}
-
+} \ No newline at end of file