* Fix for incorrect disabling after baking cloth sim
authorMatt Ebb <matt@mke3.net>
Fri, 4 Dec 2009 04:28:50 +0000 (04:28 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 4 Dec 2009 04:28:50 +0000 (04:28 +0000)
* Fix for time cursor getting 'stuck' after baking point caches

release/scripts/ui/properties_physics_cloth.py
source/blender/blenkernel/BKE_pointcache.h
source/blender/blenkernel/intern/pointcache.c
source/blender/editors/physics/physics_pointcache.c
source/blender/editors/space_view3d/drawobject.c
source/blender/windowmanager/intern/wm_cursors.c

index 0829b533c811e93830023ac4cf4b5cb2dfade0a3..7123e52fb8d93641f29483a00ed422b1b2c024d8 100644 (file)
@@ -83,9 +83,9 @@ class PHYSICS_PT_cloth(PhysicButtonsPanel):
         if md:
             cloth = md.settings
 
-            layout.active = cloth_panel_enabled(md)
-
             split = layout.split()
+            
+            split.active = cloth_panel_enabled(md)
 
             col = split.column()
 
index 5ae10d736fde178027bdac58c73c68a4827baa4a..4b26eaa6d76ea9cf22494d2a9509f9e14f6af401 100644 (file)
@@ -151,6 +151,7 @@ typedef struct PTCacheBaker {
        int (*break_test)(void *data);
        void *break_data;
        void (*progressbar)(void *data, int num);
+       void (*progressend)(void *data);
        void *progresscontext;
 } PTCacheBaker;
 
index c2798b4a74682e4165c5ad8067918013dc897e9f..cc7b942a6bbbc6532d36bec0743a8c1d6436740e 100644 (file)
@@ -2232,6 +2232,7 @@ void BKE_ptcache_quick_cache_all(Scene *scene)
        baker.break_test=NULL;
        baker.pid=NULL;
        baker.progressbar=NULL;
+       baker.progressend=NULL;
        baker.progresscontext=NULL;
        baker.render=0;
        baker.anim_init = 0;
@@ -2360,6 +2361,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
                if(baker->break_test && baker->break_test(baker->break_data))
                        break;
        }
+       baker->progressend(baker->progresscontext);
 
        /* clear baking flag */
        if(pid) {
@@ -2400,7 +2402,7 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
 
        scene->r.framelen = frameleno;
        CFRA = cfrao;
-
+       
        if(bake) /* already on cfra unless baking */
                scene_update_for_newframe(scene, scene->lay);
 
index 9973c38bb416cd9d4e7518ae4c4ffec0f4b86007..a931e27bc8326df07b4175d983f1f119642f721f 100644 (file)
@@ -109,9 +109,11 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
 
        if (win) {
                baker.progressbar = (void (*)(void *, int))WM_timecursor;
+               baker.progressend = (void (*)(void *))WM_cursor_restore;
                baker.progresscontext = win;
        } else {
                baker.progressbar = bake_console_progress;
+               baker.progressend = NULL;
                baker.progresscontext = NULL;
        }
 
@@ -200,10 +202,12 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op)
 
        if (win) {
                baker.progressbar = (void (*)(void *, int))WM_timecursor;
+               baker.progressend = (void (*)(void *))WM_cursor_restore;
                baker.progresscontext = win;
        } else {
                printf("\n"); /* empty first line before console reports */
                baker.progressbar = bake_console_progress;
+               baker.progressend = NULL;
                baker.progresscontext = NULL;
        }
 
index 8592a5455c2c8d10c64368968f79dd6dea6d5598..f60f4ad9230cb375dca17b9ead0a38fe46467d0e 100644 (file)
@@ -4174,7 +4174,6 @@ static void draw_ptcache_edit(Scene *scene, View3D *v3d, RegionView3D *rv3d, Obj
        ParticleEditSettings *pset = PE_settings(scene);
        int i, k, totpoint = edit->totpoint, timed = pset->flag & PE_FADE_TIME ? pset->fade_frames : 0;
        int steps=1;
-       char nosel[4], sel[4];
        float sel_col[3];
        float nosel_col[3];
        float *pathcol = NULL, *pcol;
index 7decf7b2ed2c08d4cbf4c1380c5bd5a657e1f8f9..95a1de961152cd31530e4c39e2c6829e3b3da025 100644 (file)
@@ -212,7 +212,7 @@ void WM_timecursor(wmWindow *win, int nr)
        unsigned char bitmap[16][2];
        int i, idx;
        
-       if(win->lastcursor != 0)
+       if(win->lastcursor == 0)
                win->lastcursor= win->cursor; 
        
        memset(&bitmap, 0x00, sizeof(bitmap));