Page MenuHome

rotate_about_active_twcent.patch

File Metadata

Author
Campbell Barton (campbellbarton)
Created
Nov 13 2013, 1:02 PM

rotate_about_active_twcent.patch

Index: source/blender/src/view.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/view.c,v
retrieving revision 1.65
diff -u -u -r1.65 view.c
--- source/blender/src/view.c 11 Apr 2006 00:24:07 -0000 1.65
+++ source/blender/src/view.c 29 Apr 2006 12:26:12 -0000
@@ -560,20 +560,24 @@
calctrackballvec(&curarea->winrct, mvalo, firstvec);
/* cumultime(0); */
-
- if (G.obedit==NULL && ob && !(ob->flag & OB_POSEMODE) && U.uiflag & USER_ORBIT_SELECTION) {
+ /* the if below is used for the option "Around Active" orbit preference
+ it check there is an object and
+ 1) we have a manipulator to access its center or...
+ 2) were just in object mode */
+ if ((ob && U.uiflag & USER_ORBIT_SELECTION) && ( G.vd->twflag & V3D_USE_MANIPULATOR || (G.obedit==NULL && !(ob->flag & OB_POSEMODE)))) {
use_sel = 1;
VECCOPY(ofs, G.vd->ofs);
- if (ob) {
+
+ if (G.vd->twflag & V3D_USE_MANIPULATOR && (G.obedit || ob->flag & OB_POSEMODE)) { /* use the transform center in edit/pose mode */
+ obofs[0] = -G.scene->twcent[0];
+ obofs[1] = -G.scene->twcent[1];
+ obofs[2] = -G.scene->twcent[2];
+ } else { /* object mode, just use active object */
obofs[0] = -ob->obmat[3][0];
obofs[1] = -ob->obmat[3][1];
obofs[2] = -ob->obmat[3][2];
}
- else {
- VECCOPY(obofs, ofs);
- }
- }
- else
+ } else
ofs[0] = ofs[1] = ofs[2] = 0.0f;
reverse= 1.0f;

Event Timeline