diff options
author | Ton Roosendaal <ton@blender.org> | 2012-11-06 19:54:04 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2012-11-06 19:54:04 +0400 |
commit | 7b60529517d2fb70606da54a27bd05e73dd657f0 (patch) | |
tree | 678193166aaa1f15a962fb3f196a1a1ed433f31d /source/blender/editors | |
parent | acc8c654fc83373b3ef98247cd3c2a1e1d23a168 (diff) |
Bugfix #33092
Fluid sim would stop or crash with node editor.
Bug was a real bad one - the code for giving out WM jobs was messed up for long.
It was giving a running fluid job to the compositer even... tsk!
I will go over jobs code carefully next days to see if it all behaves. Now it
allows per owner multiple jobs, provided it has different job_type set.
Also fixed: preview renders (material) were deadslow once a while - caused
by icon render setting miniature tile render sizes. Now it's fast again,
but there are still 3 icon jobs running per UI change... need to check what.
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/render/render_preview.c | 40 |
1 files changed, 25 insertions, 15 deletions
diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index 53cb5340940..b119165fbd0 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -237,6 +237,14 @@ static int preview_mat_has_sss(Material *mat, bNodeTree *ntree) return 0; } +static Scene *preview_get_scene(void) +{ + if (pr_main == NULL) return NULL; + + return pr_main->scene.first; +} + + /* call this with a pointer to initialize preview scene */ /* call this with NULL to restore assigned ID pointers in preview scene */ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPreview *sp) @@ -244,9 +252,7 @@ static Scene *preview_prepare_scene(Scene *scene, ID *id, int id_type, ShaderPre Scene *sce; Base *base; - if (pr_main == NULL) return NULL; - - sce = pr_main->scene.first; + sce = preview_get_scene(); if (sce) { /* this flag tells render to not execute depsgraph or ipos etc */ @@ -665,8 +671,23 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs char name[32]; int sizex; + /* in case of split preview, use border render */ + if (split) { + if (first) sizex = sp->sizex / 2; + else sizex = sp->sizex - sp->sizex / 2; + } + else sizex = sp->sizex; + + /* we have to set preview variables first */ + sce = preview_get_scene(); + if (sce) { + sce->r.xsch = sizex; + sce->r.ysch = sp->sizey; + sce->r.size = 100; + } + /* get the stuff from the builtin preview dbase */ - sce = preview_prepare_scene(sp->scene, id, idtype, sp); // XXX sizex + sce = preview_prepare_scene(sp->scene, id, idtype, sp); if (sce == NULL) return; if (!split || first) sprintf(name, "Preview %p", sp->owner); @@ -694,17 +715,6 @@ static void shader_preview_render(ShaderPreview *sp, ID *id, int split, int firs sce->r.mode |= R_OSA; } - /* in case of split preview, use border render */ - if (split) { - if (first) sizex = sp->sizex / 2; - else sizex = sp->sizex - sp->sizex / 2; - } - else sizex = sp->sizex; - - /* allocates or re-uses render result */ - sce->r.xsch = sizex; - sce->r.ysch = sp->sizey; - sce->r.size = 100; /* callbacs are cleared on GetRender() */ if (ELEM(sp->pr_method, PR_BUTS_RENDER, PR_NODE_RENDER)) { |