From fc69c54c4ce810e6236eaa45017130f27ba3f1e2 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 7 Dec 2009 18:17:39 +0000 Subject: [PATCH] Particles: bugfixes * Don't show Apply as Shape for particle modifiers. * Fix particles disappearing after exiting particle mode. * Fix free edit not redrawing the 3d view. * Fix use of uninitialized variable in layers template. --- .../blender/editors/interface/interface_templates.c | 12 ++++++------ source/blender/editors/physics/particle_edit.c | 1 + source/blender/editors/space_view3d/drawobject.c | 5 +++-- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index bb893294910..f59e10ede75 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -715,12 +715,12 @@ static uiLayout *draw_modifier(uiLayout *layout, Object *ob, ModifierData *md, i if(ELEM3(psys->part->ren_as, PART_DRAW_PATH, PART_DRAW_GR, PART_DRAW_OB) && psys->pathcache) uiItemO(row, "Convert", 0, "OBJECT_OT_modifier_convert"); } - else + else { uiItemEnumO(row, "Apply", 0, "OBJECT_OT_modifier_apply", "apply_as", MODIFIER_APPLY_DATA); - - if (modifier_sameTopology(md)) - uiItemEnumO(row, "Apply as Shape", 0, "OBJECT_OT_modifier_apply", "apply_as", MODIFIER_APPLY_SHAPE); - + + if (modifier_sameTopology(md)) + uiItemEnumO(row, "Apply as Shape", 0, "OBJECT_OT_modifier_apply", "apply_as", MODIFIER_APPLY_SHAPE); + } uiBlockClearButLock(block); uiBlockSetButLock(block, ob && ob->id.lib, ERROR_LIBDATA_MESSAGE); @@ -1951,7 +1951,7 @@ void uiTemplateLayers(uiLayout *layout, PointerRNA *ptr, char *propname, PointerRNA *used_ptr, char *used_propname, int active_layer) { uiLayout *uRow, *uCol; - PropertyRNA *prop, *used_prop; + PropertyRNA *prop, *used_prop= NULL; int groups, cols, layers; int group, col, layer, row; int cols_per_group = 5; diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index 349db7746a1..7c6b3a5ee26 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -4024,6 +4024,7 @@ static int clear_edited_exec(bContext *C, wmOperator *op) psys->flag &= ~PSYS_EDITED; psys_reset(psys, PSYS_RESET_DEPSGRAPH); + WM_event_add_notifier(C, NC_OBJECT|ND_PARTICLE_DATA, ob); DAG_id_flush_update(&ob->id, OB_RECALC_DATA); } } diff --git a/source/blender/editors/space_view3d/drawobject.c b/source/blender/editors/space_view3d/drawobject.c index 7bc86f6bae7..fa8eee630aa 100644 --- a/source/blender/editors/space_view3d/drawobject.c +++ b/source/blender/editors/space_view3d/drawobject.c @@ -5920,8 +5920,9 @@ void draw_object(Scene *scene, ARegion *ar, View3D *v3d, Base *base, int flag) for(psys=ob->particlesystem.first; psys; psys=psys->next) { /* run this so that possible child particles get cached */ - if(edit && edit->psys == psys) - draw_update_ptcache_edit(scene, ob, edit); + if(ob->mode & OB_MODE_PARTICLE_EDIT && ob==OBACT) + if(edit && edit->psys == psys) + draw_update_ptcache_edit(scene, ob, edit); draw_new_particle_system(scene, v3d, rv3d, base, psys, dt); } -- 2.28.0