diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-04-24 17:12:29 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-04-24 17:12:29 +0400 |
commit | 2439bf0d9bc6048135a0c2f9a423092dcbd2d0a1 (patch) | |
tree | 64f8e488c07db198382833c834f16f82822fa3ce /source/blender | |
parent | d2daa230d61f4c35682c7345494ae41d1034a1b0 (diff) |
fix glitch where vertex baking wouldn't always refresh the mesh.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/render/intern/source/bake.c | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/source/blender/render/intern/source/bake.c b/source/blender/render/intern/source/bake.c index c20b0c6da16..d99bac1f7b4 100644 --- a/source/blender/render/intern/source/bake.c +++ b/source/blender/render/intern/source/bake.c @@ -53,6 +53,7 @@ #include "BKE_main.h" #include "BKE_node.h" #include "BKE_scene.h" +#include "BKE_library.h" #include "IMB_imbuf_types.h" #include "IMB_imbuf.h" @@ -641,7 +642,7 @@ static int get_next_bake_face(BakeShade *bs) bs->mloop = me->mloop + bs->mpoly->loopstart; /* Tag mesh for reevaluation. */ - DAG_id_tag_update(&me->id, 0); + me->id.flag |= LIB_DOIT; } else { Image *ima = NULL; @@ -1000,6 +1001,11 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up } } + if (R.r.bake_flag & R_BAKE_VCOL) { + /* untag all meshes */ + tag_main_lb(&G.main->mesh, false); + } + BLI_init_threads(&threads, do_bake_thread, re->r.threads); handles = MEM_callocN(sizeof(BakeShade) * re->r.threads, "BakeShade"); @@ -1099,6 +1105,19 @@ int RE_bake_shade_all_selected(Render *re, int type, Object *actob, short *do_up } } + if (R.r.bake_flag & R_BAKE_VCOL) { + /* update all tagged meshes */ + Object *ob; + for (ob = G.main->object.first; ob; ob = ob->id.next) { + if (ob->type == OB_MESH) { + Mesh *me = ob->data; + if (me->id.flag & LIB_DOIT) { + DAG_id_tag_update(&ob->id, OB_RECALC_OB | OB_RECALC_DATA); + } + } + } + } + MEM_freeN(handles); BLI_end_threads(&threads); |