Temporary fix for "freezing when pointcache is baked":

* WM_timecursor is broken somehow, so pointcache baking makes the cursor disappear.
* For user this seems like blender has frozen although it's just a matter of no progress indication.
* This fix just sets the default "busy" cursor for the whole duration of baking and reports progress in the console.
* If there's and easy fix for this then it should probably be done straight away, but I want to re-implement baking using the job system soon anyways, so a proper fix for this is not strictly necessary.
This commit is contained in:
Janne Karhu
2010-11-04 20:17:38 +00:00
parent 951882e289
commit 8bbf27dfbd
2 changed files with 13 additions and 3 deletions

View File

@@ -2607,6 +2607,8 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
thread_data.break_operation = FALSE;
thread_data.thread_ended = FALSE;
old_progress = -1;
WM_cursor_wait(1);
if(G.background) {
ptcache_make_cache_thread((void*)&thread_data);
@@ -2690,6 +2692,8 @@ void BKE_ptcache_make_cache(PTCacheBaker* baker)
else if (baker->progressend)
baker->progressend(baker->progresscontext);
WM_cursor_wait(0);
/* TODO: call redraw all windows somehow */
}
/* Helpers */

View File

@@ -83,7 +83,7 @@ void bake_console_progress(void *UNUSED(arg), int nr)
void bake_console_progress_end(void *UNUSED(arg))
{
printf("\n");
printf("\rbake: done!\n");
}
static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
@@ -103,7 +103,10 @@ static int ptcache_bake_all_exec(bContext *C, wmOperator *op)
baker.break_test = cache_break_test;
baker.break_data = NULL;
if (win) {
/* Disabled for now as this doesn't work properly,
* and pointcache baking will be reimplemented with
* the job system soon anyways. */
if (win && 0) {
baker.progressbar = (void (*)(void *, int))WM_timecursor;
baker.progressend = (void (*)(void *))WM_cursor_restore;
baker.progresscontext = win;
@@ -201,7 +204,10 @@ static int ptcache_bake_exec(bContext *C, wmOperator *op)
baker.break_test = cache_break_test;
baker.break_data = NULL;
if (win) {
/* Disabled for now as this doesn't work properly,
* and pointcache baking will be reimplemented with
* the job system soon anyways. */
if (win && 0) {
baker.progressbar = (void (*)(void *, int))WM_timecursor;
baker.progressend = (void (*)(void *))WM_cursor_restore;
baker.progresscontext = win;