67 if (ebone->name ==
name && ebone != bone) {
75 return dupli && dupli != bone;
127 ListBase targets = {
nullptr,
nullptr};
132 if (ct->tar == rename_ob) {
133 if (
STREQ(ct->subtarget, oldname)) {
165 const char *oldnamep,
166 const char *newnamep)
223 if (arm == ob->
data) {
276 "New bone name collides with an existing vertex "
277 "group name, vertex group "
278 "names are unchanged. (%s::%s)",
346 if (parent ==
nullptr) {
351 layer->set_parent_bone_name(newname);
409 const bool do_strip_numbers)
411 ListBase bones_names_conflicts = {
nullptr};
419 char *
name =
static_cast<char *
>(link->data);
461 for (
Object *ob : objects) {
465 if (ob_active->
pose ==
nullptr) {
509 ot->name =
"Flip Names";
510 ot->idname =
"ARMATURE_OT_flip_names";
511 ot->description =
"Flips (and corrects) the axis suffixes of the names of selected bones";
524 "Try to remove right-most dot-number from flipped names.\n"
525 "Warning: May result in incoherent naming in some cases");
541 bool changed_multi =
false;
545 for (
Object *ob : objects) {
547 bool changed =
false;
550 if (
ELEM(
nullptr, ob, ob->pose)) {
582 changed_multi =
true;
596 {0,
"XAXIS", 0,
"X-Axis",
"Left/Right"},
597 {1,
"YAXIS", 0,
"Y-Axis",
"Front/Back"},
598 {2,
"ZAXIS", 0,
"Z-Axis",
"Top/Bottom"},
599 {0,
nullptr, 0,
nullptr,
nullptr},
603 ot->name =
"Auto-Name by Axis";
604 ot->idname =
"ARMATURE_OT_autoside_names";
606 "Automatically renames the selected bones according to which side of the target axis they "
618 ot->prop =
RNA_def_enum(
ot->srna,
"type", axis_items, 0,
"Axis",
"Axis to tag names with");
Functions to deal with Armatures.
Blender kernel action and pose functionality.
bool BKE_pose_channels_is_valid(const bPose *pose) ATTR_WARN_UNUSED_RESULT
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
void BKE_action_fix_paths_rename(struct ID *owner_id, struct bAction *act, int32_t slot_handle, const char *prefix, const char *oldName, const char *newName, int oldSubscript, int newSubscript, bool verify_paths)
Bone * BKE_armature_find_bone_name(bArmature *arm, const char *name)
bool bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail)
void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *targets, bool no_copy)
int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_targets)
Scene * CTX_data_scene(const bContext *C)
Object * CTX_data_edit_object(const bContext *C)
Main * CTX_data_main(const bContext *C)
View3D * CTX_wm_view3d(const bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
Low-level operations for grease pencil.
void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name)
blender::Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
bool BKE_modifiers_uses_armature(Object *ob, bArmature *arm)
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
LinkData * BLI_genericNodeN(void *data)
#define LISTBASE_FOREACH(type, var, list)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
char * STRNCPY(char(&dst)[N], const char *src)
#define STRNCPY_UTF8(dst, src)
size_t BLI_string_flip_side_name(char *name_dst, const char *name_src, bool strip_number, size_t name_dst_maxncpy) ATTR_NONNULL(1
size_t void BLI_uniquename_cb(blender::FunctionRef< bool(blender::StringRefNull)> unique_check, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(2
#define STREQLEN(a, b, n)
void DEG_id_tag_update(ID *id, unsigned int flags)
Object is a sort of wrapper for general info.
#define EBONE_EDITABLE(ebone)
bool ED_operator_editarmature(bContext *C)
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)
static wmOperatorStatus armature_autoside_names_exec(bContext *C, wmOperator *op)
static void ed_armature_bone_unique_name(bArmature *arm, char *name)
void ARMATURE_OT_flip_names(wmOperatorType *ot)
static wmOperatorStatus armature_flip_names_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_autoside_names(wmOperatorType *ot)
static bool editbone_unique_check(ListBase *ebones, const StringRefNull name, EditBone *bone)
void ED_armature_ebone_unique_name(ListBase *ebones, char *name, EditBone *bone)
void ED_armature_bones_flip_names(Main *bmain, bArmature *arm, ListBase *bones_names, const bool do_strip_numbers)
EditBone * ED_armature_ebone_find_name(const ListBase *edbo, const char *name)
EditBone * ED_armature_ebone_get_mirrored(const ListBase *edbo, EditBone *ebo)
constexpr bool is_empty() const
constexpr const char * c_str() const
bool bone_is_selected(const bArmature *armature, const Bone *bone)
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
int RNA_enum_get(PointerRNA *ptr, const char *name)
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
char name_flip[MAXBONENAME]
struct Object * focus_object
struct CameraDOFSettings dof
struct Object * object_dst
struct Object * object_src
struct Object * ob_center
int32_t action_slot_handle
void WM_global_reportf(eReportType type, const char *format,...)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)