Fix T68322: Shear in Dopesheet causes crash

The Shear transform operator is now disallowed in the timeline and
dopesheet editors.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D5440
This commit is contained in:
Sybren A. Stüvel 2019-08-08 18:21:40 +02:00
parent 9deb73df3d
commit e1665905df
Notes: blender-bot 2023-10-04 09:42:55 +02:00
Referenced by issue #68322, Shear in Dopesheet causes crash
1 changed files with 13 additions and 1 deletions

View File

@ -883,6 +883,18 @@ static void TRANSFORM_OT_bend(struct wmOperatorType *ot)
Transform_Properties(ot, P_PROPORTIONAL | P_MIRROR | P_SNAP | P_GPENCIL_EDIT | P_CENTER);
}
static bool transform_shear_poll(bContext *C)
{
if (!ED_operator_screenactive(C)) {
return false;
}
ScrArea *sa = CTX_wm_area(C);
return sa && !ELEM(sa->spacetype, SPACE_ACTION, SPACE_TIME);
}
static void TRANSFORM_OT_shear(struct wmOperatorType *ot)
{
/* identifiers */
@ -896,7 +908,7 @@ static void TRANSFORM_OT_shear(struct wmOperatorType *ot)
ot->exec = transform_exec;
ot->modal = transform_modal;
ot->cancel = transform_cancel;
ot->poll = ED_operator_screenactive;
ot->poll = transform_shear_poll;
ot->poll_property = transform_poll_property;
RNA_def_float(ot->srna, "value", 0, -FLT_MAX, FLT_MAX, "Offset", "", -FLT_MAX, FLT_MAX);