Blender
V3.3
|
#include <math.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "BLI_array_utils.h"
#include "BLI_listbase.h"
#include "BLI_utildefines.h"
#include "DNA_defs.h"
#include "DNA_layer_types.h"
#include "DNA_meta_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BKE_context.h"
#include "BKE_layer.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_undo_system.h"
#include "DEG_depsgraph.h"
#include "ED_mball.h"
#include "ED_object.h"
#include "ED_undo.h"
#include "ED_util.h"
#include "WM_api.h"
#include "WM_types.h"
Go to the source code of this file.
Classes | |
struct | UndoMBall |
struct | MBallUndoStep_Elem |
struct | MBallUndoStep |
Variables | |
static CLG_LogRef | LOG = {"ed.undo.mball"} |
Undo Conversion | |
typedef struct UndoMBall | UndoMBall |
static void | freeMetaElemlist (ListBase *lb) |
static void | undomball_to_editmball (UndoMBall *umb, MetaBall *mb) |
static void * | editmball_from_undomball (UndoMBall *umb, MetaBall *mb) |
static void | undomball_free_data (UndoMBall *umb) |
static Object * | editmball_object_from_context (bContext *C) |
Implements ED Undo System | |
| |
typedef struct MBallUndoStep_Elem | MBallUndoStep_Elem |
typedef struct MBallUndoStep | MBallUndoStep |
static bool | mball_undosys_poll (bContext *C) |
static bool | mball_undosys_step_encode (struct bContext *C, struct Main *bmain, UndoStep *us_p) |
static void | mball_undosys_step_decode (struct bContext *C, struct Main *bmain, UndoStep *us_p, const eUndoStepDir UNUSED(dir), bool UNUSED(is_final)) |
static void | mball_undosys_step_free (UndoStep *us_p) |
static void | mball_undosys_foreach_ID_ref (UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data) |
void | ED_mball_undosys_type (UndoType *ut) |
typedef struct MBallUndoStep MBallUndoStep |
typedef struct MBallUndoStep_Elem MBallUndoStep_Elem |
Export for ED_undo_sys.
Definition at line 242 of file editmball_undo.c.
References UndoType::flags, mball_undosys_foreach_ID_ref(), mball_undosys_poll(), mball_undosys_step_decode(), mball_undosys_step_encode(), mball_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 83 of file editmball_undo.c.
References BLI_addtail(), BLI_array_is_zeroed, BLI_assert, UndoMBall::editelems, MetaBall::editelems, ListBase::first, MetaBall::lastelem, UndoMBall::lastelem_index, MEM_dupallocN, and UndoMBall::undo_size.
Referenced by mball_undosys_step_encode().
Definition at line 110 of file editmball_undo.c.
References C, CTX_data_view_layer(), Object::data, MetaBall::editelems, NULL, OB_MBALL, OBEDIT_FROM_VIEW_LAYER, and Object::type.
Referenced by mball_undosys_poll().
Definition at line 54 of file editmball_undo.c.
References BLI_pophead(), MEM_freeN, and NULL.
Referenced by undomball_free_data(), and undomball_to_editmball().
|
static |
Definition at line 230 of file editmball_undo.c.
References MBallUndoStep::elems, MBallUndoStep::elems_len, MBallUndoStep_Elem::obedit_ref, and user_data.
Referenced by ED_mball_undosys_type().
Definition at line 142 of file editmball_undo.c.
References C, editmball_object_from_context(), and NULL.
Referenced by ED_mball_undosys_type(), and mball_undosys_step_decode().
|
static |
Definition at line 177 of file editmball_undo.c.
References BKE_object_is_in_editmode(), BLI_assert, C, CLOG_ERROR, CTX_data_scene(), CTX_data_view_layer(), MBallUndoStep_Elem::data, Object::data, DEG_id_tag_update(), ED_undo_object_editmode_restore_helper(), ED_undo_object_set_active_or_warn(), MetaBall::editelems, MBallUndoStep::elems, MBallUndoStep::elems_len, MetaBall::id, Object::id, ID_RECALC_GEOMETRY, Main::is_memfile_undo_flush_needed, LOG, mball_undosys_poll(), UndoStep::name, ID::name, NC_GEOM, ND_DATA, MetaBall::needs_flush_to_id, NULL, MBallUndoStep_Elem::obedit_ref, undomball_to_editmball(), and WM_event_add_notifier().
Referenced by ED_mball_undosys_type().
|
static |
Definition at line 147 of file editmball_undo.c.
References C, CTX_data_view_layer(), MBallUndoStep_Elem::data, Object::data, UndoStep::data_size, ED_undo_editmode_objects_from_view_layer(), editmball_from_undomball(), MBallUndoStep::elems, MBallUndoStep::elems_len, Main::is_memfile_undo_flush_needed, MEM_callocN, MEM_freeN, MetaBall::needs_flush_to_id, MBallUndoStep_Elem::obedit_ref, MBallUndoStep::step, and UndoMBall::undo_size.
Referenced by ED_mball_undosys_type().
Definition at line 219 of file editmball_undo.c.
References MBallUndoStep_Elem::data, MBallUndoStep::elems, MBallUndoStep::elems_len, MEM_freeN, and undomball_free_data().
Referenced by ED_mball_undosys_type().
Definition at line 105 of file editmball_undo.c.
References UndoMBall::editelems, and freeMetaElemlist().
Referenced by mball_undosys_step_free().
Definition at line 67 of file editmball_undo.c.
References BLI_addtail(), UndoMBall::editelems, MetaBall::editelems, ListBase::first, freeMetaElemlist(), MetaBall::lastelem, UndoMBall::lastelem_index, MEM_dupallocN, and NULL.
Referenced by mball_undosys_step_decode().
|
static |
We only need this locally.
Definition at line 41 of file editmball_undo.c.
Referenced by mball_undosys_step_decode().