Blender V5.3
armature_naming.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2001-2002 NaN Holding BV. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
11
12#include <cstring>
13
14#include "DNA_armature_types.h"
15#include "DNA_camera_types.h"
17#include "DNA_object_types.h"
18
19#include "BLI_ghash.hh"
21#include "BLI_map.hh"
22#include "BLI_string.hh"
23#include "BLI_string_ref.hh"
24#include "BLI_string_utf8.hh"
25#include "BLI_string_utils.hh"
26#include "BLI_utildefines.hh"
27
28#include "BLT_translation.hh"
29
30#include "BKE_action.hh"
31#include "BKE_animsys.hh"
32#include "BKE_armature.hh"
33#include "BKE_constraint.h"
34#include "BKE_context.hh"
35#include "BKE_deform.hh"
36#include "BKE_grease_pencil.hh"
37#include "BKE_layer.hh"
38#include "BKE_main.hh"
39#include "BKE_modifier.hh"
40
41#include "DEG_depsgraph.hh"
42
43#include "RNA_access.hh"
44#include "RNA_define.hh"
45#include "RNA_path.hh"
46
47#include "WM_api.hh"
48#include "WM_types.hh"
49
50#include "ED_armature.hh"
51#include "ED_screen.hh"
52
53#include "ANIM_armature.hh"
54
55#include "armature_intern.hh"
56
57namespace blender {
58
59/* -------------------------------------------------------------------- */
62
63/* NOTE: there's a ed_armature_bone_unique_name() too! */
64static bool editbone_unique_check(ListBaseT<EditBone> *ebones,
65 const StringRefNull name,
66 EditBone *bone)
67{
68 if (bone) {
69 /* This indicates that there is a bone to ignore. This means ED_armature_ebone_find_name()
70 * cannot be used, as it might return the bone we should be ignoring. */
71 for (EditBone *ebone : ListBaseWrapper<EditBone>(ebones)) {
72 if (ebone->name == name && ebone != bone) {
73 return true;
74 }
75 }
76 return false;
77 }
78
79 EditBone *dupli = ED_armature_ebone_find_name(ebones, name.c_str());
80 return dupli && dupli != bone;
81}
82
83void ED_armature_ebone_unique_name(ListBaseT<EditBone> *ebones, char *name, EditBone *bone)
84{
86 [&](const StringRefNull check_name) {
87 return editbone_unique_check(ebones, check_name, bone);
88 },
90 '.',
91 name,
92 sizeof(bone->name));
93}
94
96
97/* -------------------------------------------------------------------- */
100
101static void ed_armature_bone_unique_name(bArmature *arm, char *name)
102{
104 [&](const StringRefNull check_name) {
105 return BKE_armature_find_bone_name(arm, check_name.c_str()) != nullptr;
106 },
108 '.',
109 name,
110 sizeof(Bone::name));
111}
112
114
115/* -------------------------------------------------------------------- */
118
125static void constraint_bone_name_fix(Object *rename_ob,
126 Object *constraint_ob,
127 ListBaseT<bConstraint> *conlist,
128 const char *oldname,
129 const char *newname)
130{
131 for (bConstraint &curcon : *conlist) {
132 ListBaseT<bConstraintTarget> targets = {nullptr, nullptr};
133
134 /* constraint targets */
135 if (BKE_constraint_targets_get(&curcon, &targets)) {
136 for (bConstraintTarget &ct : targets) {
137 if (ct.tar != rename_ob) {
138 continue;
139 }
140 if (STREQ(ct.subtarget, oldname)) {
141 STRNCPY_UTF8(ct.subtarget, newname);
142 }
143 }
144
145 BKE_constraint_targets_flush(&curcon, &targets, false);
146 }
147
148 /* Actions from action constraints.
149 *
150 * We only rename channels in the action if the action constraint and the
151 * bone rename are from the same object. This is because the action of an
152 * action constraint animates the constrained object/bone, it does not
153 * animate the constraint target. */
154 if (curcon.type == CONSTRAINT_TYPE_ACTION && constraint_ob == rename_ob) {
155 bActionConstraint *actcon = static_cast<bActionConstraint *>(curcon.data);
157 actcon->act,
158 actcon->action_slot_handle,
159 "pose.bones",
160 oldname,
161 newname,
162 true);
163 }
164 }
165}
166
168 bArmature *arm,
169 const char *oldnamep,
170 const char *newnamep)
171{
172 /* If old and new name match we don't need to do anything. */
173 if (STREQLEN(oldnamep, newnamep, MAXBONENAME)) {
174 return;
175 }
176
177 char newname[MAXBONENAME];
178 char oldname[MAXBONENAME];
179 /* we alter newname string... so make copy */
180 STRNCPY_UTF8(newname, newnamep);
181 /* we use oldname for search... so make copy */
182 STRNCPY(oldname, oldnamep); /* Allow non UTF8 encoding for the old name. */
183
184 /* now check if we're in editmode, we need to find the unique name */
185 if (arm->edbo) {
186 EditBone *eBone = ED_armature_ebone_find_name(arm->edbo, oldname);
187
188 if (eBone) {
189 ED_armature_ebone_unique_name(arm->edbo, newname, nullptr);
190 STRNCPY_UTF8(eBone->name, newname);
191 }
192 else {
193 return;
194 }
195 }
196 else {
197 Bone *bone = BKE_armature_find_bone_name(arm, oldname);
198
199 if (bone) {
200 ed_armature_bone_unique_name(arm, newname);
201
202 if (arm->bonehash) {
204 BLI_ghash_remove(arm->bonehash, bone->name, nullptr, nullptr);
205 }
206
207 STRNCPY_UTF8(bone->name, newname);
208
209 if (arm->bonehash) {
210 BLI_ghash_insert(arm->bonehash, bone->name, bone);
211 }
212 }
213 else {
214 return;
215 }
216 }
217
218 /* force evaluation copy to update database */
220 const DriverMap driver_map = BKE_animdata_build_driver_target_map(*bmain);
221 std::string old_name_esc = RNA_path_name_to_infix(oldname);
222 std::string new_name_esc = RNA_path_name_to_infix(newname);
223
224 Object *ob;
225 /* Find all uses of the bone name in Main. Bones are usually referred to by name which is why we
226 * need to fix the string in all possible places. */
227 for (ob = bmain->objects.first(); ob; ob = static_cast<Object *>(ob->id.next)) {
228 /* We have an object using the armature. */
229 if (id_cast<const ID *>(arm) == ob->data) {
230 /* Rename the pose channel, if it exists */
231 if (ob->pose) {
232 bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, oldname);
233 if (pchan) {
235 const bool has_hash = !chanhash.is_empty();
236 if (has_hash) {
237 BLI_assert(chanhash.contains(pchan->name));
238 chanhash.remove(pchan->name);
239 }
240 STRNCPY_UTF8(pchan->name, newname);
241 if (has_hash) {
242 BLI_assert(!chanhash.contains(pchan->name));
243 chanhash.add_new(pchan->name, pchan);
244 }
245
247 ob->id, "pose.bones", old_name_esc, new_name_esc, /*verify_paths=*/true, driver_map);
248 }
249
251 }
252
253 Object *cob;
254 /* Update any object constraints to use the new bone name */
255 for (cob = bmain->objects.first(); cob; cob = static_cast<Object *>(cob->id.next)) {
256 if (cob->constraints.first_) {
257 constraint_bone_name_fix(ob, cob, &cob->constraints, oldname, newname);
258 }
259 if (cob->pose) {
260 for (bPoseChannel &pchan : cob->pose->chanbase) {
261 constraint_bone_name_fix(ob, cob, &pchan.constraints, oldname, newname);
262 }
263 }
264 }
265 }
266
267 /* See if an object is parented to this armature */
268 if (ob->parent && (ob->parent->data == id_cast<const ID *>(arm))) {
269 if (ob->partype == PARBONE) {
270 /* bone name in object */
271 if (STREQ(ob->parsubstr, oldname)) {
272 STRNCPY_UTF8(ob->parsubstr, newname);
273 }
274 }
275 }
276
278 if (BKE_object_defgroup_find_name(ob, newname)) {
280 "New bone name collides with an existing vertex "
281 "group name, vertex group "
282 "names are unchanged. (%s::%s)",
283 &ob->id.name[2],
284 newname);
285 /* Not renaming vertex group could cause bone to bind to other vertex group, in this case
286 * deformation could change, so we tag this object for depsgraph update. */
288 }
289 else if (bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname)) {
290 STRNCPY_UTF8(dg->name, newname);
291
292 if (ob->type == OB_GREASE_PENCIL) {
293 /* Update vgroup names stored in CurvesGeometry */
294 BKE_grease_pencil_vgroup_name_update(ob, oldname, dg->name);
295 }
296
298 }
299 }
300
301 /* fix modifiers that might be using this name */
302 for (ModifierData &md : ob->modifiers) {
303 switch (md.type) {
304 case eModifierType_Hook: {
305 HookModifierData *hmd = reinterpret_cast<HookModifierData *>(&md);
306
307 if (hmd->object && (hmd->object->data == id_cast<const ID *>(arm))) {
308 if (STREQ(hmd->subtarget, oldname)) {
309 STRNCPY_UTF8(hmd->subtarget, newname);
310 }
311 }
312 break;
313 }
315 UVWarpModifierData *umd = reinterpret_cast<UVWarpModifierData *>(&md);
316
317 if (umd->object_src && (umd->object_src->data == id_cast<const ID *>(arm))) {
318 if (STREQ(umd->bone_src, oldname)) {
319 STRNCPY_UTF8(umd->bone_src, newname);
320 }
321 }
322 if (umd->object_dst && (umd->object_dst->data == id_cast<const ID *>(arm))) {
323 if (STREQ(umd->bone_dst, oldname)) {
324 STRNCPY_UTF8(umd->bone_dst, newname);
325 }
326 }
327 break;
328 }
329 default:
330 break;
331 }
332 }
333
334 /* fix camera focus */
335 if (ob->type == OB_CAMERA) {
336 Camera *cam = id_cast<Camera *>(ob->data);
337 if ((cam->dof.focus_object != nullptr) &&
338 (cam->dof.focus_object->data == id_cast<const ID *>(arm)))
339 {
340 if (STREQ(cam->dof.focus_subtarget, oldname)) {
341 STRNCPY_UTF8(cam->dof.focus_subtarget, newname);
343 }
344 }
345 }
346
347 if (ob->type == OB_GREASE_PENCIL) {
348 GreasePencil &grease_pencil = *id_cast<GreasePencil *>(ob->data);
349 for (bke::greasepencil::Layer *layer : grease_pencil.layers_for_write()) {
350 Object *parent = layer->parent;
351 if (parent == nullptr) {
352 continue;
353 }
354 StringRefNull bone_name = layer->parent_bone_name();
355 if (!bone_name.is_empty() && bone_name == StringRef(oldname)) {
356 layer->set_parent_bone_name(newname);
357 }
358 }
359 }
360
362 }
363
364 /* Fix all animdata that may refer to this `Bone` -
365 * we can't just do the ones attached to objects,
366 * since other ID-blocks may have drivers referring to this bone #29822.
367 * This also works for edit bones since those have an rna path of "edit_bones" which is also
368 * caught by the rename function. */
370 arm->id, "bones", old_name_esc, new_name_esc, /*verify_paths=*/true, driver_map);
371
372 /* correct view locking */
373 {
374 bScreen *screen;
375 for (screen = bmain->screens.first(); screen; screen = static_cast<bScreen *>(screen->id.next))
376 {
377 /* add regions */
378 for (ScrArea &area : screen->areabase) {
379 for (SpaceLink &sl : area.spacedata) {
380 if (sl.spacetype != SPACE_VIEW3D) {
381 continue;
382 }
383 View3D *v3d = reinterpret_cast<View3D *>(&sl);
384 if (v3d->ob_center && v3d->ob_center->data == id_cast<const ID *>(arm)) {
385 if (STREQ(v3d->ob_center_bone, oldname)) {
386 STRNCPY_UTF8(v3d->ob_center_bone, newname);
387 }
388 }
389 }
390 }
391 }
392 }
393}
394
396
397/* -------------------------------------------------------------------- */
400
406
408 bArmature *arm,
409 ListBaseT<LinkData> *bones_names,
410 const bool do_strip_numbers)
411{
412 ListBaseT<BoneFlipNameData> bones_names_conflicts = {nullptr};
413 BoneFlipNameData *bfn;
414
415 /* First pass: generate flip names, and blindly rename.
416 * If rename did not yield expected result,
417 * store both bone's name and expected flipped one into temp list for second pass. */
418 for (LinkData &link : *bones_names) {
419 char name_flip[MAXBONENAME];
420 char *name = static_cast<char *>(link.data);
421
422 /* WARNING: if do_strip_numbers is set, expect completely mismatched names in cases like
423 * Bone.R, Bone.R.001, Bone.R.002, etc. */
424 BLI_string_flip_side_name(name_flip, name, do_strip_numbers, sizeof(name_flip));
425
426 ED_armature_bone_rename(bmain, arm, name, name_flip);
427
428 if (!STREQ(name, name_flip)) {
429 bfn = static_cast<BoneFlipNameData *>(alloca(sizeof(BoneFlipNameData)));
430 bfn->name = name;
431 STRNCPY_UTF8(bfn->name_flip, name_flip);
432 BLI_addtail(&bones_names_conflicts, bfn);
433 }
434 }
435
436 /* Second pass to handle the bones that have naming conflicts with other bones.
437 * Note that if the other bone was not selected, its name was not flipped,
438 * so conflict remains and that second rename simply generates a new numbered alternative name.
439 */
440 for (BoneFlipNameData &bfn : bones_names_conflicts) {
441 ED_armature_bone_rename(bmain, arm, bfn.name, bfn.name_flip);
442 }
443}
444
446
447/* -------------------------------------------------------------------- */
450
452{
453 Main *bmain = CTX_data_main(C);
454 const Scene *scene = CTX_data_scene(C);
455 ViewLayer *view_layer = CTX_data_view_layer(C);
456 Object *ob_active = CTX_data_edit_object(C);
457
458 const bool do_strip_numbers = RNA_boolean_get(op->ptr, "do_strip_numbers");
459
461 *bmain, scene, view_layer, CTX_wm_view3d(C));
462 for (Object *ob : objects) {
463 bArmature *arm = id_cast<bArmature *>(ob->data);
464
465 /* Paranoia check. */
466 if (ob_active->pose == nullptr) {
467 continue;
468 }
469
470 ListBaseT<LinkData> bones_names = {nullptr};
471
472 for (EditBone &ebone : *arm->edbo) {
473 if (animrig::bone_is_selected(arm, &ebone)) {
474 BLI_addtail(&bones_names, BLI_genericNodeN(ebone.name));
475
476 if (arm->flag & ARM_MIRROR_EDIT) {
477 EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, &ebone);
478 if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
479 BLI_addtail(&bones_names, BLI_genericNodeN(flipbone->name));
480 }
481 }
482 }
483 }
484
485 if (bones_names.is_empty()) {
486 continue;
487 }
488
489 ED_armature_bones_flip_names(bmain, arm, &bones_names, do_strip_numbers);
490
491 bones_names.free_no_destruct();
492
493 /* since we renamed stuff... */
495
496 /* copied from #rna_Bone_update_renamed */
497 /* Redraw Outliner / Dope-sheet. */
499
500 /* update animation channels */
502 }
503
504 return OPERATOR_FINISHED;
505}
506
508{
509 /* identifiers */
510 ot->name = "Flip Names";
511 ot->idname = "ARMATURE_OT_flip_names";
512 ot->description = "Flips (and corrects) the axis suffixes of the names of selected bones";
513
514 /* API callbacks. */
517
518 /* flags */
520
522 "do_strip_numbers",
523 false,
524 "Strip Numbers",
525 "Try to remove right-most dot-number from flipped names.\n"
526 "Warning: May result in incoherent naming in some cases");
527}
528
530
531/* -------------------------------------------------------------------- */
534
536{
537 const Scene *scene = CTX_data_scene(C);
538 ViewLayer *view_layer = CTX_data_view_layer(C);
539 Main *bmain = CTX_data_main(C);
540 char newname[MAXBONENAME];
541 const short axis = RNA_enum_get(op->ptr, "type");
542 bool changed_multi = false;
543
545 *bmain, scene, view_layer, CTX_wm_view3d(C));
546 for (Object *ob : objects) {
547 bArmature *arm = id_cast<bArmature *>(ob->data);
548 bool changed = false;
549
550 /* Paranoia checks. */
551 if (ELEM(nullptr, ob, ob->pose)) {
552 continue;
553 }
554
555 for (EditBone &ebone : *arm->edbo) {
556 if (EBONE_EDITABLE(&ebone)) {
557
558 /* We first need to do the flipped bone, then the original one.
559 * Otherwise we can't find the flipped one because of the bone name change. */
560 if (arm->flag & ARM_MIRROR_EDIT) {
561 EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, &ebone);
562 if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
563 STRNCPY_UTF8(newname, flipbone->name);
564 if (bone_autoside_name(newname, 1, axis, flipbone->head[axis], flipbone->tail[axis])) {
565 ED_armature_bone_rename(bmain, arm, flipbone->name, newname);
566 changed = true;
567 }
568 }
569 }
570
571 STRNCPY_UTF8(newname, ebone.name);
572 if (bone_autoside_name(newname, 1, axis, ebone.head[axis], ebone.tail[axis])) {
573 ED_armature_bone_rename(bmain, arm, ebone.name, newname);
574 changed = true;
575 }
576 }
577 }
578
579 if (!changed) {
580 continue;
581 }
582
583 changed_multi = true;
584
585 /* Since we renamed stuff... */
588
589 /* Update animation channels */
591
592 /* NOTE: notifier might evolve. */
594 }
595 return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
596}
597
599{
600 static const EnumPropertyItem axis_items[] = {
601 {0, "XAXIS", 0, "X-Axis", "Left/Right"},
602 {1, "YAXIS", 0, "Y-Axis", "Front/Back"},
603 {2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
604 {0, nullptr, 0, nullptr, nullptr},
605 };
606
607 /* identifiers */
608 ot->name = "Auto-Name by Axis";
609 ot->idname = "ARMATURE_OT_autoside_names";
610 ot->description =
611 "Automatically renames the selected bones according to which side of the target axis they "
612 "fall on";
613
614 /* API callbacks. */
618
619 /* flags */
621
622 /* settings */
623 ot->prop = RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis to tag names with");
624}
625
627
628} // namespace blender
Functions to deal with Armatures.
Blender kernel action and pose functionality.
support for deformation groups and hooks.
Low-level operations for grease pencil.
#define STRNCPY_UTF8(dst, src)
#define DATA_(msgid)
#define MAXBONENAME
Object is a sort of wrapper for general info.
#define EBONE_EDITABLE(ebone)
#define C
Definition RandGen.cpp:29
#define NC_GEOM
Definition WM_types.hh:406
#define ND_DATA
Definition WM_types.hh:552
#define NC_ANIMATION
Definition WM_types.hh:401
#define ND_POSE
Definition WM_types.hh:482
#define NA_RENAME
Definition WM_types.hh:638
#define NC_OBJECT
Definition WM_types.hh:392
#define ND_ANIMCHAN
Definition WM_types.hh:539
#define STREQLEN(a, b, n)
#define ELEM(...)
#define STREQ(a, b)
void add_new(const Key &key, const Value &value)
Definition BLI_map.hh:265
bool remove(const Key &key)
Definition BLI_map.hh:368
bool is_empty() const
Definition BLI_map.hh:986
bool contains(const Key &key) const
Definition BLI_map.hh:353
constexpr const char * c_str() const
constexpr bool is_empty() const
#define layer
bool bone_is_selected(const bArmature *armature, const Bone *bone)
constexpr char bone_default_name[]
BMesh Iterators.
static bool editbone_unique_check(ListBaseT< EditBone > *ebones, const StringRefNull name, EditBone *bone)
void ED_armature_bones_flip_names(Main *bmain, bArmature *arm, ListBaseT< LinkData > *bones_names, const bool do_strip_numbers)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void WM_global_reportf(eReportType type, const char *format,...)
wmOperatorStatus WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *)
void ARMATURE_OT_flip_names(wmOperatorType *ot)
char * STRNCPY(char(&dst)[N], const char *src)
int RNA_enum_get(PointerRNA *ptr, const char *name)
void BKE_action_fix_paths_rename(ID *owner_id, bAction *act, int32_t slot_handle, StringRef prefix, StringRefNull oldName, StringRefNull newName, bool verify_paths)
@ RPT_WARNING
Definition BKE_report.hh:40
void ARMATURE_OT_autoside_names(wmOperatorType *ot)
void BKE_constraint_targets_flush(struct bConstraint *con, ListBaseT< bConstraintTarget > *targets, bool no_copy)
bDeformGroup * BKE_object_defgroup_find_name(const Object *ob, StringRef name)
Definition deform.cc:530
std::string RNA_path_name_to_infix(const StringRefNull string)
Definition rna_path.cc:1419
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, const int default_value, const char *ui_name, const char *ui_description)
static void constraint_bone_name_fix(Object *rename_ob, Object *constraint_ob, ListBaseT< bConstraint > *conlist, const char *oldname, const char *newname)
void ED_armature_ebone_unique_name(ListBaseT< EditBone > *ebones, char *name, EditBone *bone)
bool ED_operator_editarmature(bContext *C)
ViewLayer * CTX_data_view_layer(const bContext *C)
static wmOperatorStatus armature_flip_names_exec(bContext *C, wmOperator *op)
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition BLI_ghash.cc:711
void BKE_animdata_fix_paths(ID &id, StringRef prefix, StringRef old_infix, StringRef new_infix, bool verify_paths, const DriverMap &driver_map)
void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
size_t void BLI_uniquename_cb(FunctionRef< bool(StringRefNull)> unique_check, const char *defname, char delim, char *name, size_t name_maxncpy) ATTR_NONNULL(2
bool bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail)
bool BKE_object_supports_vertex_groups(const Object *ob)
Definition deform.cc:465
EditBone * ED_armature_ebone_get_mirrored(const ListBaseT< EditBone > *edbo, EditBone *ebo)
ListBaseWrapperTemplate< ListBase, T > ListBaseWrapper
void DEG_id_tag_update(ID *id, unsigned int flags)
bool BKE_pose_channels_is_valid(const bPose *pose) ATTR_WARN_UNUSED_RESULT
Object * CTX_data_edit_object(const bContext *C)
DriverMap BKE_animdata_build_driver_target_map(Main &bmain)
Definition anim_data.cc:980
LinkData * BLI_genericNodeN(void *data)
Definition listbase.cc:936
void BKE_grease_pencil_vgroup_name_update(Object *ob, const char *old_name, const char *new_name)
static wmOperatorStatus armature_autoside_names_exec(bContext *C, wmOperator *op)
int BKE_constraint_targets_get(struct bConstraint *con, ListBaseT< bConstraintTarget > *r_targets)
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:118
Main * CTX_data_main(const bContext *C)
bool BKE_modifiers_uses_armature(Object *ob, bArmature *arm)
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition BLI_ghash.cc:792
@ ID_RECALC_SYNC_TO_EVAL
Definition DNA_ID.h:1118
@ ID_RECALC_GEOMETRY
Definition DNA_ID.h:1074
Vector< Object * > BKE_view_layer_array_from_objects_in_edit_mode_unique_data(const Main &bmain, const Scene *scene, ViewLayer *view_layer, const View3D *v3d)
Scene * CTX_data_scene(const bContext *C)
Map< ID *, Vector< DriverTarget * > > DriverMap
static void ed_armature_bone_unique_name(bArmature *arm, char *name)
@ OPTYPE_REGISTER
Definition WM_types.hh:188
@ OPTYPE_UNDO
Definition WM_types.hh:190
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, const bool default_value, const char *ui_name, const char *ui_description)
bool BLI_ghash_haskey(const GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition BLI_ghash.cc:825
Bone * BKE_armature_find_bone_name(bArmature *arm, const char *name)
bPoseChannel * BKE_pose_channel_find_name(const bPose *pose, const char *name)
View3D * CTX_wm_view3d(const bContext *C)
EditBone * ED_armature_ebone_find_name(const ListBaseT< EditBone > *edbo, const char *name)
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
char name[258]
Definition DNA_ID.h:433
void * next
Definition DNA_ID.h:418
ListBaseT< Object > objects
Definition BKE_main.hh:388
ListBaseT< bScreen > screens
Definition BKE_main.hh:400
struct Object * parent
ListBaseT< ModifierData > modifiers
eObject_Partype partype
ListBaseT< bConstraint > constraints
struct bPose * pose
ListBaseT< SpaceLink > spacedata
struct Object * ob_center
ListBaseT< EditBone > * edbo
ListBaseT< struct bConstraint > constraints
bke::bPoseRuntime * runtime
ListBaseT< bPoseChannel > chanbase
ListBaseT< struct ScrArea > areabase
Map< StringRef, bPoseChannel * > chanhash
Definition BKE_pose.hh:36
wmOperatorStatus(*) exec(bContext *C, wmOperator *op) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1125
const char * description
Definition WM_types.hh:1115
bool(*) poll(bContext *C) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1165
wmOperatorStatus(*) invoke(bContext *C, wmOperator *op, const wmEvent *event) ATTR_WARN_UNUSED_RESULT
Definition WM_types.hh:1141