diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-13 21:36:53 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-13 21:58:25 +0300 |
commit | 14884cda1ff5677cacff7a038efa5440f5e15a5c (patch) | |
tree | 554eaab14782a13ed19fbe8fb40e044da3385eb7 /source/blender/blenkernel/intern/scene.c | |
parent | 6815efc3ff852b65ee673109c182ec53365a7828 (diff) |
Gizmo: move transform to a persistent option
Based on feedback from animators, this is useful to keep as a view
option (as in 2.7x).
Now the transform gizmos can be enabled from the popover,
the tools still work for location/scale/rotation.
The transform tool has been removed.
See T63518
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index 644eb704655..630441265e1 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -651,7 +651,6 @@ void BKE_scene_init(Scene *sce) sce->toolsettings->uvcalc_flag = UVCALC_TRANSFORM_CORRECT; sce->toolsettings->unwrapper = 1; sce->toolsettings->select_thresh = 0.01f; - sce->toolsettings->gizmo_flag = SCE_GIZMO_SHOW_TRANSLATE | SCE_GIZMO_SHOW_ROTATE | SCE_GIZMO_SHOW_SCALE; sce->toolsettings->selectmode = SCE_SELECT_VERTEX; sce->toolsettings->uv_selectmode = UV_SELECT_VERTEX; @@ -1347,24 +1346,28 @@ void BKE_scene_frame_set(struct Scene *scene, double cfra) /** \name Scene Orientation Slots * \{ */ -TransformOrientationSlot *BKE_scene_orientation_slot_get(Scene *scene, int flag) +TransformOrientationSlot *BKE_scene_orientation_slot_get(Scene *scene, int slot_index) { - BLI_assert(flag && !(flag & ~(SCE_GIZMO_SHOW_TRANSLATE | SCE_GIZMO_SHOW_ROTATE | SCE_GIZMO_SHOW_SCALE))); - int index = SCE_ORIENT_DEFAULT; - if (flag & SCE_GIZMO_SHOW_TRANSLATE) { - index = SCE_ORIENT_TRANSLATE; + if ((scene->orientation_slots[slot_index].flag & SELECT) == 0) { + slot_index = SCE_ORIENT_DEFAULT; } - else if (flag & SCE_GIZMO_SHOW_ROTATE) { - index = SCE_ORIENT_ROTATE; + return &scene->orientation_slots[slot_index]; +} + +TransformOrientationSlot *BKE_scene_orientation_slot_get_from_flag(Scene *scene, int flag) +{ + BLI_assert(flag && !(flag & ~(V3D_GIZMO_TYPE_MASK_TRANSLATE | V3D_GIZMO_TYPE_MASK_ROTATE | V3D_GIZMO_TYPE_MASK_SCALE))); + int slot_index = SCE_ORIENT_DEFAULT; + if (flag & V3D_GIZMO_TYPE_MASK_TRANSLATE) { + slot_index = SCE_ORIENT_TRANSLATE; } - else if (flag & SCE_GIZMO_SHOW_SCALE) { - index = SCE_ORIENT_SCALE; + else if (flag & V3D_GIZMO_TYPE_MASK_ROTATE) { + slot_index = SCE_ORIENT_ROTATE; } - - if ((scene->orientation_slots[index].flag & SELECT) == 0) { - index = SCE_ORIENT_DEFAULT; + else if (flag & V3D_GIZMO_TYPE_MASK_SCALE) { + slot_index = SCE_ORIENT_SCALE; } - return &scene->orientation_slots[index]; + return BKE_scene_orientation_slot_get(scene, slot_index); } /** |