diff options
author | Germano Cavalcante <germano.costa@ig.com.br> | 2020-10-31 02:13:05 +0300 |
---|---|---|
committer | Germano Cavalcante <germano.costa@ig.com.br> | 2020-10-31 02:13:05 +0300 |
commit | c503c5f756aab850e8afe2513b2dc7b645cf84af (patch) | |
tree | 6e5f2cfa149e768d8ddaf1ee2cdc8d909b3e30c3 /source | |
parent | 81090ded0d7c2032c5802f43b55265fcb9da8fc1 (diff) |
Fix T82244: Crash when trying to use the rotate operator on the timeline
Some tranform modes are not expected to be used in the `SPACE_ACTION`.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/transform/transform_ops.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/transform/transform_ops.c b/source/blender/editors/transform/transform_ops.c index b164d0d443f..9f39099ea4b 100644 --- a/source/blender/editors/transform/transform_ops.c +++ b/source/blender/editors/transform/transform_ops.c @@ -825,6 +825,17 @@ static void TRANSFORM_OT_trackball(struct wmOperatorType *ot) Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); } +/* Similar to #transform_shear_poll. */ +static bool transform_rotate_poll(bContext *C) +{ + if (!ED_operator_screenactive(C)) { + return false; + } + + ScrArea *area = CTX_wm_area(C); + return area && !ELEM(area->spacetype, SPACE_ACTION); +} + static void TRANSFORM_OT_rotate(struct wmOperatorType *ot) { /* identifiers */ @@ -838,7 +849,7 @@ static void TRANSFORM_OT_rotate(struct wmOperatorType *ot) ot->exec = transform_exec; ot->modal = transform_modal; ot->cancel = transform_cancel; - ot->poll = ED_operator_screenactive; + ot->poll = transform_rotate_poll; ot->poll_property = transform_poll_property; RNA_def_float_rotation( @@ -902,6 +913,7 @@ static void TRANSFORM_OT_bend(struct wmOperatorType *ot) Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER); } +/* Similar to #transform_rotate_poll. */ static bool transform_shear_poll(bContext *C) { if (!ED_operator_screenactive(C)) { |