Merge branch 'blender-v2.81-release'

This commit is contained in:
Campbell Barton 2019-11-13 15:08:43 +11:00
commit b09498700c
2 changed files with 16 additions and 3 deletions

View File

@ -49,6 +49,7 @@ UNDO_REF_ID_TYPE(Object);
UNDO_REF_ID_TYPE(Scene);
UNDO_REF_ID_TYPE(Text);
UNDO_REF_ID_TYPE(Image);
UNDO_REF_ID_TYPE(PaintCurve);
typedef struct UndoStack {
ListBase steps;

View File

@ -77,7 +77,9 @@ static void undocurve_free_data(UndoCurve *uc)
typedef struct PaintCurveUndoStep {
UndoStep step;
PaintCurve *pc;
UndoRefID_PaintCurve pc_ref;
UndoCurve data;
} PaintCurveUndoStep;
@ -112,7 +114,7 @@ static bool paintcurve_undosys_step_encode(struct bContext *C,
PaintCurveUndoStep *us = (PaintCurveUndoStep *)us_p;
BLI_assert(us->step.data_size == 0);
us->pc = pc;
us->pc_ref.ptr = pc;
undocurve_from_paintcurve(&us->data, pc);
return true;
@ -125,7 +127,7 @@ static void paintcurve_undosys_step_decode(struct bContext *UNUSED(C),
bool UNUSED(is_final))
{
PaintCurveUndoStep *us = (PaintCurveUndoStep *)us_p;
undocurve_to_paintcurve(&us->data, us->pc);
undocurve_to_paintcurve(&us->data, us->pc_ref.ptr);
}
static void paintcurve_undosys_step_free(UndoStep *us_p)
@ -134,6 +136,14 @@ static void paintcurve_undosys_step_free(UndoStep *us_p)
undocurve_free_data(&us->data);
}
static void paintcurve_undosys_foreach_ID_ref(UndoStep *us_p,
UndoTypeForEachIDRefFn foreach_ID_ref_fn,
void *user_data)
{
PaintCurveUndoStep *us = (PaintCurveUndoStep *)us_p;
foreach_ID_ref_fn(user_data, ((UndoRefID *)&us->pc_ref));
}
/* Export for ED_undo_sys. */
void ED_paintcurve_undosys_type(UndoType *ut)
{
@ -145,6 +155,8 @@ void ED_paintcurve_undosys_type(UndoType *ut)
ut->step_decode = paintcurve_undosys_step_decode;
ut->step_free = paintcurve_undosys_step_free;
ut->step_foreach_ID_ref = paintcurve_undosys_foreach_ID_ref;
ut->use_context = false;
ut->step_size = sizeof(PaintCurveUndoStep);