Cleanup: remove moar G.main usages.
[blender.git] / source / blender / editors / armature / pose_edit.c
index da328ee485fc35c2d2811097d915491269143152..8f0812e60345919e70bf29d89728e731a7cf6cb8 100644 (file)
@@ -44,6 +44,7 @@
 #include "BKE_context.h"
 #include "BKE_deform.h"
 #include "BKE_depsgraph.h"
 #include "BKE_context.h"
 #include "BKE_deform.h"
 #include "BKE_depsgraph.h"
+#include "BKE_main.h"
 #include "BKE_object.h"
 #include "BKE_report.h"
 
 #include "BKE_object.h"
 #include "BKE_report.h"
 
@@ -604,6 +605,7 @@ static void pose_copy_menu(Scene *scene)
 
 static int pose_flip_names_exec(bContext *C, wmOperator *op)
 {
 
 static int pose_flip_names_exec(bContext *C, wmOperator *op)
 {
+       Main *bmain = CTX_data_main(C);
        Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm;
 
        Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm;
 
@@ -623,7 +625,7 @@ static int pose_flip_names_exec(bContext *C, wmOperator *op)
        }
        CTX_DATA_END;
 
        }
        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);
 
 
        BLI_freelistN(&bones_names);
 
@@ -659,6 +661,7 @@ void POSE_OT_flip_names(wmOperatorType *ot)
 
 static int pose_autoside_names_exec(bContext *C, wmOperator *op)
 {
 
 static int pose_autoside_names_exec(bContext *C, wmOperator *op)
 {
+       Main *bmain = CTX_data_main(C);
        Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm;
        char newname[MAXBONENAME];
        Object *ob = BKE_object_pose_armature_get(CTX_data_active_object(C));
        bArmature *arm;
        char newname[MAXBONENAME];
@@ -674,7 +677,7 @@ static int pose_autoside_names_exec(bContext *C, wmOperator *op)
        {
                BLI_strncpy(newname, pchan->name, sizeof(newname));
                if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
        {
                BLI_strncpy(newname, pchan->name, sizeof(newname));
                if (bone_autoside_name(newname, 1, axis, pchan->bone->head[axis], pchan->bone->tail[axis]))
-                       ED_armature_bone_rename(arm, pchan->name, newname);
+                       ED_armature_bone_rename(bmain, arm, pchan->name, newname);
        }
        CTX_DATA_END;
 
        }
        CTX_DATA_END;