Blender  V2.93
armature_naming.c
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
17  * All rights reserved.
18  * Operators and API's for renaming bones both in and out of Edit Mode
19  */
20 
27 #include <string.h>
28 
29 #include "MEM_guardedalloc.h"
30 
31 #include "DNA_armature_types.h"
32 #include "DNA_constraint_types.h"
34 #include "DNA_gpencil_types.h"
35 #include "DNA_object_types.h"
36 
37 #include "BLI_blenlib.h"
38 #include "BLI_ghash.h"
39 #include "BLI_string_utils.h"
40 #include "BLI_utildefines.h"
41 
42 #include "BLT_translation.h"
43 
44 #include "BKE_action.h"
45 #include "BKE_animsys.h"
46 #include "BKE_armature.h"
47 #include "BKE_constraint.h"
48 #include "BKE_context.h"
49 #include "BKE_deform.h"
50 #include "BKE_gpencil_modifier.h"
51 #include "BKE_layer.h"
52 #include "BKE_main.h"
53 #include "BKE_modifier.h"
54 
55 #include "DEG_depsgraph.h"
56 
57 #include "RNA_access.h"
58 #include "RNA_define.h"
59 
60 #include "WM_api.h"
61 #include "WM_types.h"
62 
63 #include "ED_armature.h"
64 #include "ED_screen.h"
65 
66 #include "armature_intern.h"
67 
68 /* -------------------------------------------------------------------- */
72 /* note: there's a ed_armature_bone_unique_name() too! */
73 static bool editbone_unique_check(void *arg, const char *name)
74 {
75  struct {
76  ListBase *lb;
77  void *bone;
78  } *data = arg;
79  EditBone *dupli = ED_armature_ebone_find_name(data->lb, name);
80  return dupli && dupli != data->bone;
81 }
82 
83 /* If bone is already in list, pass it as param to ignore it. */
84 void ED_armature_ebone_unique_name(ListBase *ebones, char *name, EditBone *bone)
85 {
86  struct {
87  ListBase *lb;
88  void *bone;
89  } data;
90  data.lb = ebones;
91  data.bone = bone;
92 
93  BLI_uniquename_cb(editbone_unique_check, &data, DATA_("Bone"), '.', name, sizeof(bone->name));
94 }
95 
98 /* -------------------------------------------------------------------- */
102 static bool bone_unique_check(void *arg, const char *name)
103 {
104  return BKE_armature_find_bone_name((bArmature *)arg, name) != NULL;
105 }
106 
107 static void ed_armature_bone_unique_name(bArmature *arm, char *name)
108 {
110  bone_unique_check, (void *)arm, DATA_("Bone"), '.', name, sizeof(((Bone *)NULL)->name));
111 }
112 
115 /* -------------------------------------------------------------------- */
119 /* helper call for armature_bone_rename */
121  ListBase *conlist,
122  const char *oldname,
123  const char *newname)
124 {
125  bConstraint *curcon;
126  bConstraintTarget *ct;
127 
128  for (curcon = conlist->first; curcon; curcon = curcon->next) {
130  ListBase targets = {NULL, NULL};
131 
132  /* constraint targets */
133  if (cti && cti->get_constraint_targets) {
134  cti->get_constraint_targets(curcon, &targets);
135 
136  for (ct = targets.first; ct; ct = ct->next) {
137  if (ct->tar == ob) {
138  if (STREQ(ct->subtarget, oldname)) {
139  BLI_strncpy(ct->subtarget, newname, MAXBONENAME);
140  }
141  }
142  }
143 
144  if (cti->flush_constraint_targets) {
145  cti->flush_constraint_targets(curcon, &targets, 0);
146  }
147  }
148 
149  /* action constraints */
150  if (curcon->type == CONSTRAINT_TYPE_ACTION) {
151  bActionConstraint *actcon = (bActionConstraint *)curcon->data;
152  BKE_action_fix_paths_rename(&ob->id, actcon->act, "pose.bones", oldname, newname, 0, 0, 1);
153  }
154  }
155 }
156 
157 /* called by UI for renaming a bone */
158 /* warning: make sure the original bone was not renamed yet! */
159 /* seems messy, but that's what you get with not using pointers but channel names :) */
161  bArmature *arm,
162  const char *oldnamep,
163  const char *newnamep)
164 {
165  Object *ob;
166  char newname[MAXBONENAME];
167  char oldname[MAXBONENAME];
168 
169  /* names better differ! */
170  if (!STREQLEN(oldnamep, newnamep, MAXBONENAME)) {
171 
172  /* we alter newname string... so make copy */
173  BLI_strncpy(newname, newnamep, MAXBONENAME);
174  /* we use oldname for search... so make copy */
175  BLI_strncpy(oldname, oldnamep, MAXBONENAME);
176 
177  /* now check if we're in editmode, we need to find the unique name */
178  if (arm->edbo) {
179  EditBone *eBone = ED_armature_ebone_find_name(arm->edbo, oldname);
180 
181  if (eBone) {
182  ED_armature_ebone_unique_name(arm->edbo, newname, NULL);
183  BLI_strncpy(eBone->name, newname, MAXBONENAME);
184  }
185  else {
186  return;
187  }
188  }
189  else {
190  Bone *bone = BKE_armature_find_bone_name(arm, oldname);
191 
192  if (bone) {
193  ed_armature_bone_unique_name(arm, newname);
194 
195  if (arm->bonehash) {
197  BLI_ghash_remove(arm->bonehash, bone->name, NULL, NULL);
198  }
199 
200  BLI_strncpy(bone->name, newname, MAXBONENAME);
201 
202  if (arm->bonehash) {
203  BLI_ghash_insert(arm->bonehash, bone->name, bone);
204  }
205  }
206  else {
207  return;
208  }
209  }
210 
211  /* force copy on write to update database */
213 
214  /* do entire dbase - objects */
215  for (ob = bmain->objects.first; ob; ob = ob->id.next) {
216  ModifierData *md;
217 
218  /* we have the object using the armature */
219  if (arm == ob->data) {
220  Object *cob;
221 
222  /* Rename the pose channel, if it exists */
223  if (ob->pose) {
224  bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, oldname);
225  if (pchan) {
226  GHash *gh = ob->pose->chanhash;
227 
228  /* remove the old hash entry, and replace with the new name */
229  if (gh) {
230  BLI_assert(BLI_ghash_haskey(gh, pchan->name));
231  BLI_ghash_remove(gh, pchan->name, NULL, NULL);
232  }
233 
234  BLI_strncpy(pchan->name, newname, MAXBONENAME);
235 
236  if (gh) {
237  BLI_ghash_insert(gh, pchan->name, pchan);
238  }
239  }
240 
242  }
243 
244  /* Update any object constraints to use the new bone name */
245  for (cob = bmain->objects.first; cob; cob = cob->id.next) {
246  if (cob->constraints.first) {
247  constraint_bone_name_fix(ob, &cob->constraints, oldname, newname);
248  }
249  if (cob->pose) {
250  bPoseChannel *pchan;
251  for (pchan = cob->pose->chanbase.first; pchan; pchan = pchan->next) {
252  constraint_bone_name_fix(ob, &pchan->constraints, oldname, newname);
253  }
254  }
255  }
256  }
257 
258  /* See if an object is parented to this armature */
259  if (ob->parent && (ob->parent->data == arm)) {
260  if (ob->partype == PARBONE) {
261  /* bone name in object */
262  if (STREQ(ob->parsubstr, oldname)) {
263  BLI_strncpy(ob->parsubstr, newname, MAXBONENAME);
264  }
265  }
266  }
267 
268  if (BKE_modifiers_uses_armature(ob, arm)) {
269  bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname);
270  if (dg) {
271  BLI_strncpy(dg->name, newname, MAXBONENAME);
272  }
273  }
274 
275  /* fix modifiers that might be using this name */
276  for (md = ob->modifiers.first; md; md = md->next) {
277  switch (md->type) {
278  case eModifierType_Hook: {
279  HookModifierData *hmd = (HookModifierData *)md;
280 
281  if (hmd->object && (hmd->object->data == arm)) {
282  if (STREQ(hmd->subtarget, oldname)) {
283  BLI_strncpy(hmd->subtarget, newname, MAXBONENAME);
284  }
285  }
286  break;
287  }
288  case eModifierType_UVWarp: {
290 
291  if (umd->object_src && (umd->object_src->data == arm)) {
292  if (STREQ(umd->bone_src, oldname)) {
293  BLI_strncpy(umd->bone_src, newname, MAXBONENAME);
294  }
295  }
296  if (umd->object_dst && (umd->object_dst->data == arm)) {
297  if (STREQ(umd->bone_dst, oldname)) {
298  BLI_strncpy(umd->bone_dst, newname, MAXBONENAME);
299  }
300  }
301  break;
302  }
303  default:
304  break;
305  }
306  }
307 
308  /* fix grease pencil modifiers and vertex groups */
309  if (ob->type == OB_GPENCIL) {
310 
311  bGPdata *gpd = (bGPdata *)ob->data;
312  LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
313  if ((gpl->parent != NULL) && (gpl->parent->data == arm)) {
314  if (STREQ(gpl->parsubstr, oldname)) {
315  BLI_strncpy(gpl->parsubstr, newname, MAXBONENAME);
316  }
317  }
318  }
319 
321  switch (gp_md->type) {
324  if (mmd->object && mmd->object->data == arm) {
325  bDeformGroup *dg = BKE_object_defgroup_find_name(ob, oldname);
326  if (dg) {
327  BLI_strncpy(dg->name, newname, MAXBONENAME);
328  }
329  }
330  break;
331  }
334  if (hgp_md->object && (hgp_md->object->data == arm)) {
335  if (STREQ(hgp_md->subtarget, oldname)) {
336  BLI_strncpy(hgp_md->subtarget, newname, MAXBONENAME);
337  }
338  }
339  break;
340  }
341  default:
342  break;
343  }
344  }
345  }
347  }
348 
349  /* Fix all animdata that may refer to this bone -
350  * we can't just do the ones attached to objects,
351  * since other ID-blocks may have drivers referring to this bone T29822. */
352 
353  /* XXX: the ID here is for armatures,
354  * but most bone drivers are actually on the object instead. */
355  {
356 
357  BKE_animdata_fix_paths_rename_all(&arm->id, "pose.bones", oldname, newname);
358  }
359 
360  /* correct view locking */
361  {
362  bScreen *screen;
363  for (screen = bmain->screens.first; screen; screen = screen->id.next) {
364  ScrArea *area;
365  /* add regions */
366  for (area = screen->areabase.first; area; area = area->next) {
367  SpaceLink *sl;
368  for (sl = area->spacedata.first; sl; sl = sl->next) {
369  if (sl->spacetype == SPACE_VIEW3D) {
370  View3D *v3d = (View3D *)sl;
371  if (v3d->ob_center && v3d->ob_center->data == arm) {
372  if (STREQ(v3d->ob_center_bone, oldname)) {
373  BLI_strncpy(v3d->ob_center_bone, newname, MAXBONENAME);
374  }
375  }
376  }
377  }
378  }
379  }
380  }
381  }
382 }
383 
386 /* -------------------------------------------------------------------- */
390 typedef struct BoneFlipNameData {
392  char *name;
395 
407  bArmature *arm,
408  ListBase *bones_names,
409  const bool do_strip_numbers)
410 {
411  ListBase bones_names_conflicts = {NULL};
412  BoneFlipNameData *bfn;
413 
414  /* First pass: generate flip names, and blindly rename.
415  * If rename did not yield expected result,
416  * store both bone's name and expected flipped one into temp list for second pass. */
417  LISTBASE_FOREACH (LinkData *, link, bones_names) {
418  char name_flip[MAXBONENAME];
419  char *name = link->data;
420 
421  /* WARNING: if do_strip_numbers is set, expect completely mismatched names in cases like
422  * Bone.R, Bone.R.001, Bone.R.002, etc. */
423  BLI_string_flip_side_name(name_flip, name, do_strip_numbers, sizeof(name_flip));
424 
425  ED_armature_bone_rename(bmain, arm, name, name_flip);
426 
427  if (!STREQ(name, name_flip)) {
428  bfn = alloca(sizeof(BoneFlipNameData));
429  bfn->name = name;
430  BLI_strncpy(bfn->name_flip, name_flip, sizeof(bfn->name_flip));
431  BLI_addtail(&bones_names_conflicts, bfn);
432  }
433  }
434 
435  /* Second pass to handle the bones that have naming conflicts with other bones.
436  * Note that if the other bone was not selected, its name was not flipped,
437  * so conflict remains and that second rename simply generates a new numbered alternative name.
438  */
439  for (bfn = bones_names_conflicts.first; bfn; bfn = bfn->next) {
440  ED_armature_bone_rename(bmain, arm, bfn->name, bfn->name_flip);
441  }
442 }
443 
446 /* -------------------------------------------------------------------- */
451 {
452  Main *bmain = CTX_data_main(C);
453  ViewLayer *view_layer = CTX_data_view_layer(C);
454  Object *ob_active = CTX_data_edit_object(C);
455 
456  const bool do_strip_numbers = RNA_boolean_get(op->ptr, "do_strip_numbers");
457 
458  uint objects_len = 0;
460  view_layer, CTX_wm_view3d(C), &objects_len);
461  for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
462  Object *ob = objects[ob_index];
463  bArmature *arm = ob->data;
464 
465  /* Paranoia check. */
466  if (ob_active->pose == NULL) {
467  continue;
468  }
469 
470  ListBase bones_names = {NULL};
471 
472  LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
473  if (EBONE_VISIBLE(arm, ebone)) {
474  if (ebone->flag & BONE_SELECTED) {
475  BLI_addtail(&bones_names, BLI_genericNodeN(ebone->name));
476 
477  if (arm->flag & ARM_MIRROR_EDIT) {
478  EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
479  if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
480  BLI_addtail(&bones_names, BLI_genericNodeN(flipbone->name));
481  }
482  }
483  }
484  }
485  }
486 
487  if (BLI_listbase_is_empty(&bones_names)) {
488  continue;
489  }
490 
491  ED_armature_bones_flip_names(bmain, arm, &bones_names, do_strip_numbers);
492 
493  BLI_freelistN(&bones_names);
494 
495  /* since we renamed stuff... */
497 
498  /* copied from #rna_Bone_update_renamed */
499  /* redraw view */
501 
502  /* update animation channels */
504  }
505  MEM_freeN(objects);
506 
507  return OPERATOR_FINISHED;
508 }
509 
511 {
512  /* identifiers */
513  ot->name = "Flip Names";
514  ot->idname = "ARMATURE_OT_flip_names";
515  ot->description = "Flips (and corrects) the axis suffixes of the names of selected bones";
516 
517  /* api callbacks */
520 
521  /* flags */
523 
525  "do_strip_numbers",
526  false,
527  "Strip Numbers",
528  "Try to remove right-most dot-number from flipped names.\n"
529  "Warning: May result in incoherent naming in some cases");
530 }
531 
534 /* -------------------------------------------------------------------- */
539 {
540  ViewLayer *view_layer = CTX_data_view_layer(C);
541  Main *bmain = CTX_data_main(C);
542  char newname[MAXBONENAME];
543  const short axis = RNA_enum_get(op->ptr, "type");
544  bool changed_multi = false;
545 
546  uint objects_len = 0;
548  view_layer, CTX_wm_view3d(C), &objects_len);
549  for (uint ob_index = 0; ob_index < objects_len; ob_index++) {
550  Object *ob = objects[ob_index];
551  bArmature *arm = ob->data;
552  bool changed = false;
553 
554  /* Paranoia checks. */
555  if (ELEM(NULL, ob, ob->pose)) {
556  continue;
557  }
558 
559  LISTBASE_FOREACH (EditBone *, ebone, arm->edbo) {
560  if (EBONE_EDITABLE(ebone)) {
561 
562  /* We first need to do the flipped bone, then the original one.
563  * Otherwise we can't find the flipped one because of the bone name change. */
564  if (arm->flag & ARM_MIRROR_EDIT) {
565  EditBone *flipbone = ED_armature_ebone_get_mirrored(arm->edbo, ebone);
566  if ((flipbone) && !(flipbone->flag & BONE_SELECTED)) {
567  BLI_strncpy(newname, flipbone->name, sizeof(newname));
568  if (bone_autoside_name(newname, 1, axis, flipbone->head[axis], flipbone->tail[axis])) {
569  ED_armature_bone_rename(bmain, arm, flipbone->name, newname);
570  changed = true;
571  }
572  }
573  }
574 
575  BLI_strncpy(newname, ebone->name, sizeof(newname));
576  if (bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis])) {
577  ED_armature_bone_rename(bmain, arm, ebone->name, newname);
578  changed = true;
579  }
580  }
581  }
582 
583  if (!changed) {
584  continue;
585  }
586 
587  changed_multi = true;
588 
589  /* Since we renamed stuff... */
591 
592  /* Note, notifier might evolve. */
594  }
595  MEM_freeN(objects);
596  return changed_multi ? OPERATOR_FINISHED : OPERATOR_CANCELLED;
597 }
598 
600 {
601  static const EnumPropertyItem axis_items[] = {
602  {0, "XAXIS", 0, "X-Axis", "Left/Right"},
603  {1, "YAXIS", 0, "Y-Axis", "Front/Back"},
604  {2, "ZAXIS", 0, "Z-Axis", "Top/Bottom"},
605  {0, NULL, 0, NULL, NULL},
606  };
607 
608  /* identifiers */
609  ot->name = "Auto-Name by Axis";
610  ot->idname = "ARMATURE_OT_autoside_names";
611  ot->description =
612  "Automatically renames the selected bones according to which side of the target axis they "
613  "fall on";
614 
615  /* api callbacks */
619 
620  /* flags */
622 
623  /* settings */
624  ot->prop = RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with");
625 }
626 
Blender kernel action and pose functionality.
struct bPoseChannel * BKE_pose_channel_find_name(const struct bPose *pose, const char *name)
bool BKE_pose_channels_is_valid(const struct bPose *pose)
void BKE_animdata_fix_paths_rename_all(struct ID *ref_id, const char *prefix, const char *oldName, const char *newName)
Definition: anim_data.c:1414
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)
Definition: anim_data.c:1032
struct Bone * BKE_armature_find_bone_name(struct bArmature *arm, const char *name)
Definition: armature.c:609
bool bone_autoside_name(char name[64], int strip_number, short axis, float head, float tail)
const bConstraintTypeInfo * BKE_constraint_typeinfo_get(struct bConstraint *con)
Definition: constraint.c:5435
struct Object * CTX_data_edit_object(const bContext *C)
Definition: context.c:1296
struct ViewLayer * CTX_data_view_layer(const bContext *C)
Definition: context.c:1044
struct View3D * CTX_wm_view3d(const bContext *C)
Definition: context.c:760
struct Main * CTX_data_main(const bContext *C)
Definition: context.c:1018
support for deformation groups and hooks.
struct bDeformGroup * BKE_object_defgroup_find_name(const struct Object *ob, const char *name)
#define BKE_view_layer_array_from_objects_in_edit_mode_unique_data(view_layer, v3d, r_len)
Definition: BKE_layer.h:426
bool BKE_modifiers_uses_armature(struct Object *ob, struct bArmature *arm)
#define BLI_assert(a)
Definition: BLI_assert.h:58
bool BLI_ghash_haskey(GHash *gh, const void *key) ATTR_WARN_UNUSED_RESULT
Definition: BLI_ghash.c:941
bool BLI_ghash_remove(GHash *gh, const void *key, GHashKeyFreeFP keyfreefp, GHashValFreeFP valfreefp)
Definition: BLI_ghash.c:900
void BLI_ghash_insert(GHash *gh, void *key, void *val)
Definition: BLI_ghash.c:756
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
Definition: BLI_listbase.h:124
#define LISTBASE_FOREACH(type, var, list)
Definition: BLI_listbase.h:172
struct LinkData * BLI_genericNodeN(void *data)
Definition: listbase.c:923
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
Definition: listbase.c:547
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition: listbase.c:110
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, const size_t maxncpy) ATTR_NONNULL()
Definition: string.c:108
void BLI_string_flip_side_name(char *r_name, const char *from_name, const bool strip_number, const size_t name_len)
Definition: string_utils.c:159
bool BLI_uniquename_cb(UniquenameCheckCallback unique_check, void *arg, const char *defname, char delim, char *name, size_t name_len)
Definition: string_utils.c:294
unsigned int uint
Definition: BLI_sys_types.h:83
#define STREQLEN(a, b, n)
#define ELEM(...)
#define STREQ(a, b)
#define DATA_(msgid)
void DEG_id_tag_update(struct ID *id, int flag)
@ ID_RECALC_COPY_ON_WRITE
Definition: DNA_ID.h:654
@ ID_RECALC_GEOMETRY
Definition: DNA_ID.h:611
#define MAXBONENAME
@ BONE_SELECTED
@ ARM_MIRROR_EDIT
@ CONSTRAINT_TYPE_ACTION
@ eGpencilModifierType_Hook
@ eGpencilModifierType_Armature
@ eModifierType_Hook
@ eModifierType_UVWarp
Object is a sort of wrapper for general info.
@ PARBONE
@ OB_GPENCIL
@ SPACE_VIEW3D
@ OPERATOR_CANCELLED
@ OPERATOR_FINISHED
#define EBONE_VISIBLE(arm, ebone)
Definition: ED_armature.h:56
#define EBONE_EDITABLE(ebone)
Definition: ED_armature.h:64
bool ED_operator_editarmature(struct bContext *C)
Definition: screen_ops.c:437
Read Guarded memory(de)allocation.
#define C
Definition: RandGen.cpp:39
#define NC_GEOM
Definition: WM_types.h:294
@ OPTYPE_UNDO
Definition: WM_types.h:155
@ OPTYPE_REGISTER
Definition: WM_types.h:153
#define ND_DATA
Definition: WM_types.h:408
#define NC_ANIMATION
Definition: WM_types.h:289
#define ND_POSE
Definition: WM_types.h:359
#define NC_OBJECT
Definition: WM_types.h:280
#define ND_ANIMCHAN
Definition: WM_types.h:396
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)
struct BoneFlipNameData BoneFlipNameData
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)
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:41
static void area(int d1, int d2, int e1, int e2, float weights[2])
bool RNA_boolean_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6261
int RNA_enum_get(PointerRNA *ptr, const char *name)
Definition: rna_access.c:6402
PropertyRNA * RNA_def_boolean(StructOrFunctionRNA *cont_, const char *identifier, bool default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3481
PropertyRNA * RNA_def_enum(StructOrFunctionRNA *cont_, const char *identifier, const EnumPropertyItem *items, int default_value, const char *ui_name, const char *ui_description)
Definition: rna_define.c:3771
struct BoneFlipNameData * next
char name_flip[MAXBONENAME]
struct BoneFlipNameData * prev
char name[64]
char name[64]
Definition: BKE_armature.h:57
float tail[3]
Definition: BKE_armature.h:66
float head[3]
Definition: BKE_armature.h:65
struct Object * object
void * next
Definition: DNA_ID.h:274
void * first
Definition: DNA_listBase.h:47
Definition: BKE_main.h:116
ListBase screens
Definition: BKE_main.h:161
ListBase objects
Definition: BKE_main.h:148
struct ModifierData * next
short partype
ListBase constraints
struct bPose * pose
ListBase modifiers
ListBase greasepencil_modifiers
struct Object * parent
void * data
char parsubstr[64]
struct Object * object_dst
struct Object * object_src
char ob_center_bone[64]
struct Object * ob_center
struct bAction * act
struct GHash * bonehash
ListBase * edbo
struct bConstraintTarget * next
int(* get_constraint_targets)(struct bConstraint *con, struct ListBase *list)
void(* flush_constraint_targets)(struct bConstraint *con, struct ListBase *list, bool no_copy)
struct bConstraint * next
ListBase layers
ListBase constraints
struct bPoseChannel * next
ListBase chanbase
struct GHash * chanhash
ListBase areabase
int(* invoke)(struct bContext *, struct wmOperator *, const struct wmEvent *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:752
const char * name
Definition: WM_types.h:721
const char * idname
Definition: WM_types.h:723
bool(* poll)(struct bContext *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:776
struct StructRNA * srna
Definition: WM_types.h:802
const char * description
Definition: WM_types.h:726
int(* exec)(struct bContext *, struct wmOperator *) ATTR_WARN_UNUSED_RESULT
Definition: WM_types.h:736
PropertyRNA * prop
Definition: WM_types.h:814
struct PointerRNA * ptr
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
wmOperatorType * ot
Definition: wm_files.c:3156
int WM_menu_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
Definition: wm_operators.c:982