|
Blender V4.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 "BLI_map.hh"#include "BLI_string.h"#include "BKE_armature.hh"#include "BKE_context.hh"#include "BKE_idprop.hh"#include "BKE_layer.hh"#include "BKE_main.hh"#include "BKE_object.hh"#include "BKE_undo_system.hh"#include "DEG_depsgraph.hh"#include "ED_armature.hh"#include "ED_object.hh"#include "ED_undo.hh"#include "ED_util.hh"#include "ANIM_bone_collections.hh"#include "WM_api.hh"#include "WM_types.hh"Go to the source code of this file.
Classes | |
| struct | UndoArmature |
| struct | ArmatureUndoStep_Elem |
| struct | ArmatureUndoStep |
Functions | |
| static void | remap_ebone_bone_collection_references (ListBase *edit_bones, const blender::Map< BoneCollection *, BoneCollection * > &bcoll_map) |
Undo Conversion | |
| 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 | |
| |
| static bool | armature_undosys_poll (bContext *C) |
| static bool | armature_undosys_step_encode (bContext *C, Main *bmain, UndoStep *us_p) |
| static void | armature_undosys_step_decode (bContext *C, Main *bmain, UndoStep *us_p, const eUndoStepDir, bool) |
| 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) |
Variables | |
| static CLG_LogRef | LOG = {"ed.undo.armature"} |
|
static |
Definition at line 301 of file editarmature_undo.cc.
References ArmatureUndoStep::elems, ArmatureUndoStep::elems_len, ArmatureUndoStep_Elem::obedit_ref, and ArmatureUndoStep::scene_ref.
Referenced by ED_armature_undosys_type().
|
static |
Definition at line 211 of file editarmature_undo.cc.
References editarm_object_from_context().
Referenced by armature_undosys_step_decode(), and ED_armature_undosys_type().
|
static |
Definition at line 247 of file editarmature_undo.cc.
References armature_undosys_poll(), BKE_object_is_in_editmode(), BLI_assert, CLOG_ERROR, CTX_data_scene(), CTX_data_view_layer(), CTX_wm_manager(), ArmatureUndoStep_Elem::data, Object::data, DEG_id_tag_update(), ED_undo_object_editmode_restore_helper(), ED_undo_object_editmode_validate_scene_from_windows(), 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, ID::name, UndoStep::name, NC_GEOM, ND_DATA, bArmature::needs_flush_to_id, ArmatureUndoStep_Elem::obedit_ref, ArmatureUndoStep::scene_ref, undoarm_to_editarm(), and WM_event_add_notifier().
Referenced by ED_armature_undosys_type().
Definition at line 216 of file editarmature_undo.cc.
References CTX_data_scene(), 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, bArmature::needs_flush_to_id, ArmatureUndoStep_Elem::obedit_ref, scene, ArmatureUndoStep::scene_ref, ArmatureUndoStep::step, UndoArmature::undo_size, and undoarm_from_editarm().
Referenced by ED_armature_undosys_type().
|
static |
Definition at line 290 of file editarmature_undo.cc.
References ArmatureUndoStep_Elem::data, ArmatureUndoStep::elems, ArmatureUndoStep::elems_len, MEM_freeN(), and undoarm_free_data().
Referenced by ED_armature_undosys_type().
| void ED_armature_undosys_type | ( | UndoType * | ut | ) |
Export for ED_undo_sys.
Definition at line 314 of file editarmature_undo.cc.
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 174 of file editarmature_undo.cc.
References BKE_view_layer_edit_object_get(), BKE_view_layer_synced_ensure(), CTX_data_scene(), CTX_data_view_layer(), Object::data, bArmature::edbo, OB_ARMATURE, and Object::type.
Referenced by armature_undosys_poll().
|
static |
Remaps edit-bone collection membership.
This is intended to be used in combination with ED_armature_ebone_listbase_copy() and ANIM_bonecoll_listbase_copy() to make a full duplicate of both edit bones and collections together.
Definition at line 57 of file editarmature_undo.cc.
References LISTBASE_FOREACH, and blender::Map< Key, Value, InlineBufferCapacity, ProbingStrategy, Hash, IsEqual, Slot, Allocator >::lookup().
Referenced by undoarm_from_editarm(), and undoarm_to_editarm().
|
static |
Definition at line 168 of file editarmature_undo.cc.
References blender::animrig::ANIM_bonecoll_array_free(), UndoArmature::collection_array, UndoArmature::collection_array_num, UndoArmature::ebones, and ED_armature_ebone_listbase_free().
Referenced by armature_undosys_step_free().
|
static |
Definition at line 125 of file editarmature_undo.cc.
References bArmature::act_edbone, UndoArmature::act_edbone, bArmature::active_collection_name, UndoArmature::active_collection_name, blender::animrig::ANIM_bonecoll_array_copy_no_membership(), BLI_array_is_zeroed, BLI_assert, BLI_listbase_count(), bArmature::collection_array, UndoArmature::collection_array, bArmature::collection_array_num, UndoArmature::collection_array_num, bArmature::collection_root_count, UndoArmature::collection_root_count, EditBone::ebone, UndoArmature::ebones, ED_armature_ebone_listbase_copy(), ED_armature_ebone_listbase_temp_clear(), bArmature::edbo, LISTBASE_FOREACH, remap_ebone_bone_collection_references(), STRNCPY, EditBone::temp, and UndoArmature::undo_size.
Referenced by armature_undosys_step_encode().
|
static |
Definition at line 82 of file editarmature_undo.cc.
References bArmature::act_edbone, UndoArmature::act_edbone, UndoArmature::active_collection_name, ANIM_armature_bonecoll_active_set(), ANIM_armature_bonecoll_get_by_name(), ANIM_armature_runtime_refresh(), blender::animrig::ANIM_bonecoll_array_copy_no_membership(), blender::animrig::ANIM_bonecoll_array_free(), blender::animrig::bonecolls_copy_expanded_flag(), bArmature::collection_array, UndoArmature::collection_array, bArmature::collection_array_num, UndoArmature::collection_array_num, bArmature::collection_root_count, UndoArmature::collection_root_count, EditBone::ebone, UndoArmature::ebones, ED_armature_ebone_listbase_copy(), ED_armature_ebone_listbase_free(), ED_armature_ebone_listbase_temp_clear(), bArmature::edbo, remap_ebone_bone_collection_references(), and EditBone::temp.
Referenced by armature_undosys_step_decode().
|
static |
We only need this locally.
Definition at line 46 of file editarmature_undo.cc.
Referenced by armature_undosys_step_decode().