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/physics | |
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/physics')
-rw-r--r-- | source/blender/editors/physics/particle_boids.c | 7 | ||||
-rw-r--r-- | source/blender/editors/physics/particle_object.c | 8 |
2 files changed, 10 insertions, 5 deletions
diff --git a/source/blender/editors/physics/particle_boids.c b/source/blender/editors/physics/particle_boids.c index 37de0d8f873..a18890881a8 100644 --- a/source/blender/editors/physics/particle_boids.c +++ b/source/blender/editors/physics/particle_boids.c @@ -35,6 +35,7 @@ #include "BKE_boids.h" #include "BKE_context.h" #include "BKE_depsgraph.h" +#include "BKE_main.h" #include "BKE_particle.h" #include "BLI_listbase.h" @@ -99,6 +100,7 @@ void BOID_OT_rule_add(wmOperatorType *ot) } static int rule_del_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -125,7 +127,7 @@ static int rule_del_exec(bContext *C, wmOperator *op) if(rule) rule->flag |= BOIDRULE_CURRENT; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&psys->part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); @@ -266,6 +268,7 @@ void BOID_OT_state_add(wmOperatorType *ot) } static int state_del_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -297,7 +300,7 @@ static int state_del_exec(bContext *C, wmOperator *op) state->flag |= BOIDSTATE_CURRENT; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&psys->part->id, OB_RECALC_DATA|PSYS_RECALC_RESET); WM_event_add_notifier(C, NC_OBJECT|ND_DRAW, ob); diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 059805fdf2d..ba5d1ee5250 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -166,7 +166,7 @@ static int new_particle_settings_exec(bContext *C, wmOperator *op) psys_check_boid_data(psys); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); @@ -193,6 +193,7 @@ void PARTICLE_OT_new(wmOperatorType *ot) static int new_particle_target_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -214,7 +215,7 @@ static int new_particle_target_exec(bContext *C, wmOperator *op) BLI_addtail(&psys->targets, pt); - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); @@ -238,6 +239,7 @@ void PARTICLE_OT_new_target(wmOperatorType *ot) static int remove_particle_target_exec(bContext *C, wmOperator *op) { + Main *bmain = CTX_data_main(C); Scene *scene = CTX_data_scene(C); PointerRNA ptr = CTX_data_pointer_get_type(C, "particle_system", &RNA_ParticleSystem); ParticleSystem *psys= ptr.data; @@ -262,7 +264,7 @@ static int remove_particle_target_exec(bContext *C, wmOperator *op) if(pt) pt->flag |= PTARGET_CURRENT; - DAG_scene_sort(scene); + DAG_scene_sort(bmain, scene); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE, ob); |