Expose flush edits as an operator (for Py access)
This commit is contained in:
@@ -44,6 +44,8 @@ bool ED_editors_flush_edits(const struct bContext *C, bool for_render);
|
||||
|
||||
void ED_spacedata_id_unref(struct SpaceLink *sl, const struct ID *id);
|
||||
|
||||
void ED_OT_flush_edits(struct wmOperatorType *ot);
|
||||
|
||||
/* ************** Undo ************************ */
|
||||
|
||||
/* undo.c */
|
||||
|
@@ -4231,6 +4231,8 @@ void ED_operatortypes_screen(void)
|
||||
WM_operatortype_append(ED_OT_undo_push);
|
||||
WM_operatortype_append(ED_OT_redo);
|
||||
WM_operatortype_append(ED_OT_undo_history);
|
||||
|
||||
WM_operatortype_append(ED_OT_flush_edits);
|
||||
|
||||
}
|
||||
|
||||
|
@@ -344,3 +344,23 @@ void ED_spacedata_id_unref(struct SpaceLink *sl, const ID *id)
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
static int ed_flush_edits_exec(bContext *C, wmOperator *UNUSED(op))
|
||||
{
|
||||
ED_editors_flush_edits(C, false);
|
||||
return OPERATOR_FINISHED;
|
||||
}
|
||||
|
||||
void ED_OT_flush_edits(wmOperatorType *ot)
|
||||
{
|
||||
/* identifiers */
|
||||
ot->name = "Flush Edits";
|
||||
ot->description = "Flush edit data from active editing modes";
|
||||
ot->idname = "ED_OT_flush_edits";
|
||||
|
||||
/* api callbacks */
|
||||
ot->exec = ed_flush_edits_exec;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_INTERNAL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user