Revision: 14281
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=14281
Author:   theeth
Date:     2008-03-30 03:47:06 +0200 (Sun, 30 Mar 2008)

Log Message:
-----------
[#7289] Orbit around selected in edit mode goes crazy with no verts selected
[#8784] orbiting around selection bug + a few kind of a must features (partial 
fix)

As suggested by Ton, keep last center and use that when nothing selected.

I don't really like it though as it wouldn't work ok when changing scene  or 
when using a different 3D view and is somewhat non trivial to explain (it's not 
the last selection, it's the last used orbiting center).

Modified Paths:
--------------
    trunk/blender/source/blender/src/view.c

Modified: trunk/blender/source/blender/src/view.c
===================================================================
--- trunk/blender/source/blender/src/view.c     2008-03-29 15:20:41 UTC (rev 
14280)
+++ trunk/blender/source/blender/src/view.c     2008-03-30 01:47:06 UTC (rev 
14281)
@@ -722,6 +722,7 @@
 
 void viewmove(int mode)
 {
+       static float lastofs[3] = {0,0,0};
        Object *ob = OBACT;
        float firstvec[3], newvec[3], dvec[3];
        float reverse, oldquat[4], q1[4], si, phi, dist0;
@@ -783,13 +784,15 @@
                obofs[1]= -obofs[1];
                obofs[2]= -obofs[2];
        }
-       else if (ob && (U.uiflag & USER_ORBIT_SELECTION)) {
+       else if (U.uiflag & USER_ORBIT_SELECTION) {
                use_sel = 1;
                
                VECCOPY(ofs, G.vd->ofs);
                
-               /* If there's no selection, obofs is unmodified, so <0,0,0> */
-               calculateTransformCenter(V3D_CENTROID, obofs);
+               /* If there's no selection, lastofs is unmodified and last 
value since static */
+               calculateTransformCenter(V3D_CENTROID, lastofs);
+               
+               VECCOPY(obofs, lastofs);
                VecMulf(obofs, -1.0f);
        }
        else


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to