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`.
This commit is contained in:
Germano Cavalcante 2020-10-30 20:13:05 -03:00
parent 81090ded0d
commit c503c5f756
Notes: blender-bot 2023-02-14 00:09:06 +01:00
Referenced by issue #82244, Blender crashes from creating a rotation keyframe and using "repeat last" feature
1 changed files with 13 additions and 1 deletions

View File

@ -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)) {