Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-06-07 14:04:16 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-06-07 14:04:16 +0300
commit508e34d0bf68c837c3b0ece72faaab809df52506 (patch)
treeaeeafa9c1b853dacd38056bb5bf825c04863b481 /source/blender/editors/armature/armature_naming.c
parent4e014727f6ed1652fd922ba25ec00b0f9df694f9 (diff)
parentb3a7a75a266de6765d8c04953c0dabce3c30c359 (diff)
Merge branch 'master' into blender2.8
Conflicts: source/blender/editors/animation/anim_deps.c source/blender/editors/animation/keyframing.c source/blender/editors/animation/keyingsets.c source/blender/editors/armature/pose_edit.c source/blender/editors/armature/pose_transform.c source/blender/editors/gpencil/gpencil_convert.c source/blender/editors/include/ED_anim_api.h source/blender/editors/include/ED_keyframing.h source/blender/editors/interface/interface_anim.c source/blender/editors/space_action/action_edit.c source/blender/editors/space_graph/graph_edit.c source/blender/editors/space_outliner/outliner_draw.c source/blender/editors/transform/transform_conversions.c source/blender/makesrna/intern/rna_armature.c source/blender/makesrna/intern/rna_pose.c source/blender/python/intern/bpy_rna_anim.c source/blenderplayer/bad_level_call_stubs/stubs.c source/gameengine/Converter/KX_BlenderSceneConverter.cpp
Diffstat (limited to 'source/blender/editors/armature/armature_naming.c')
-rw-r--r--source/blender/editors/armature/armature_naming.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source/blender/editors/armature/armature_naming.c b/source/blender/editors/armature/armature_naming.c
index 1a5e9e38099..a73e64af0ee 100644
--- a/source/blender/editors/armature/armature_naming.c
+++ b/source/blender/editors/armature/armature_naming.c
@@ -137,7 +137,7 @@ static void constraint_bone_name_fix(Object *ob, ListBase *conlist, const char *
/* called by UI for renaming a bone */
/* warning: make sure the original bone was not renamed yet! */
/* seems messy, but thats what you get with not using pointers but channel names :) */
-void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *newnamep)
+void ED_armature_bone_rename(Main *bmain, bArmature *arm, const char *oldnamep, const char *newnamep)
{
Object *ob;
char newname[MAXBONENAME];
@@ -176,7 +176,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
}
/* do entire dbase - objects */
- for (ob = G.main->object.first; ob; ob = ob->id.next) {
+ for (ob = bmain->object.first; ob; ob = ob->id.next) {
ModifierData *md;
/* we have the object using the armature */
@@ -206,7 +206,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
}
/* Update any object constraints to use the new bone name */
- for (cob = G.main->object.first; cob; cob = cob->id.next) {
+ for (cob = bmain->object.first; cob; cob = cob->id.next) {
if (cob->constraints.first)
constraint_bone_name_fix(ob, &cob->constraints, oldname, newname);
if (cob->pose) {
@@ -279,7 +279,7 @@ void ED_armature_bone_rename(bArmature *arm, const char *oldnamep, const char *n
/* correct view locking */
{
bScreen *screen;
- for (screen = G.main->screen.first; screen; screen = screen->id.next) {
+ for (screen = bmain->screen.first; screen; screen = screen->id.next) {
ScrArea *sa;
/* add regions */
for (sa = screen->areabase.first; sa; sa = sa->next) {
@@ -316,7 +316,7 @@ typedef struct BoneFlipNameData {
* \param bones_names: List of BoneConflict elems.
* \param do_strip_numbers: if set, try to get rid of dot-numbers at end of bone names.
*/
-void ED_armature_bones_flip_names(bArmature *arm, ListBase *bones_names, const bool do_strip_numbers)
+void ED_armature_bones_flip_names(Main *bmain, bArmature *arm, ListBase *bones_names, const bool do_strip_numbers)
{
ListBase bones_names_conflicts = {NULL};
BoneFlipNameData *bfn;
@@ -332,7 +332,7 @@ void ED_armature_bones_flip_names(bArmature *arm, ListBase *bones_names, const b
* Bone.R, Bone.R.001, Bone.R.002, etc. */
BLI_string_flip_side_name(name_flip, name, do_strip_numbers, sizeof(name_flip));
- ED_armature_bone_rename(arm, name, name_flip);
+ ED_armature_bone_rename(bmain, arm, name, name_flip);
if (!STREQ(name, name_flip)) {
bfn = alloca(sizeof(BoneFlipNameData));
@@ -346,7 +346,7 @@ void ED_armature_bones_flip_names(bArmature *arm, ListBase *bones_names, const b
* Note that if the other bone was not selected, its name was not flipped, so conflict remains and that second
* rename simply generates a new numbered alternative name. */
for (bfn = bones_names_conflicts.first; bfn; bfn = bfn->next) {
- ED_armature_bone_rename(arm, bfn->name, bfn->name_flip);
+ ED_armature_bone_rename(bmain, arm, bfn->name, bfn->name_flip);
}
}
@@ -355,6 +355,7 @@ void ED_armature_bones_flip_names(bArmature *arm, ListBase *bones_names, const b
static int armature_flip_names_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_edit_object(C);
bArmature *arm;
@@ -374,7 +375,7 @@ static int armature_flip_names_exec(bContext *C, wmOperator *op)
}
CTX_DATA_END;
- ED_armature_bones_flip_names(arm, &bones_names, do_strip_numbers);
+ ED_armature_bones_flip_names(bmain, arm, &bones_names, do_strip_numbers);
BLI_freelistN(&bones_names);
@@ -413,6 +414,7 @@ void ARMATURE_OT_flip_names(wmOperatorType *ot)
static int armature_autoside_names_exec(bContext *C, wmOperator *op)
{
+ Main *bmain = CTX_data_main(C);
Object *ob = CTX_data_edit_object(C);
bArmature *arm;
char newname[MAXBONENAME];
@@ -428,7 +430,7 @@ static int armature_autoside_names_exec(bContext *C, wmOperator *op)
{
BLI_strncpy(newname, ebone->name, sizeof(newname));
if (bone_autoside_name(newname, 1, axis, ebone->head[axis], ebone->tail[axis]))
- ED_armature_bone_rename(arm, ebone->name, newname);
+ ED_armature_bone_rename(bmain, arm, ebone->name, newname);
}
CTX_DATA_END;