Particles: bugfixes
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 7 Dec 2009 18:17:39 +0000 (18:17 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 7 Dec 2009 18:17:39 +0000 (18:17 +0000)
* 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.

source/blender/editors/interface/interface_templates.c
source/blender/editors/physics/particle_edit.c
source/blender/editors/space_view3d/drawobject.c

index bb89329491017b11a43446bc572203c71c56c462..f59e10ede7512170436b129a9995970436e99f13 100644 (file)
@@ -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;
index 349db7746a13e10a73377d1749854407ba53fca8..7c6b3a5ee2653b5a195ad595c0bb57817313338a 100644 (file)
@@ -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);
                }
        }
index 7bc86f6bae71270fc906d471d66b870ad6078987..fa8eee630aa727c53f0e8c082e8c4107afd2e93d 100644 (file)
@@ -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);
                }