Fixing crash with cycles baking with is_cage and no cage

This commit is contained in:
Dalai Felinto 2018-12-14 08:27:37 -02:00
parent 21523b5c86
commit 285cfef695
Notes: blender-bot 2023-02-14 00:29:15 +01:00
Referenced by commit 10508338d8, Build fixup for previous commit
1 changed files with 3 additions and 1 deletions

View File

@ -56,6 +56,7 @@
#include "BKE_mesh.h"
#include "BKE_modifier.h"
#include "BKE_node.h"
#include "BKE_object.h"
#include "BKE_report.h"
#include "BKE_scene.h"
#include "BKE_screen.h"
@ -843,7 +844,8 @@ static int bake(
md = md_next;
}
/* get the cage mesh as it arrives in the renderer */
/* We need to restore object->data to a non-modifier-evaluated state. */
BKE_object_free_derivedderived_caches(ob_low_eval);
me_cage = bake_mesh_new_from_object(depsgraph, bmain, scene, ob_low_eval);
RE_bake_pixels_populate(me_cage, pixel_array_low, num_pixels, &bake_images, uv_layer);
}