From 1d1c8bb21bc3435cad337da9cafd5817d82fe503 Mon Sep 17 00:00:00 2001 From: Ton Roosendaal Date: Sat, 11 Dec 2010 16:06:25 +0000 Subject: Small fix: Material Properties: adding new materials didn't create a new preview icon for it. --- source/blender/makesrna/intern/rna_object.c | 1 + source/blender/windowmanager/intern/wm_jobs.c | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 4 deletions(-) (limited to 'source/blender') diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index 289f3de2f2c..57f332a4248 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -583,6 +583,7 @@ static void rna_Object_active_material_set(PointerRNA *ptr, PointerRNA value) { Object *ob= (Object*)ptr->id.data; + DAG_id_tag_update(value.data, 0); assign_material(ob, value.data, ob->actcol); } diff --git a/source/blender/windowmanager/intern/wm_jobs.c b/source/blender/windowmanager/intern/wm_jobs.c index fbab146dc8e..41b206f5479 100644 --- a/source/blender/windowmanager/intern/wm_jobs.c +++ b/source/blender/windowmanager/intern/wm_jobs.c @@ -248,19 +248,32 @@ static void wm_jobs_test_suspend_stop(wmWindowManager *wm, wmJob *test) int suspend= 0; for(steve= wm->jobs.first; steve; steve= steve->next) { + /* obvious case, no test needed */ if(steve==test || !steve->running) continue; - if(steve->startjob!=test->startjob && !(test->flag & WM_JOB_EXCL_RENDER)) continue; - if((test->flag & WM_JOB_EXCL_RENDER) && !(steve->flag & WM_JOB_EXCL_RENDER)) continue; + + /* if new job is not render, then check for same startjob */ + if(0==(test->flag & WM_JOB_EXCL_RENDER)) + if(steve->startjob!=test->startjob) + continue; + + /* if new job is render, any render job should be stopped */ + if(test->flag & WM_JOB_EXCL_RENDER) + if(0==(steve->flag & WM_JOB_EXCL_RENDER)) + continue; suspend= 1; /* if this job has higher priority, stop others */ - if(test->flag & WM_JOB_PRIORITY) + if(test->flag & WM_JOB_PRIORITY) { steve->stop= 1; + // printf("job stopped: %s\n", steve->name); + } } /* possible suspend ourselfs, waiting for other jobs, or de-suspend */ test->suspended= suspend; + // if(suspend) printf("job suspended: %s\n", test->name); + } /* if job running, the same owner gave it a new job */ @@ -294,7 +307,7 @@ void WM_jobs_start(wmWindowManager *wm, wmJob *steve) BLI_init_threads(&steve->threads, do_job_thread, 1); BLI_insert_thread(&steve->threads, steve); - // printf("job started\n"); + // printf("job started: %s\n", steve->name); } /* restarted job has timer already */ -- cgit v1.2.3