|
Blender V5.0
|
#include <cstring>#include "DNA_armature_types.h"#include "DNA_camera_types.h"#include "DNA_constraint_types.h"#include "DNA_object_types.h"#include "BLI_ghash.h"#include "BLI_listbase_wrapper.hh"#include "BLI_string.h"#include "BLI_string_utf8.h"#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_armature.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 (ListBase *ebones, const StringRefNull name, EditBone *bone) |
| void | ED_armature_ebone_unique_name (ListBase *ebones, char *name, EditBone *bone) |
Unique Bone Name Utility (Object Mode) | |
| static void | ed_armature_bone_unique_name (bArmature *arm, char *name) |
Bone Renaming (Object & Edit Mode API) | |
| static void | constraint_bone_name_fix (Object *rename_ob, Object *constraint_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 wmOperatorStatus | armature_flip_names_exec (bContext *C, wmOperator *op) |
| void | ARMATURE_OT_flip_names (wmOperatorType *ot) |
Bone Auto Side Names (Edit Mode Operator) | |
| static wmOperatorStatus | 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 534 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, C, 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_UTF8, EditBone::tail, and WM_event_add_notifier().
Referenced by ARMATURE_OT_autoside_names().
|
static |
Definition at line 450 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(), blender::animrig::bone_is_selected(), BONE_SELECTED, C, CTX_data_edit_object(), CTX_data_main(), CTX_data_scene(), CTX_data_view_layer(), CTX_wm_view3d(), DEG_id_tag_update(), 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 593 of file armature_naming.cc.
References armature_autoside_names_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, RNA_def_enum(), and WM_menu_invoke().
Referenced by ED_operatortypes_armature().
| void ARMATURE_OT_flip_names | ( | wmOperatorType * | ot | ) |
Definition at line 506 of file armature_naming.cc.
References armature_flip_names_exec(), ED_operator_editarmature(), OPTYPE_REGISTER, OPTYPE_UNDO, ot, and RNA_def_boolean().
Referenced by ED_operatortypes_armature().
|
static |
Helper call for armature_bone_rename().
| rename_ob | The object whose bone was renamed. |
| constraint_ob | The object that owns the constraints in conlist. |
Definition at line 120 of file armature_naming.cc.
References bActionConstraint::act, bActionConstraint::action_slot_handle, BKE_action_fix_paths_rename(), BKE_constraint_targets_flush(), BKE_constraint_targets_get(), CONSTRAINT_TYPE_ACTION, Object::id, LISTBASE_FOREACH, STREQ, and STRNCPY_UTF8.
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 163 of file armature_naming.cc.
References bScreen::areabase, 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, eModifierType_Hook, eModifierType_UVWarp, ListBase::first, CameraDOFSettings::focus_object, CameraDOFSettings::focus_subtarget, bArmature::id, bScreen::id, Camera::id, Object::id, ID_RECALC_GEOMETRY, ID_RECALC_SYNC_TO_EVAL, blender::StringRefBase::is_empty(), LISTBASE_FOREACH, MAXBONENAME, Object::modifiers, Bone::name, bPoseChannel::name, EditBone::name, ID::name, Node::name, ID::next, OB_CAMERA, View3D::ob_center, View3D::ob_center_bone, OB_GREASE_PENCIL, HookModifierData::object, UVWarpModifierData::object_dst, UVWarpModifierData::object_src, Main::objects, PARBONE, Object::parent, Object::parsubstr, Object::partype, Object::pose, RPT_WARNING, Main::screens, SPACE_VIEW3D, STREQ, STREQLEN, STRNCPY(), STRNCPY_UTF8, HookModifierData::subtarget, Object::type, and WM_global_reportf().
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 96 of file armature_naming.cc.
References BKE_armature_find_bone_name(), BLI_uniquename_cb(), blender::StringRefNull::c_str(), DATA_, Bone::name, and 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 406 of file armature_naming.cc.
References BLI_addtail(), BLI_string_flip_side_name(), ED_armature_bone_rename(), LISTBASE_FOREACH, MAXBONENAME, BoneFlipNameData::name, name, BoneFlipNameData::name_flip, STREQ, and STRNCPY_UTF8.
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 78 of file armature_naming.cc.
References BLI_uniquename_cb(), DATA_, editbone_unique_check(), EditBone::name, and 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 61 of file armature_naming.cc.
References ED_armature_ebone_find_name(), and name.
Referenced by ED_armature_ebone_unique_name().