diff options
author | Martin Poirier <theeth@yahoo.com> | 2009-10-28 23:30:33 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2009-10-28 23:30:33 +0300 |
commit | 3187e365d90f5c0e46d721370c0d381f83813c66 (patch) | |
tree | 754be9c6f41f10e671a77ea59cce820214c8e09c /source/blender/editors/transform/transform_orientations.c | |
parent | c2f9cfb40a740f926d78cbdb20f1f8b09cc7aadd (diff) |
Gimbal Transform orientations
Will use rotation gimbal axis when an object or bone set to Euler rotation mode is selected (global axis otherwise)
Use case: being able to do rotations that only affect one animation curve in the 3d view instead of just in the curve editor.
I'm committing this right now despite what follows because it's already useful as is.
Known bug: manipulator arrows can look slightly skewed (not really a big problem), but more importantly, rotation circles for the rotation manipulator are skewed and will not perfectly reflect the rotation axis (it will still use the correct one though). That will be fixed shortly.
To do: This orientation should act like Local, where each object/bone uses its own orientation and not just the one of the active object/bone.
Note: Saved files with custom orientations might end up with other orientations selected when being opened up. I don't think it's that useful to make a do_version for that, but I can if warranted.
Diffstat (limited to 'source/blender/editors/transform/transform_orientations.c')
-rw-r--r-- | source/blender/editors/transform/transform_orientations.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index c9344b97fb2..e790b38dd67 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -434,7 +434,7 @@ EnumPropertyItem *BIF_enumTransformOrientation(bContext *C) } char * BIF_menustringTransformOrientation(const bContext *C, char *title) { - char menu[] = "%t|Global%x0|Local%x1|Normal%x2|View%x3"; + char menu[] = "%t|Global%x0|Local%x1|Gimbal%x4|Normal%x2|View%x3"; ListBase *transform_spaces = &CTX_data_scene(C)->transform_spaces; TransformOrientation *ts; int i = V3D_MANIP_CUSTOM; @@ -510,6 +510,7 @@ static int count_bone_select(bArmature *arm, ListBase *lb, int do_it) return total; } +extern void gimbalAxis(Object *ob, float gimbal_vecs[][3]); void initTransformOrientation(bContext *C, TransInfo *t) { View3D *v3d = CTX_wm_view3d(C); @@ -522,7 +523,12 @@ void initTransformOrientation(bContext *C, TransInfo *t) case V3D_MANIP_GLOBAL: strcpy(t->spacename, "global"); break; - + + case V3D_MANIP_GIMBAL: + Mat3One(t->spacemtx); + if(ob) + gimbalAxis(ob, t->spacemtx); + break; case V3D_MANIP_NORMAL: if(obedit || ob->mode & OB_MODE_POSE) { float mat[3][3]; |