Blender
V3.3
|
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "BLI_array_utils.h"
#include "BLI_utildefines.h"
#include "DNA_curve_types.h"
#include "DNA_lattice_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_context.h"
#include "BKE_deform.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
#include "ED_lattice.h"
#include "ED_object.h"
#include "ED_undo.h"
#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
#include "lattice_intern.h"
Go to the source code of this file.
Classes | |
struct | UndoLattice |
struct | LatticeUndoStep_Elem |
struct | LatticeUndoStep |
Variables | |
static CLG_LogRef | LOG = {"ed.undo.lattice"} |
Undo Conversion | |
typedef struct UndoLattice | UndoLattice |
static void | undolatt_to_editlatt (UndoLattice *ult, EditLatt *editlatt) |
static void * | undolatt_from_editlatt (UndoLattice *ult, EditLatt *editlatt) |
static void | undolatt_free_data (UndoLattice *ult) |
static Object * | editlatt_object_from_context (bContext *C) |
Implements ED Undo System | |
| |
typedef struct LatticeUndoStep_Elem | LatticeUndoStep_Elem |
typedef struct LatticeUndoStep | LatticeUndoStep |
static bool | lattice_undosys_poll (bContext *C) |
static bool | lattice_undosys_step_encode (struct bContext *C, Main *bmain, UndoStep *us_p) |
static void | lattice_undosys_step_decode (struct bContext *C, struct Main *bmain, UndoStep *us_p, const eUndoStepDir UNUSED(dir), bool UNUSED(is_final)) |
static void | lattice_undosys_step_free (UndoStep *us_p) |
static void | lattice_undosys_foreach_ID_ref (UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data) |
void | ED_lattice_undosys_type (UndoType *ut) |
typedef struct LatticeUndoStep LatticeUndoStep |
typedef struct LatticeUndoStep_Elem LatticeUndoStep_Elem |
typedef struct UndoLattice UndoLattice |
Export for ED_undo_sys.
Definition at line 287 of file editlattice_undo.c.
References UndoType::flags, lattice_undosys_foreach_ID_ref(), lattice_undosys_poll(), lattice_undosys_step_decode(), lattice_undosys_step_encode(), lattice_undosys_step_free(), 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 154 of file editlattice_undo.c.
References C, CTX_data_view_layer(), Object::data, Lattice::editlatt, NULL, OB_LATTICE, OBEDIT_FROM_VIEW_LAYER, and Object::type.
Referenced by lattice_undosys_poll().
|
static |
Definition at line 275 of file editlattice_undo.c.
References LatticeUndoStep::elems, LatticeUndoStep::elems_len, LatticeUndoStep_Elem::obedit_ref, and user_data.
Referenced by ED_lattice_undosys_type().
Definition at line 187 of file editlattice_undo.c.
References C, editlatt_object_from_context(), and NULL.
Referenced by ED_lattice_undosys_type(), and lattice_undosys_step_decode().
|
static |
Definition at line 222 of file editlattice_undo.c.
References BKE_object_is_in_editmode(), BLI_assert, C, CLOG_ERROR, CTX_data_scene(), CTX_data_view_layer(), LatticeUndoStep_Elem::data, Object::data, DEG_id_tag_update(), ED_undo_object_editmode_restore_helper(), ED_undo_object_set_active_or_warn(), Lattice::editlatt, LatticeUndoStep::elems, LatticeUndoStep::elems_len, Lattice::id, Object::id, ID_RECALC_GEOMETRY, Main::is_memfile_undo_flush_needed, lattice_undosys_poll(), LOG, UndoStep::name, ID::name, NC_GEOM, ND_DATA, EditLatt::needs_flush_to_id, NULL, LatticeUndoStep_Elem::obedit_ref, undolatt_to_editlatt(), and WM_event_add_notifier().
Referenced by ED_lattice_undosys_type().
|
static |
Definition at line 192 of file editlattice_undo.c.
References C, CTX_data_view_layer(), LatticeUndoStep_Elem::data, Object::data, UndoStep::data_size, ED_undo_editmode_objects_from_view_layer(), Lattice::editlatt, LatticeUndoStep::elems, LatticeUndoStep::elems_len, Main::is_memfile_undo_flush_needed, MEM_callocN, MEM_freeN, EditLatt::needs_flush_to_id, LatticeUndoStep_Elem::obedit_ref, LatticeUndoStep::step, UndoLattice::undo_size, and undolatt_from_editlatt().
Referenced by ED_lattice_undosys_type().
Definition at line 264 of file editlattice_undo.c.
References LatticeUndoStep_Elem::data, LatticeUndoStep::elems, LatticeUndoStep::elems_len, MEM_freeN, and undolatt_free_data().
Referenced by ED_lattice_undosys_type().
|
static |
Definition at line 132 of file editlattice_undo.c.
References BKE_defvert_array_free(), UndoLattice::def, UndoLattice::dvert, MEM_freeN, NULL, UndoLattice::pntsu, UndoLattice::pntsv, and UndoLattice::pntsw.
Referenced by lattice_undosys_step_free().
|
static |
Definition at line 99 of file editlattice_undo.c.
References UndoLattice::actbp, Lattice::actbp, BKE_defvert_array_copy(), BLI_array_is_zeroed, BLI_assert, UndoLattice::def, Lattice::def, UndoLattice::du, Lattice::du, UndoLattice::dv, Lattice::dv, UndoLattice::dvert, Lattice::dvert, UndoLattice::dw, Lattice::dw, UndoLattice::fu, Lattice::fu, UndoLattice::fv, Lattice::fv, UndoLattice::fw, Lattice::fw, EditLatt::latt, MEM_dupallocN, MEM_mallocN, UndoLattice::pntsu, Lattice::pntsu, UndoLattice::pntsv, Lattice::pntsv, UndoLattice::pntsw, Lattice::pntsw, UndoLattice::typeu, Lattice::typeu, UndoLattice::typev, Lattice::typev, UndoLattice::typew, Lattice::typew, and UndoLattice::undo_size.
Referenced by lattice_undosys_step_encode().
|
static |
Definition at line 62 of file editlattice_undo.c.
References UndoLattice::actbp, Lattice::actbp, BKE_defvert_array_copy(), BKE_defvert_array_free(), UndoLattice::def, Lattice::def, UndoLattice::du, Lattice::du, UndoLattice::dv, Lattice::dv, UndoLattice::dvert, Lattice::dvert, UndoLattice::dw, Lattice::dw, UndoLattice::fu, Lattice::fu, UndoLattice::fv, Lattice::fv, UndoLattice::fw, Lattice::fw, EditLatt::latt, MEM_dupallocN, MEM_freeN, MEM_mallocN, UndoLattice::pntsu, Lattice::pntsu, UndoLattice::pntsv, Lattice::pntsv, UndoLattice::pntsw, Lattice::pntsw, UndoLattice::typeu, Lattice::typeu, UndoLattice::typev, Lattice::typev, UndoLattice::typew, and Lattice::typew.
Referenced by lattice_undosys_step_decode().
|
static |
We only need this locally.
Definition at line 45 of file editlattice_undo.c.
Referenced by lattice_undosys_step_decode().