69 } *data =
static_cast<Arg *
>(arg);
75 if (
STREQ(ebone->name, name) && ebone != data->bone) {
83 return dupli && dupli != data->
bone;
127 ListBase targets = {
nullptr,
nullptr};
133 if (
STREQ(ct->subtarget, oldname)) {
134 STRNCPY(ct->subtarget, newname);
146 &ob->
id, actcon->
act,
"pose.bones", oldname, newname, 0, 0,
true);
153 const char *oldnamep,
154 const char *newnamep)
211 if (arm == ob->
data) {
324 if ((gpl->parent !=
nullptr) && (gpl->parent->data == arm)) {
325 if (
STREQ(gpl->parsubstr, oldname)) {
326 STRNCPY(gpl->parsubstr, newname);
332 switch (gp_md->type) {
364 if (parent ==
nullptr) {
369 layer->set_parent_bone_name(newname);
392 screen =
static_cast<bScreen *
>(screen->id.next))
427 const bool do_strip_numbers)
429 ListBase bones_names_conflicts = {
nullptr};
437 char *name =
static_cast<char *
>(link->data);
445 if (!
STREQ(name, name_flip)) {
479 for (
Object *ob : objects) {
483 if (ob_active->
pose ==
nullptr) {
530 ot->
idname =
"ARMATURE_OT_flip_names";
531 ot->
description =
"Flips (and corrects) the axis suffixes of the names of selected bones";
544 "Try to remove right-most dot-number from flipped names.\n"
545 "Warning: May result in incoherent naming in some cases");
561 bool changed_multi =
false;
565 for (
Object *ob : objects) {
567 bool changed =
false;
570 if (
ELEM(
nullptr, ob, ob->pose)) {
602 changed_multi =
true;
616 {0,
"XAXIS", 0,
"X-Axis",
"Left/Right"},
617 {1,
"YAXIS", 0,
"Y-Axis",
"Front/Back"},
618 {2,
"ZAXIS", 0,
"Z-Axis",
"Top/Bottom"},
619 {0,
nullptr, 0,
nullptr,
nullptr},
623 ot->
name =
"Auto-Name by Axis";
624 ot->
idname =
"ARMATURE_OT_autoside_names";
626 "Automatically renames the selected bones according to which side of the target axis they "
C++ functions to deal with Armature collections (i.e. the successor of bone layers).
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, 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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
#define LISTBASE_FOREACH(type, var, list)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
struct LinkData * BLI_genericNodeN(void *data)
#define STRNCPY(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(UniquenameCheckCallback unique_check, void *arg, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(1
#define STREQLEN(a, b, n)
void DEG_id_tag_update(ID *id, unsigned int flags)
@ eGpencilModifierType_Hook
@ eGpencilModifierType_Armature
Object is a sort of wrapper for general info.
#define EBONE_VISIBLE(arm, ebone)
#define EBONE_EDITABLE(ebone)
bool ED_operator_editarmature(bContext *C)
Read Guarded memory(de)allocation.
static int armature_autoside_names_exec(bContext *C, wmOperator *op)
static bool editbone_unique_check(void *arg, const char *name)
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
static bool bone_unique_check(void *arg, const char *name)
static void ed_armature_bone_unique_name(bArmature *arm, char *name)
static int armature_flip_names_exec(bContext *C, wmOperator *op)
void ARMATURE_OT_flip_names(wmOperatorType *ot)
void ARMATURE_OT_autoside_names(wmOperatorType *ot)
void ED_armature_ebone_unique_name(ListBase *ebones, char *name, EditBone *bone)
static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *oldname, const char *newname)
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
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
ListBase greasepencil_modifiers
struct Object * object_dst
struct Object * object_src
struct Object * ob_center
bool(* poll)(bContext *C) ATTR_WARN_UNUSED_RESULT
int(* invoke)(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
int(* exec)(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)