* Fix for incorrect disabling after baking cloth sim

* Fix for time cursor getting 'stuck' after baking point caches
This commit is contained in:
Matt Ebb 2009-12-04 04:28:50 +00:00
parent 45955fef18
commit a358b6386d
6 changed files with 11 additions and 5 deletions

@ -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()

@ -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;

@ -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);

@ -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;
}

@ -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;

@ -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));