From 07904712e8943b5845df9559093018c8473f72f3 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Tue, 8 Dec 2009 17:23:48 +0000 Subject: RNA: * Property update functions no longer get context, instead they get only Main and Scene. The RNA api was intended to be as context-less as possible, since it doesn't really matter who is changing the property, everything that uses the property should be updated. * There's still one exception case that use it now, screen operations still depend on context too much. It also revealed a few places using context where they shouldn't. * Ideally Scene shouldn't be passed, but much of Blender still depends on it, should be dropped when we try to support multiple scene editing. Change was planned for a while, but need this now to be able to call update without a context pointer. --- source/blender/makesrna/intern/rna_boid.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/blender/makesrna/intern/rna_boid.c') diff --git a/source/blender/makesrna/intern/rna_boid.c b/source/blender/makesrna/intern/rna_boid.c index 37b957a16ca..01d8a4db498 100644 --- a/source/blender/makesrna/intern/rna_boid.c +++ b/source/blender/makesrna/intern/rna_boid.c @@ -72,7 +72,7 @@ EnumPropertyItem boidruleset_type_items[] ={ #include "BKE_depsgraph.h" #include "BKE_particle.h" -static void rna_Boids_reset(bContext *C, PointerRNA *ptr) +static void rna_Boids_reset(Main *bmain, Scene *scene, PointerRNA *ptr) { if(ptr->type==&RNA_ParticleSystem) { ParticleSystem *psys = (ParticleSystem*)ptr->data; @@ -84,12 +84,10 @@ static void rna_Boids_reset(bContext *C, PointerRNA *ptr) else DAG_id_flush_update(ptr->id.data, OB_RECALC_DATA|PSYS_RECALC_RESET); - WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); + WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL); } -static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr) +static void rna_Boids_reset_deps(Main *bmain, Scene *scene, PointerRNA *ptr) { - Scene *scene = CTX_data_scene(C); - if(ptr->type==&RNA_ParticleSystem) { ParticleSystem *psys = (ParticleSystem*)ptr->data; @@ -102,7 +100,7 @@ static void rna_Boids_reset_deps(bContext *C, PointerRNA *ptr) DAG_scene_sort(scene); - WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, NULL); + WM_main_add_notifier(NC_OBJECT|ND_PARTICLE_DATA, NULL); } static StructRNA* rna_BoidRule_refine(struct PointerRNA *ptr) -- cgit v1.2.3