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_lattice.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'source/blender/makesrna/intern/rna_lattice.c') diff --git a/source/blender/makesrna/intern/rna_lattice.c b/source/blender/makesrna/intern/rna_lattice.c index aff38ebdd74..f46ea13ba2e 100644 --- a/source/blender/makesrna/intern/rna_lattice.c +++ b/source/blender/makesrna/intern/rna_lattice.c @@ -87,17 +87,16 @@ static void rna_Lattice_points_begin(CollectionPropertyIterator *iter, PointerRN rna_iterator_array_begin(iter, NULL, 0, 0, 0, NULL); } -static void rna_Lattice_update_data(bContext *C, PointerRNA *ptr) +static void rna_Lattice_update_data(Main *bmain, Scene *scene, PointerRNA *ptr) { ID *id= ptr->id.data; DAG_id_flush_update(id, OB_RECALC_DATA); - WM_event_add_notifier(C, NC_GEOM|ND_DATA, id); + WM_main_add_notifier(NC_GEOM|ND_DATA, id); } -static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr) +static void rna_Lattice_update_size(Main *bmain, Scene *scene, PointerRNA *ptr) { - Main *bmain= CTX_data_main(C); Lattice *lt= ptr->id.data; Object *ob; int newu, newv, neww; @@ -124,7 +123,7 @@ static void rna_Lattice_update_size(bContext *C, PointerRNA *ptr) resizelattice(lt->editlatt, newu, newv, neww, NULL); } - rna_Lattice_update_data(C, ptr); + rna_Lattice_update_data(bmain, scene, ptr); } static void rna_Lattice_outside_set(PointerRNA *ptr, int value) -- cgit v1.2.3