Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "DNA_anim_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_array_utils.h"
#include "BLI_blenlib.h"
#include "BLI_ghash.h"
#include "BKE_anim_data.h"
#include "BKE_context.h"
#include "BKE_curve.h"
#include "BKE_fcurve.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
#include "ED_curve.h"
#include "ED_undo.h"
#include "WM_api.h"
#include "WM_types.h"
#include "curve_intern.h"
Go to the source code of this file.
Classes | |
struct | UndoCurve |
struct | CurveUndoStep_Elem |
struct | CurveUndoStep |
Functions | |
Undo Conversion | |
static void | undocurve_to_editcurve (Main *bmain, UndoCurve *ucu, Curve *cu, short *r_shapenr) |
static void | undocurve_from_editcurve (UndoCurve *ucu, Curve *cu, const short shapenr) |
static void | undocurve_free_data (UndoCurve *uc) |
static Object * | editcurve_object_from_context (bContext *C) |
Variables | |
static CLG_LogRef | LOG = {"ed.undo.curve"} |
Implements ED Undo System | |
| |
typedef struct CurveUndoStep_Elem | CurveUndoStep_Elem |
typedef struct CurveUndoStep | CurveUndoStep |
static bool | curve_undosys_poll (bContext *C) |
static bool | curve_undosys_step_encode (struct bContext *C, struct Main *bmain, UndoStep *us_p) |
static void | curve_undosys_step_decode (struct bContext *C, struct Main *bmain, UndoStep *us_p, const eUndoStepDir UNUSED(dir), bool UNUSED(is_final)) |
static void | curve_undosys_step_free (UndoStep *us_p) |
static void | curve_undosys_foreach_ID_ref (UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data) |
void | ED_curve_undosys_type (UndoType *ut) |
typedef struct CurveUndoStep CurveUndoStep |
typedef struct CurveUndoStep_Elem CurveUndoStep_Elem |
|
static |
Definition at line 282 of file editcurve_undo.c.
References CurveUndoStep::elems, CurveUndoStep::elems_len, CurveUndoStep_Elem::obedit_ref, and user_data.
Referenced by ED_curve_undosys_type().
Definition at line 193 of file editcurve_undo.c.
References C, editcurve_object_from_context(), and NULL.
Referenced by curve_undosys_step_decode(), and ED_curve_undosys_type().
|
static |
Definition at line 229 of file editcurve_undo.c.
References BKE_object_is_in_editmode(), BLI_assert, C, CLOG_ERROR, CTX_data_scene(), CTX_data_view_layer(), curve_undosys_poll(), CurveUndoStep_Elem::data, Object::data, DEG_id_tag_update(), ED_undo_object_editmode_restore_helper(), ED_undo_object_set_active_or_warn(), Curve::editnurb, CurveUndoStep::elems, CurveUndoStep::elems_len, Curve::id, Object::id, ID_RECALC_GEOMETRY, Main::is_memfile_undo_flush_needed, LOG, UndoStep::name, ID::name, NC_GEOM, ND_DATA, EditNurb::needs_flush_to_id, NULL, CurveUndoStep_Elem::obedit_ref, Object::shapenr, undocurve_to_editcurve(), and WM_event_add_notifier().
Referenced by ED_curve_undosys_type().
|
static |
Definition at line 199 of file editcurve_undo.c.
References C, CTX_data_view_layer(), CurveUndoStep_Elem::data, Object::data, UndoStep::data_size, ED_undo_editmode_objects_from_view_layer(), Curve::editnurb, CurveUndoStep::elems, CurveUndoStep::elems_len, Main::is_memfile_undo_flush_needed, MEM_callocN, MEM_freeN, EditNurb::needs_flush_to_id, CurveUndoStep_Elem::obedit_ref, Object::shapenr, CurveUndoStep::step, UndoCurve::undo_size, and undocurve_from_editcurve().
Referenced by ED_curve_undosys_type().
Definition at line 271 of file editcurve_undo.c.
References CurveUndoStep_Elem::data, CurveUndoStep::elems, CurveUndoStep::elems_len, MEM_freeN, and undocurve_free_data().
Referenced by ED_curve_undosys_type().
Export for ED_undo_sys
Definition at line 294 of file editcurve_undo.c.
References curve_undosys_foreach_ID_ref(), curve_undosys_poll(), curve_undosys_step_decode(), curve_undosys_step_encode(), curve_undosys_step_free(), UndoType::flags, UndoType::name, UndoType::poll, UndoType::step_decode, UndoType::step_encode, UndoType::step_foreach_ID_ref, UndoType::step_free, UndoType::step_size, and UNDOTYPE_FLAG_NEED_CONTEXT_FOR_ENCODE.
Referenced by ED_undosys_type_init().
Definition at line 161 of file editcurve_undo.c.
References BKE_curve_editNurbs_get(), C, CTX_data_view_layer(), Object::data, ELEM, NULL, OB_CURVES_LEGACY, OB_SURF, OBEDIT_FROM_VIEW_LAYER, and Object::type.
Referenced by curve_undosys_poll().
Definition at line 151 of file editcurve_undo.c.
References BKE_curve_editNurb_keyIndex_free(), BKE_fcurves_free(), BKE_nurbList_free(), UndoCurve::drivers, UndoCurve::fcurves, UndoCurve::nubase, and UndoCurve::undoIndex.
Referenced by curve_undosys_step_free().
Definition at line 104 of file editcurve_undo.c.
References AnimData::action, UndoCurve::actnu, Curve::actnu, UndoCurve::actvert, Curve::actvert, Nurb::bezt, BKE_animdata_from_id(), BKE_curve_editNurbs_get(), BKE_fcurves_copy(), BKE_nurb_duplicate(), BLI_addtail(), BLI_array_is_zeroed, BLI_assert, Nurb::bp, bAction::curves, UndoCurve::drivers, AnimData::drivers, ED_curve_keyindex_hash_duplicate(), ED_curve_keyindex_update_nurb(), Curve::editnurb, UndoCurve::fcurves, ListBase::first, UndoCurve::flag, Curve::flag, float(), Curve::id, EditNurb::keyindex, KNOTSU, Nurb::knotsu, KNOTSV, Nurb::knotsv, Nurb::next, UndoCurve::nubase, UndoCurve::obedit, Nurb::pntsu, Nurb::pntsv, UndoCurve::shapenr, UndoCurve::undo_size, and UndoCurve::undoIndex.
Referenced by curve_undosys_step_encode().
|
static |
Definition at line 61 of file editcurve_undo.c.
References AnimData::action, UndoCurve::actnu, Curve::actnu, UndoCurve::actvert, Curve::actvert, BKE_animdata_from_id(), BKE_curve_editNurb_keyIndex_free(), BKE_curve_editNurbs_get(), BKE_fcurves_copy(), BKE_fcurves_free(), BKE_nurb_duplicate(), BKE_nurbList_free(), BLI_addtail(), bAction::curves, UndoCurve::drivers, AnimData::drivers, ED_curve_keyindex_hash_duplicate(), ED_curve_keyindex_update_nurb(), ED_curve_updateAnimPaths(), Curve::editnurb, UndoCurve::fcurves, ListBase::first, UndoCurve::flag, Curve::flag, Curve::id, EditNurb::keyindex, Nurb::next, UndoCurve::nubase, UndoCurve::obedit, UndoCurve::shapenr, and UndoCurve::undoIndex.
Referenced by curve_undosys_step_decode().
|
static |
We only need this locally.
Definition at line 39 of file editcurve_undo.c.
Referenced by curve_undosys_step_decode().