diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-02-25 16:58:35 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-02-25 17:37:49 +0300 |
commit | 86c0ee80209cdd52e4b360ffcf854144922ac2e6 (patch) | |
tree | 722f7ddcfaa702cf834d4fe2b8d63f1a2638398c /source/blender/editors/transform | |
parent | 213ac7b1aceea3b5a210e86a07402d4415c9a6b6 (diff) |
3D View: support for editing cursor rotation
Add buttons for editing the cursor rotation as well as rotation modes,
similar to object and pose bones.
Diffstat (limited to 'source/blender/editors/transform')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index 9da07e0cd06..90ddee99f9c 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -405,15 +405,39 @@ static void createTransCursor_view3d(TransInfo *t) td->ob = NULL; unit_m3(td->mtx); - quat_to_mat3(td->axismtx, cursor->rotation); + BKE_scene_cursor_rot_to_mat3(cursor, td->axismtx); normalize_m3(td->axismtx); pseudoinverse_m3_m3(td->smtx, td->mtx, PSEUDOINVERSE_EPSILON); td->loc = cursor->location; copy_v3_v3(td->iloc, cursor->location); - td->ext->quat = cursor->rotation; - copy_qt_qt(td->ext->iquat, cursor->rotation); + if (cursor->rotation_mode > 0) { + td->ext->rot = cursor->rotation_euler; + td->ext->rotAxis = NULL; + td->ext->rotAngle = NULL; + td->ext->quat = NULL; + + copy_v3_v3(td->ext->irot, cursor->rotation_euler); + } + else if (cursor->rotation_mode == ROT_MODE_AXISANGLE) { + td->ext->rot = NULL; + td->ext->rotAxis = cursor->rotation_axis; + td->ext->rotAngle = &cursor->rotation_angle; + td->ext->quat = NULL; + + td->ext->irotAngle = cursor->rotation_angle; + copy_v3_v3(td->ext->irotAxis, cursor->rotation_axis); + } + else { + td->ext->rot = NULL; + td->ext->rotAxis = NULL; + td->ext->rotAngle = NULL; + td->ext->quat = cursor->rotation_quaternion; + + copy_qt_qt(td->ext->iquat, cursor->rotation_quaternion); + } + td->ext->rotOrder = cursor->rotation_mode; } /** \} */ |