diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-08 20:23:48 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-12-08 20:23:48 +0300 |
commit | 07904712e8943b5845df9559093018c8473f72f3 (patch) | |
tree | 03cdc6ea24ac87a2ee2a3c1a7299874040675489 /source/blender/makesrna/intern/rna_sculpt_paint.c | |
parent | ee74e720a82b7a1fb5f732cd8ceacbb26fa7e0d3 (diff) |
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.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 6cfd38ba26e..9e13ae1191d 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -100,9 +100,10 @@ static void rna_Paint_active_brush_set(PointerRNA *ptr, PointerRNA value) paint_brush_set(ptr->data, value.data); } -static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr) +static void rna_ParticleEdit_redo(Main *bmain, Scene *scene, PointerRNA *ptr) { - PTCacheEdit *edit = PE_get_current(CTX_data_scene(C), CTX_data_active_object(C)); + Object *ob= (scene->basact)? scene->basact->object: NULL; + PTCacheEdit *edit = PE_get_current(scene, ob); if(!edit) return; @@ -110,9 +111,9 @@ static void rna_ParticleEdit_redo(bContext *C, PointerRNA *ptr) psys_free_path_cache(edit->psys, edit); } -static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) +static void rna_ParticleEdit_update(Main *bmain, Scene *scene, PointerRNA *ptr) { - Object *ob = CTX_data_active_object(C); + Object *ob= (scene->basact)? scene->basact->object: NULL; if(ob) DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } @@ -120,7 +121,8 @@ static void rna_ParticleEdit_update(bContext *C, PointerRNA *ptr) static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *ptr, int *free) { Scene *scene= CTX_data_scene(C); - PTCacheEdit *edit = PE_get_current(scene, CTX_data_active_object(C)); + Object *ob= (scene->basact)? scene->basact->object: NULL; + PTCacheEdit *edit = PE_get_current(scene, ob); if(edit && edit->psys) return particle_edit_hair_brush_items; |