Index: source/blender/blenkernel/BKE_global.h =================================================================== --- source/blender/blenkernel/BKE_global.h (revision 16743) +++ source/blender/blenkernel/BKE_global.h (working copy) @@ -142,6 +142,8 @@ /* Janco's playing ground */ struct bSoundListener* listener; + int inviewmove; /* indicator for viewmove mode */ + /* Test thingy for Nzc */ int compat; /* toggle compatibility mode for edge rendering */ int notonlysolid;/* T-> also edge-render transparent faces */ Index: source/blender/makesdna/DNA_userdef_types.h =================================================================== --- source/blender/makesdna/DNA_userdef_types.h (revision 16743) +++ source/blender/makesdna/DNA_userdef_types.h (working copy) @@ -246,6 +246,7 @@ #define USER_RELPATHS (1 << 20) #define USER_DRAGIMMEDIATE (1 << 21) #define USER_DONT_DOSCRIPTLINKS (1 << 22) +#define USER_SHOW_ORBIT_CENTER (1 << 23) /* viewzom */ #define USER_ZOOM_CONT 0 Index: source/blender/src/drawview.c =================================================================== --- source/blender/src/drawview.c (revision 16743) +++ source/blender/src/drawview.c (working copy) @@ -679,6 +679,35 @@ } } +static void draworbitcenter() +{ + View3D *v3d = G.vd; + float size; + float iofs[3]; + /* get center of the orbit */ + VECCOPY(iofs, v3d->ofs); + VecMulf(iofs, -1.0f); + + /* size calculation from drawobject.c's center drawing function */ + size= v3d->persmat[0][3]*iofs[0]+ v3d->persmat[1][3]*iofs[1]+ v3d->persmat[2][3]*iofs[2]+ v3d->persmat[3][3]; + size*= v3d->pixsize*((float)U.obcenter_dia*0.5f); + + /* Do the draw without depth test using one color, and then with depth test using another. + * We can distinguish now between 'inside something' state and 'outside' state. + */ + if (v3d->zbuf) glDisable(GL_DEPTH_TEST); + glEnable(GL_BLEND); + BIF_ThemeColorShadeAlpha(TH_TRANSFORM, 0, -120); + drawcircball(GL_POLYGON, iofs, size, v3d->viewinv); + glDisable(GL_BLEND); + if (v3d->zbuf) glEnable(GL_DEPTH_TEST); + + BIF_ThemeColorShade(TH_ACTIVE, 0); + drawcircball(GL_POLYGON, iofs, size, v3d->viewinv); + BIF_ThemeColorShade(TH_WIRE, 0); + drawcircball(GL_LINE_LOOP, iofs, size, v3d->viewinv); +} + /* ********* custom clipping *********** */ static void view3d_draw_clipping(View3D *v3d) @@ -3228,6 +3257,7 @@ // needs to be done always, gridview is adjusted in drawgrid() now v3d->gridview= v3d->grid; + if(v3d->view==0 || v3d->persp!=0) { drawfloor(); if(v3d->persp==2) { @@ -3312,6 +3342,7 @@ if(G.scene->radio) RAD_drawall(v3d->drawtype>=OB_SOLID); /* Transp and X-ray afterdraw stuff */ + if((U.flag & USER_SHOW_ORBIT_CENTER) && G.inviewmove) draworbitcenter(); view3d_draw_transp(v3d); view3d_draw_xray(v3d, 1); // clears zbuffer if it is used! Index: source/blender/src/space.c =================================================================== --- source/blender/src/space.c (revision 16743) +++ source/blender/src/space.c (working copy) @@ -3820,6 +3820,12 @@ uiDefBut(block, LABEL,0,"View rotation:", (xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y3label,mpref,buth, 0, 0, 0, 0, 0, ""); + + uiDefButBitI(block, TOG, USER_SHOW_ORBIT_CENTER, B_DRAWINFO, "Orbit Center", + (xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y3,(mpref/2),buth, + &(U.flag), 0, 0, 0, 0, + "Show center of the camera orbit during view rotation/translation/scale"); + uiBlockBeginAlign(block); uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */ uiDefButBitI(block, TOG, USER_TRACKBALL, B_DRAWINFO, "Trackball", Index: source/blender/src/view.c =================================================================== --- source/blender/src/view.c (revision 16743) +++ source/blender/src/view.c (working copy) @@ -984,6 +984,7 @@ if (G.vd->persmat[2][1] < 0.0f) reverse= -1.0f; + G.inviewmove = 1; /* indicate a viewmove loop state */ while(TRUE) { getmouseco_sc(mval); @@ -1284,6 +1285,7 @@ /* this in the end, otherwise get_mbut does not work on a PC... */ if( !(get_mbut() & (L_MOUSE|M_MOUSE))) break; } + G.inviewmove = 0; /* we're out of viewmove mode */ if(G.vd->depths) G.vd->depths->damaged= 1; retopo_queue_updates(G.vd);