diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-08-01 16:47:49 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2010-08-01 16:47:49 +0400 |
commit | 5fa7d1c1b4e7bde1d173caa60af0e273c86b6f0b (patch) | |
tree | 186a794aef722993c7067a657b4d007c62dd669b /source/blender/editors/object/object_group.c | |
parent | c34f831757e0985b7523b6e5bbfadd7dd6a2c161 (diff) |
2.5: code changes to reduce the usage of G.main and pass it along
or get it from the context instead.
Diffstat (limited to 'source/blender/editors/object/object_group.c')
-rw-r--r-- | source/blender/editors/object/object_group.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_group.c b/source/blender/editors/object/object_group.c index ba609bd9bb3..b0a6c6471a2 100644 --- a/source/blender/editors/object/object_group.c +++ b/source/blender/editors/object/object_group.c @@ -60,6 +60,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Object *ob= OBACT; Group *group; @@ -70,7 +71,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) /* linking to same group requires its own loop so we can avoid looking up the active objects groups each time */ - for(group= G.main->group.first; group; group=group->id.next) { + for(group= bmain->group.first; group; group=group->id.next) { if(object_in_group(ob, group)) { /* Assign groups to selected objects */ CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { @@ -83,7 +84,7 @@ static int objects_add_active_exec(bContext *C, wmOperator *op) if(!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups"); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -106,6 +107,7 @@ void GROUP_OT_objects_add_active(wmOperatorType *ot) static int objects_remove_active_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Object *ob= OBACT; Group *group; @@ -116,7 +118,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) /* linking to same group requires its own loop so we can avoid looking up the active objects groups each time */ - for(group= G.main->group.first; group; group=group->id.next) { + for(group= bmain->group.first; group; group=group->id.next) { if(object_in_group(ob, group)) { /* Assign groups to selected objects */ CTX_DATA_BEGIN(C, Base*, base, selected_editable_bases) { @@ -129,7 +131,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op) if(!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups"); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -152,6 +154,7 @@ void GROUP_OT_objects_remove_active(wmOperatorType *ot) static int group_objects_remove_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Group *group= NULL; @@ -162,7 +165,7 @@ static int group_objects_remove_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL); return OPERATOR_FINISHED; @@ -185,6 +188,7 @@ void GROUP_OT_objects_remove(wmOperatorType *ot) static int group_create_exec(bContext *C, wmOperator *op) { + Main *bmain= CTX_data_main(C); Scene *scene= CTX_data_scene(C); Group *group= NULL; char name[32]; /* id name */ @@ -198,7 +202,7 @@ static int group_create_exec(bContext *C, wmOperator *op) } CTX_DATA_END; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); WM_event_add_notifier(C, NC_GROUP|NA_EDITED, NULL); return OPERATOR_FINISHED; |