Page Menu
Home
Search
Configure Global Search
Log In
Files
F3146
borderzoom.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Authored By
Ben Stabler (lightning)
Nov 13 2013, 1:08 PM
Size
2 KB
Subscribers
None
borderzoom.patch
View Options
Index: source/blender/src/space.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/space.c,v
retrieving revision 1.385
diff -u -r1.385 space.c
--- source/blender/src/space.c 19 Oct 2006 05:06:41 -0000 1.385
+++ source/blender/src/space.c 22 Oct 2006 09:01:46 -0000
@@ -1278,7 +1278,12 @@
if(G.qual==LR_ALTKEY)
view3d_edit_clipping(v3d);
else if(G.qual==LR_SHIFTKEY)
- set_render_border();
+ {
+ if(G.vd->persp==2)
+ set_render_border();
+ else
+ border_zoom();
+ }
else if(G.qual==LR_CTRLKEY) {
if(okee("Bake all selected")) {
extern void softbody_bake(Object *ob);
Index: source/blender/src/editview.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/editview.c,v
retrieving revision 1.112
diff -u -r1.112 editview.c
--- source/blender/src/editview.c 12 Oct 2006 09:32:47 -0000 1.112
+++ source/blender/src/editview.c 23 Oct 2006 20:36:51 -0000
@@ -1976,8 +1976,6 @@
{
rcti rect;
short val;
-
- if(G.vd->persp!=2) return;
val= get_border(&rect, 3);
if(val) {
@@ -2002,6 +2000,37 @@
}
}
+void border_zoom(void)
+{
+ //Zooms in on a border drawn by the user
+
+ rcti rect;
+ short val;
+ float dvec[3], vb[2], xscale, yscale, scale;
+
+ val = get_border(&rect, 3); //box select input
+ if(val)
+ {
+ //find the current window width and height
+ vb[0] = G.vd->area->winx;
+ vb[1] = G.vd->area->winy;
+
+ //convert the drawn rectangle into 3d space
+ initgrabz(-G.vd->ofs[0], -G.vd->ofs[1], -G.vd->ofs[2]);
+ window_to_3d(dvec, (rect.xmin+rect.xmax-vb[0])/2, (rect.ymin+rect.ymax-vb[1])/2);
+
+ //center the view to the center of the rectangle
+ VecSubf(G.vd->ofs, G.vd->ofs, dvec);
+
+ //work out the ratios, so that everything selected fits when we zoom
+ xscale = ((rect.xmax-rect.xmin)/vb[0]);
+ yscale = ((rect.ymax-rect.ymin)/vb[1]);
+ scale = (xscale >= yscale)?xscale:yscale;
+
+ //zoom in as required, or as far as we can go
+ G.vd->dist = ((G.vd->dist*scale) >= 0.001*G.vd->grid)? G.vd->dist*scale:0.001*G.vd->grid;
+ }
+}
void fly(void)
{
File Metadata
Details
Mime Type
text/x-diff
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
d3/92/7cca9e756255196941ca16708017
Event Timeline
Log In to Comment