|
Blender V4.3
|
#include <cstring>#include "MEM_guardedalloc.h"#include "DNA_armature_types.h"#include "DNA_camera_types.h"#include "DNA_constraint_types.h"#include "DNA_gpencil_legacy_types.h"#include "DNA_gpencil_modifier_types.h"#include "DNA_object_types.h"#include "BLI_blenlib.h"#include "BLI_ghash.h"#include "BLI_listbase_wrapper.hh"#include "BLI_string_utils.hh"#include "BLI_utildefines.h"#include "BLT_translation.hh"#include "BKE_action.hh"#include "BKE_animsys.h"#include "BKE_armature.hh"#include "BKE_constraint.h"#include "BKE_context.hh"#include "BKE_deform.hh"#include "BKE_grease_pencil.hh"#include "BKE_layer.hh"#include "BKE_main.hh"#include "BKE_modifier.hh"#include "DEG_depsgraph.hh"#include "RNA_access.hh"#include "RNA_define.hh"#include "WM_api.hh"#include "WM_types.hh"#include "ED_armature.hh"#include "ED_screen.hh"#include "ANIM_bone_collections.hh"#include "armature_intern.hh"Go to the source code of this file.
Classes | |
| struct | BoneFlipNameData |
Functions | |
Unique Bone Name Utility (Edit Mode) | |
| static bool | editbone_unique_check (void *arg, const char *name) |
| void | ED_armature_ebone_unique_name (ListBase *ebones, char *name, EditBone *bone) |
Unique Bone Name Utility (Object Mode) | |
| static bool | bone_unique_check (void *arg, const char *name) |
| static void | ed_armature_bone_unique_name (bArmature *arm, char *name) |
Bone Renaming (Object & Edit Mode API) | |
| static void | constraint_bone_name_fix (Object *ob, ListBase *conlist, const char *oldname, const char *newname) |
| void | ED_armature_bone_rename (Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep) |
Bone Flipping (Object & Edit Mode API) | |
| void | ED_armature_bones_flip_names (Main *bmain, bArmature *arm, ListBase *bones_names, const bool do_strip_numbers) |
Flip Bone Names (Edit Mode Operator) | |
| static int | armature_flip_names_exec (bContext *C, wmOperator *op) |
| void | ARMATURE_OT_flip_names (wmOperatorType *ot) |
Bone Auto Side Names (Edit Mode Operator) | |
| static int | armature_autoside_names_exec (bContext *C, wmOperator *op) |
| void | ARMATURE_OT_autoside_names (wmOperatorType *ot) |
Operators and API's for renaming bones both in and out of Edit Mode.
This file contains functions/API's for renaming bones and/or working with them.
Definition in file armature_naming.cc.
|
static |
Definition at line 554 of file armature_naming.cc.
References ARM_MIRROR_EDIT, BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), bone_autoside_name(), BONE_SELECTED, CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_EDITABLE, ED_armature_bone_rename(), ED_armature_ebone_get_mirrored(), bArmature::edbo, ELEM, bArmature::flag, EditBone::flag, EditBone::head, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, MAXBONENAME, EditBone::name, NC_OBJECT, ND_POSE, OPERATOR_CANCELLED, OPERATOR_FINISHED, wmOperator::ptr, RNA_enum_get(), STRNCPY, EditBone::tail, and WM_event_add_notifier().
Referenced by ARMATURE_OT_autoside_names().
|
static |
Definition at line 468 of file armature_naming.cc.
References ARM_MIRROR_EDIT, BKE_view_layer_array_from_objects_in_edit_mode_unique_data(), BLI_addtail(), BLI_freelistN(), BLI_genericNodeN(), BLI_listbase_is_empty(), BONE_SELECTED, CTX_data_edit_object(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), EBONE_VISIBLE, ED_armature_bones_flip_names(), ED_armature_ebone_get_mirrored(), bArmature::edbo, bArmature::flag, EditBone::flag, ID_RECALC_GEOMETRY, LISTBASE_FOREACH, NA_RENAME, EditBone::name, NC_ANIMATION, NC_GEOM, ND_ANIMCHAN, ND_DATA, OPERATOR_FINISHED, Object::pose, wmOperator::ptr, RNA_boolean_get(), and WM_event_add_notifier().
Referenced by ARMATURE_OT_flip_names().
| void ARMATURE_OT_autoside_names | ( | wmOperatorType * | ot | ) |
Definition at line 613 of file armature_naming.cc.
References armature_autoside_names_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::invoke, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, wmOperatorType::prop, RNA_def_enum(), wmOperatorType::srna, and WM_menu_invoke().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_flip_names | ( | wmOperatorType * | ot | ) |
Definition at line 526 of file armature_naming.cc.
References armature_flip_names_exec(), wmOperatorType::description, ED_operator_editarmature(), wmOperatorType::exec, wmOperatorType::flag, wmOperatorType::idname, wmOperatorType::name, OPTYPE_REGISTER, OPTYPE_UNDO, ot, wmOperatorType::poll, RNA_def_boolean(), and wmOperatorType::srna.
Referenced by ED_operatortypes_armature().
|
static |
Definition at line 104 of file armature_naming.cc.
References BKE_armature_find_bone_name().
Referenced by ed_armature_bone_unique_name().
|
static |
Definition at line 121 of file armature_naming.cc.
References bActionConstraint::act, BKE_action_fix_paths_rename(), BKE_constraint_targets_flush(), BKE_constraint_targets_get(), CONSTRAINT_TYPE_ACTION, Object::id, LISTBASE_FOREACH, STREQ, and STRNCPY.
Referenced by ED_armature_bone_rename().
| void ED_armature_bone_rename | ( | Main * | bmain, |
| bArmature * | arm, | ||
| const char * | oldnamep, | ||
| const char * | newnamep ) |
Bone Rename (called by UI for renaming a bone). Seems messy, but that's what you get with not using pointers but channel names :).
Definition at line 151 of file armature_naming.cc.
References BKE_animdata_fix_paths_rename_all(), BKE_armature_find_bone_name(), BKE_grease_pencil_vgroup_name_update(), BKE_modifiers_uses_armature(), BKE_object_defgroup_find_name(), BKE_object_supports_vertex_groups(), BKE_pose_channel_find_name(), BKE_pose_channels_is_valid(), BLI_assert, BLI_ghash_haskey(), BLI_ghash_insert(), BLI_ghash_remove(), UVWarpModifierData::bone_dst, UVWarpModifierData::bone_src, bArmature::bonehash, bPose::chanbase, bPose::chanhash, constraint_bone_name_fix(), Object::constraints, Object::data, DEG_id_tag_update(), Camera::dof, ed_armature_bone_unique_name(), ED_armature_ebone_find_name(), ED_armature_ebone_unique_name(), bArmature::edbo, eGpencilModifierType_Armature, eGpencilModifierType_Hook, eModifierType_Hook, eModifierType_UVWarp, ListBase::first, CameraDOFSettings::focus_object, CameraDOFSettings::focus_subtarget, Object::greasepencil_modifiers, bArmature::id, Camera::id, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_SYNC_TO_EVAL, blender::StringRefBase::is_empty(), bGPdata::layers, LISTBASE_FOREACH, MAXBONENAME, Object::modifiers, bDeformGroup::name, Bone::name, bPoseChannel::name, EditBone::name, ID::next, OB_CAMERA, View3D::ob_center, View3D::ob_center_bone, OB_GPENCIL_LEGACY, OB_GREASE_PENCIL, ArmatureGpencilModifierData::object, HookGpencilModifierData::object, HookModifierData::object, UVWarpModifierData::object_dst, UVWarpModifierData::object_src, Main::objects, PARBONE, Object::parent, Object::parsubstr, Object::partype, Object::pose, Main::screens, SPACE_VIEW3D, STREQ, STREQLEN, STRNCPY, HookGpencilModifierData::subtarget, HookModifierData::subtarget, and Object::type.
Referenced by armature_autoside_names_exec(), ED_armature_bones_flip_names(), blender::ed::outliner::namebutton_fn(), and pose_autoside_names_exec().
|
static |
Definition at line 109 of file armature_naming.cc.
References BLI_uniquename_cb(), bone_unique_check(), DATA_, and Bone::name.
Referenced by ED_armature_bone_rename().
| void ED_armature_bones_flip_names | ( | Main * | bmain, |
| bArmature * | arm, | ||
| ListBase * | bones_names, | ||
| bool | do_strip_numbers ) |
Renames (by flipping) all selected bones at once.
This way if we are flipping related bones (e.g., Bone.L, Bone.R) at the same time all the bones are safely renamed, without conflicting with each other.
| arm | Armature the bones belong to |
| bones_names | List of bone conflict elements (LinkData pointing to names). |
| do_strip_numbers | if set, try to get rid of dot-numbers at end of bone names. |
Definition at line 424 of file armature_naming.cc.
References BLI_addtail(), BLI_string_flip_side_name(), ED_armature_bone_rename(), LISTBASE_FOREACH, MAXBONENAME, BoneFlipNameData::name, BoneFlipNameData::name_flip, STREQ, and STRNCPY.
Referenced by armature_flip_names_exec(), and pose_flip_names_exec().
Ensure the bone name is unique. If bone is already in list, pass it as argument to ignore it.
Definition at line 86 of file armature_naming.cc.
References BLI_uniquename_cb(), data, DATA_, editbone_unique_check(), and EditBone::name.
Referenced by armature_extrude_exec(), armature_subdivide_exec(), duplicateEditBoneObjects(), ED_armature_bone_rename(), ED_armature_ebone_add(), and ED_armature_join_objects_exec().
|
static |
Definition at line 64 of file armature_naming.cc.
References EditBone::bone, ED_armature_ebone_find_name(), and STREQ.
Referenced by ED_armature_ebone_unique_name().