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/armature_relations.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source/blender/editors/armature/armature_relations.c') diff --git a/source/blender/editors/armature/armature_relations.c b/source/blender/editors/armature/armature_relations.c index c9fe6a5758b..3506b8a8a60 100644 --- a/source/blender/editors/armature/armature_relations.c +++ b/source/blender/editors/armature/armature_relations.c @@ -408,7 +408,7 @@ int join_armature_exec(bContext *C, wmOperator *op) /* *********************************** Separate *********************************************** */ /* Helper function for armature separating - link fixing */ -static void separated_armature_fix_links(Object *origArm, Object *newArm) +static void separated_armature_fix_links(Main *bmain, Object *origArm, Object *newArm) { Object *ob; bPoseChannel *pchan; @@ -420,7 +420,7 @@ static void separated_armature_fix_links(Object *origArm, Object *newArm) npchans = &newArm->pose->chanbase; /* let's go through all objects in database */ - for (ob = G.main->object.first; ob; ob = ob->id.next) { + for (ob = bmain->object.first; ob; ob = ob->id.next) { /* do some object-type specific things */ if (ob->type == OB_ARMATURE) { for (pchan = ob->pose->chanbase.first; pchan; pchan = pchan->next) { @@ -620,7 +620,7 @@ static int separate_armature_exec(bContext *C, wmOperator *op) /* 4) fix links before depsgraph flushes */ // err... or after? - separated_armature_fix_links(oldob, newob); + separated_armature_fix_links(bmain, oldob, newob); DAG_id_tag_update(&oldob->id, OB_RECALC_DATA); /* this is the original one */ DAG_id_tag_update(&newob->id, OB_RECALC_DATA); /* this is the separated one */ -- cgit v1.2.3