Undo revision 23130 which was a merge with 2.5, a messy one because I did something...
[blender.git] / source / blender / editors / physics / ed_pointcache.c
index f2c7b64..917e2b4 100644 (file)
@@ -46,7 +46,6 @@
 
 #include "ED_screen.h"
 #include "ED_physics.h"
-#include "ED_particle.h"
 
 #include "UI_interface.h"
 #include "UI_resources.h"
@@ -72,12 +71,6 @@ static int ptcache_bake_all_poll(bContext *C)
        return 1;
 }
 
-static int ptcache_poll(bContext *C)
-{
-       PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
-       return (ptr.data && ptr.id.data);
-}
-
 static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
 {
        Scene *scene= CTX_data_scene(C);
@@ -191,16 +184,8 @@ static int ptcache_free_bake_exec(bContext *C, wmOperator *op)
 {
        PointerRNA ptr= CTX_data_pointer_get_type(C, "PointCache", &RNA_PointCache);
        PointCache *cache= ptr.data;
-
-       if(cache->edit) {
-               if(!cache->edit->edited || 1) {// XXX okee("Lose changes done in particle mode?")) {
-                       PE_free_ptcache_edit(cache->edit);
-                       cache->edit = NULL;
-                       cache->flag &= ~PTCACHE_BAKED;
-               }
-       }
-       else
-               cache->flag &= ~PTCACHE_BAKED;
+       
+       cache->flag &= ~PTCACHE_BAKED;
 
        return OPERATOR_FINISHED;
 }
@@ -221,12 +206,12 @@ void PTCACHE_OT_bake(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= ptcache_bake_exec;
-       ot->poll= ptcache_poll;
+       ot->poll= ptcache_bake_all_poll;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
 
-       RNA_def_boolean(ot->srna, "bake", 0, "Bake", "");
+       RNA_def_boolean(ot->srna, "bake", 1, "Bake", "");
 }
 void PTCACHE_OT_free_bake(wmOperatorType *ot)
 {
@@ -236,7 +221,7 @@ void PTCACHE_OT_free_bake(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= ptcache_free_bake_exec;
-       ot->poll= ptcache_poll;
+       ot->poll= ptcache_bake_all_poll;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -249,7 +234,7 @@ void PTCACHE_OT_bake_from_cache(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= ptcache_bake_from_cache_exec;
-       ot->poll= ptcache_poll;
+       ot->poll= ptcache_bake_all_poll;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -314,7 +299,7 @@ void PTCACHE_OT_add_new(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= ptcache_add_new_exec;
-       ot->poll= ptcache_poll; // ptcache_bake_all_poll;
+       ot->poll= ptcache_bake_all_poll;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
@@ -327,7 +312,7 @@ void PTCACHE_OT_remove(wmOperatorType *ot)
        
        /* api callbacks */
        ot->exec= ptcache_remove_exec;
-       ot->poll= ptcache_poll;
+       ot->poll= ptcache_bake_all_poll;
 
        /* flags */
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;