From b3a7a75a266de6765d8c04953c0dabce3c30c359 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 7 Jun 2018 12:47:00 +0200 Subject: Cleanup: remove moar G.main usages. Notes: * Really need to address RNA setters case, end up adding way too much G.main here these days... :/ * Added Main pointer into bAnimContext, helps a lot in anim code ;) --- source/blender/editors/armature/pose_edit.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'source/blender/editors/armature/pose_edit.c') diff --git a/source/blender/editors/armature/pose_edit.c b/source/blender/editors/armature/pose_edit.c index da328ee485f..8f0812e6034 100644 --- a/source/blender/editors/armature/pose_edit.c +++ b/source/blender/editors/armature/pose_edit.c @@ -44,6 +44,7 @@ #include "BKE_context.h" #include "BKE_deform.h" #include "BKE_depsgraph.h" +#include "BKE_main.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) { + Main *bmain = CTX_data_main(C); 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; - 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); @@ -659,6 +661,7 @@ void POSE_OT_flip_names(wmOperatorType *ot) 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]; @@ -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])) - ED_armature_bone_rename(arm, pchan->name, newname); + ED_armature_bone_rename(bmain, arm, pchan->name, newname); } CTX_DATA_END; -- cgit v1.2.3