Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "CLG_log.h"
#include "DNA_armature_types.h"
#include "DNA_layer_types.h"
#include "DNA_object_types.h"
#include "DNA_scene_types.h"
#include "BLI_array_utils.h"
#include "BLI_listbase.h"
#include "BKE_armature.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_armature.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 | UndoArmature |
struct | ArmatureUndoStep_Elem |
struct | ArmatureUndoStep |
Variables | |
static CLG_LogRef | LOG = {"ed.undo.armature"} |
Undo Conversion | |
typedef struct UndoArmature | UndoArmature |
static void | undoarm_to_editarm (UndoArmature *uarm, bArmature *arm) |
static void * | undoarm_from_editarm (UndoArmature *uarm, bArmature *arm) |
static void | undoarm_free_data (UndoArmature *uarm) |
static Object * | editarm_object_from_context (bContext *C) |
Implements ED Undo System | |
| |
typedef struct ArmatureUndoStep_Elem | ArmatureUndoStep_Elem |
typedef struct ArmatureUndoStep | ArmatureUndoStep |
static bool | armature_undosys_poll (bContext *C) |
static bool | armature_undosys_step_encode (struct bContext *C, struct Main *bmain, UndoStep *us_p) |
static void | armature_undosys_step_decode (struct bContext *C, struct Main *bmain, UndoStep *us_p, const eUndoStepDir UNUSED(dir), bool UNUSED(is_final)) |
static void | armature_undosys_step_free (UndoStep *us_p) |
static void | armature_undosys_foreach_ID_ref (UndoStep *us_p, UndoTypeForEachIDRefFn foreach_ID_ref_fn, void *user_data) |
void | ED_armature_undosys_type (UndoType *ut) |
typedef struct ArmatureUndoStep ArmatureUndoStep |
typedef struct ArmatureUndoStep_Elem ArmatureUndoStep_Elem |
typedef struct UndoArmature UndoArmature |
|
static |
Definition at line 219 of file editarmature_undo.c.
References ArmatureUndoStep::elems, ArmatureUndoStep::elems_len, ArmatureUndoStep_Elem::obedit_ref, and user_data.
Referenced by ED_armature_undosys_type().
Definition at line 131 of file editarmature_undo.c.
References C, editarm_object_from_context(), and NULL.
Referenced by armature_undosys_step_decode(), and ED_armature_undosys_type().
|
static |
Definition at line 166 of file editarmature_undo.c.
References armature_undosys_poll(), BKE_object_is_in_editmode(), BLI_assert, C, CLOG_ERROR, CTX_data_scene(), CTX_data_view_layer(), ArmatureUndoStep_Elem::data, Object::data, DEG_id_tag_update(), ED_undo_object_editmode_restore_helper(), ED_undo_object_set_active_or_warn(), bArmature::edbo, ArmatureUndoStep::elems, ArmatureUndoStep::elems_len, bArmature::id, Object::id, ID_RECALC_GEOMETRY, Main::is_memfile_undo_flush_needed, LOG, UndoStep::name, ID::name, NC_GEOM, ND_DATA, bArmature::needs_flush_to_id, NULL, ArmatureUndoStep_Elem::obedit_ref, undoarm_to_editarm(), and WM_event_add_notifier().
Referenced by ED_armature_undosys_type().
|
static |
Definition at line 136 of file editarmature_undo.c.
References C, CTX_data_view_layer(), ArmatureUndoStep_Elem::data, UndoStep::data_size, ED_undo_editmode_objects_from_view_layer(), ArmatureUndoStep::elems, ArmatureUndoStep::elems_len, Main::is_memfile_undo_flush_needed, MEM_callocN, MEM_freeN, bArmature::needs_flush_to_id, ArmatureUndoStep_Elem::obedit_ref, ArmatureUndoStep::step, UndoArmature::undo_size, and undoarm_from_editarm().
Referenced by ED_armature_undosys_type().
Definition at line 208 of file editarmature_undo.c.
References ArmatureUndoStep_Elem::data, ArmatureUndoStep::elems, ArmatureUndoStep::elems_len, MEM_freeN, and undoarm_free_data().
Referenced by ED_armature_undosys_type().
Export for ED_undo_sys.
Definition at line 231 of file editarmature_undo.c.
References armature_undosys_foreach_ID_ref(), armature_undosys_poll(), armature_undosys_step_decode(), armature_undosys_step_encode(), armature_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 98 of file editarmature_undo.c.
References C, CTX_data_view_layer(), Object::data, bArmature::edbo, NULL, OB_ARMATURE, OBEDIT_FROM_VIEW_LAYER, and Object::type.
Referenced by armature_undosys_poll().
|
static |
Definition at line 93 of file editarmature_undo.c.
References ED_armature_ebone_listbase_free(), and UndoArmature::lb.
Referenced by armature_undosys_step_free().
|
static |
Definition at line 69 of file editarmature_undo.c.
References UndoArmature::act_edbone, bArmature::act_edbone, BLI_array_is_zeroed, BLI_assert, EditBone::ebone, ED_armature_ebone_listbase_copy(), ED_armature_ebone_listbase_temp_clear(), bArmature::edbo, UndoArmature::lb, LISTBASE_FOREACH, EditBone::temp, and UndoArmature::undo_size.
Referenced by armature_undosys_step_encode().
|
static |
Definition at line 50 of file editarmature_undo.c.
References UndoArmature::act_edbone, bArmature::act_edbone, EditBone::ebone, ED_armature_ebone_listbase_copy(), ED_armature_ebone_listbase_free(), ED_armature_ebone_listbase_temp_clear(), bArmature::edbo, UndoArmature::lb, NULL, and EditBone::temp.
Referenced by armature_undosys_step_decode().
|
static |
We only need this locally.
Definition at line 38 of file editarmature_undo.c.
Referenced by armature_undosys_step_decode().