From eae40c6c763c989f41210ff2972c1a024811133f Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 3 Apr 2020 13:15:18 +1100 Subject: Cleanup: improve & use doxy sections for armature_naming.c --- source/blender/editors/armature/armature_naming.c | 49 ++++++++++++++++++----- 1 file changed, 38 insertions(+), 11 deletions(-) (limited to 'source/blender/editors/armature') diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c index 13660244547..d36e6100bcf 100644 --- a/source/blender/editors/armature/armature_naming.c +++ b/source/blender/editors/armature/armature_naming.c @@ -20,6 +20,8 @@ /** \file * \ingroup edarmature + * + * This file contains functions/API's for renaming bones and/or working with them. */ #include @@ -63,12 +65,11 @@ #include "armature_intern.h" -/* This file contains functions/API's for renaming bones and/or working with them */ - -/* ************************************************** */ -/* EditBone Names */ +/* -------------------------------------------------------------------- */ +/** \name Unique Bone Name Utility (Edit Mode) + * \{ */ -/* note: there's a unique_bone_name() too! */ +/* note: there's a ed_armature_bone_unique_name() too! */ static bool editbone_unique_check(void *arg, const char *name) { struct { @@ -92,20 +93,29 @@ void ED_armature_ebone_unique_name(ListBase *edbo, char *name, EditBone *bone) BLI_uniquename_cb(editbone_unique_check, &data, DATA_("Bone"), '.', name, sizeof(bone->name)); } -/* ************************************************** */ -/* Bone Renaming - API */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Unique Bone Name Utility (Object Mode) + * \{ */ static bool bone_unique_check(void *arg, const char *name) { return BKE_armature_find_bone_name((bArmature *)arg, name) != NULL; } -static void unique_bone_name(bArmature *arm, char *name) +static void ed_armature_bone_unique_name(bArmature *arm, char *name) { BLI_uniquename_cb( bone_unique_check, (void *)arm, DATA_("Bone"), '.', name, sizeof(((Bone *)NULL)->name)); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Bone Renaming (Object & Edit Mode API) + * \{ */ + /* helper call for armature_bone_rename */ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, @@ -180,7 +190,7 @@ void ED_armature_bone_rename(Main *bmain, Bone *bone = BKE_armature_find_bone_name(arm, oldname); if (bone) { - unique_bone_name(arm, newname); + ed_armature_bone_unique_name(arm, newname); if (arm->bonehash) { BLI_assert(BLI_ghash_haskey(arm->bonehash, bone->name)); @@ -372,6 +382,12 @@ void ED_armature_bone_rename(Main *bmain, } } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Bone Flipping (Object & Edit Mode API) + * \{ */ + typedef struct BoneFlipNameData { struct BoneFlipNameData *next, *prev; char *name; @@ -426,8 +442,11 @@ void ED_armature_bones_flip_names(Main *bmain, } } -/* ************************************************** */ -/* Bone Renaming - EditMode */ +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Flip Bone Names (Edit Mode Operator) + * \{ */ static int armature_flip_names_exec(bContext *C, wmOperator *op) { @@ -511,6 +530,12 @@ void ARMATURE_OT_flip_names(wmOperatorType *ot) "(WARNING: may result in incoherent naming in some cases)"); } +/** \} */ + +/* -------------------------------------------------------------------- */ +/** \name Bone Auto Side Names (Edit Mode Operator) + * \{ */ + static int armature_autoside_names_exec(bContext *C, wmOperator *op) { ViewLayer *view_layer = CTX_data_view_layer(C); @@ -599,3 +624,5 @@ void ARMATURE_OT_autoside_names(wmOperatorType *ot) /* settings */ ot->prop = RNA_def_enum(ot->srna, "type", axis_items, 0, "Axis", "Axis tag names with"); } + +/** \} */ -- cgit v1.2.3