diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-01-22 04:42:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-01-22 04:42:15 +0300 |
commit | 665eca85baaee380c067b375d22647d3c6c95a0e (patch) | |
tree | f204ce789d5e61831b1cbad158872760c9c6af9a /source/blender/editors/animation | |
parent | e391ad7bbc97a63dc2953e434f9b4ed727c06a39 (diff) | |
parent | 99e5d5ba21a44a9caa4f10b86c5065b916a096b4 (diff) |
Merge branch 'blender-v2.92-release'
Diffstat (limited to 'source/blender/editors/animation')
-rw-r--r-- | source/blender/editors/animation/anim_markers.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 8e1f03295f4..a77864415ce 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -1210,6 +1210,7 @@ static void select_marker_camera_switch( { #ifdef DURIAN_CAMERA_SWITCH if (camera) { + BLI_assert(CTX_data_mode_enum(C) == CTX_MODE_OBJECT); Scene *scene = CTX_data_scene(C); ViewLayer *view_layer = CTX_data_view_layer(C); Base *base; @@ -1281,6 +1282,15 @@ static int ed_marker_select_exec(bContext *C, wmOperator *op) bool camera = false; #ifdef DURIAN_CAMERA_SWITCH camera = RNA_boolean_get(op->ptr, "camera"); + if (camera) { + /* Supporting mode switching from this operator doesn't seem so useful. + * So only allow setting the active camera in object-mode. */ + if (CTX_data_mode_enum(C) != CTX_MODE_OBJECT) { + BKE_report( + op->reports, RPT_WARNING, "Selecting the camera is only supported in object mode"); + camera = false; + } + } #endif int mval[2]; mval[0] = RNA_int_get(op->ptr, "mouse_x"); |