diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-10-12 05:36:06 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-10-12 05:36:06 +0400 |
commit | 51cbfb396128bf800c0b53fd922a87dc4fe0ff79 (patch) | |
tree | 7fe491544369b14301afb185e325850974a5ee4b /source/blender/makesrna/intern/rna_sculpt_paint.c | |
parent | 50a851b946bc7eebdf3d489786f1a18c9ec3d8f1 (diff) |
fix [#28883] redraw problems for particle mode's brush menu
The enum items for getting the brush tool (which the UI draws), would change after the 3D view first draws on exiting editmode.
Since the panel draws before the 3D view does, the UI had a glitch.
Fix by using psys_get_current() for the enum, rather then PE_get_current() which depends on an updated particle system.
Diffstat (limited to 'source/blender/makesrna/intern/rna_sculpt_paint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_sculpt_paint.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index b350956047c..28b96f3b08b 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -131,13 +131,23 @@ static EnumPropertyItem *rna_ParticleEdit_tool_itemf(bContext *C, PointerRNA *UN { Scene *scene= CTX_data_scene(C); Object *ob= (scene->basact)? scene->basact->object: NULL; +#if 0 PTCacheEdit *edit = PE_get_current(scene, ob); - - if(edit && edit->psys) { - if(edit->psys->flag & PSYS_GLOBAL_HAIR) + ParticleSystem *psys= edit ? edit->psys : NULL; +#else + /* use this rather than PE_get_current() - because the editing cache is + * dependant on the cache being updated which can happen after this UI + * draws causing a glitch [#28883] */ + ParticleSystem *psys= psys_get_current(ob); +#endif + + if(psys) { + if(psys->flag & PSYS_GLOBAL_HAIR) { return particle_edit_disconnected_hair_brush_items; - else + } + else { return particle_edit_hair_brush_items; + } } return particle_edit_cache_brush_items; |