Fix T37149: Macros store settings from a cancelled operation
This commit is contained in:
parent
fd88ce4d73
commit
285e09bceb
Notes:
blender-bot
2023-02-14 11:42:38 +01:00
Referenced by issue #37149, Loop cut tool- Factor does not update to 0 if middle muse its use to apply
|
@ -239,6 +239,7 @@ bool WM_operator_properties_default(struct PointerRNA *ptr, const bool do
|
|||
void WM_operator_properties_reset(struct wmOperator *op);
|
||||
void WM_operator_properties_create(struct PointerRNA *ptr, const char *opstring);
|
||||
void WM_operator_properties_create_ptr(struct PointerRNA *ptr, struct wmOperatorType *ot);
|
||||
void WM_operator_properties_clear(struct PointerRNA *ptr);
|
||||
void WM_operator_properties_free(struct PointerRNA *ptr);
|
||||
void WM_operator_properties_filesel(struct wmOperatorType *ot, int filter, short type, short action, short flag, short display);
|
||||
void WM_operator_properties_border(struct wmOperatorType *ot);
|
||||
|
|
|
@ -296,6 +296,11 @@ static int wm_macro_modal(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
retval = opm->type->modal(C, opm, event);
|
||||
OPERATOR_RETVAL_CHECK(retval);
|
||||
|
||||
/* if we're halfway through using a tool and cancel it, clear the options [#37149] */
|
||||
if (retval & OPERATOR_CANCELLED) {
|
||||
WM_operator_properties_clear(opm->ptr);
|
||||
}
|
||||
|
||||
/* if this one is done but it's not the last operator in the macro */
|
||||
if ((retval & OPERATOR_FINISHED) && opm->next) {
|
||||
MacroData *md = op->customdata;
|
||||
|
@ -918,6 +923,15 @@ void WM_operator_properties_reset(wmOperator *op)
|
|||
}
|
||||
}
|
||||
|
||||
void WM_operator_properties_clear(PointerRNA *ptr)
|
||||
{
|
||||
IDProperty *properties = ptr->data;
|
||||
|
||||
if (properties) {
|
||||
IDP_ClearProperty(properties);
|
||||
}
|
||||
}
|
||||
|
||||
void WM_operator_properties_free(PointerRNA *ptr)
|
||||
{
|
||||
IDProperty *properties = ptr->data;
|
||||
|
|
Loading…
Reference in New Issue