From 6871402614f48ef9c454d057c544ed43abeb87ae Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Fri, 7 Dec 2018 17:01:45 -0200 Subject: Fix Cycles baking active/cage Basically what we address here is to make sure the active object and the cage are not interferring with the baking result (e.g., when baking Combined). To do so, we take advantage of the fact that we create our own depsgraph for baking. So now we can change the cowed objects, instead of the original ones. Note: There is still a way to get a crash. If you try to bake from selected to active when is_cage, but with no cage object, we get an assert: ``` BLI_assert failed: //source/blender/blenkernel/intern/DerivedMesh.c mesh_calc_modifiers(), at (((Mesh *)ob->data)->id.tag & LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT) == 0 ``` We can bypass this by passing ob_low instead of ob_low_eval to bake_mesh_new_from_object on object_bake_api.c:847 . But then the edge split modifier change will take no effect. --- source/blender/render/extern/include/RE_bake.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/render') diff --git a/source/blender/render/extern/include/RE_bake.h b/source/blender/render/extern/include/RE_bake.h index 298bb72a02c..4489efc6a10 100644 --- a/source/blender/render/extern/include/RE_bake.h +++ b/source/blender/render/extern/include/RE_bake.h @@ -59,8 +59,8 @@ typedef struct BakePixel { typedef struct BakeHighPolyData { struct Object *ob; + struct Object *ob_eval; struct Mesh *me; - char restrict_flag; bool is_flip_object; float obmat[4][4]; -- cgit v1.2.3