Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2015-09-30 23:47:12 +0300
committerCampbell Barton <ideasman42@gmail.com>2015-10-01 00:25:45 +0300
commitde360c4090fc744e73b3fb6950bafd10a2d28712 (patch)
treef1b095d7aa5fdf15614c27434c7f29c386f0a23f /source/blender/editors/object/object_bake_api.c
parent1030b22b0ae67aa648da5a77c38a361bb2d8cd6f (diff)
Fix T46313: Cycles bake normal map
Regression moving to bake to looptri caused by mismatch w/ MFace and MLoopTri when the 3rd index was 0.
Diffstat (limited to 'source/blender/editors/object/object_bake_api.c')
-rw-r--r--source/blender/editors/object/object_bake_api.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 2c4f7a8e107..9090bffcbfc 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -689,7 +689,6 @@ static int bake(
/* get the mesh as it arrives in the renderer */
me_low = BKE_mesh_new_from_object(bmain, scene, ob_low, 1, 2, 0, 0);
BKE_mesh_split_faces(me_low);
- BKE_mesh_tessface_ensure(me_low);
/* populate the pixel array with the face data */
if ((is_selected_to_active && (ob_cage == NULL) && is_cage) == false)
@@ -706,8 +705,7 @@ static int bake(
if (ob_cage) {
me_cage = BKE_mesh_new_from_object(bmain, scene, ob_cage, 1, 2, 0, 0);
BKE_mesh_split_faces(me_cage);
- BKE_mesh_tessface_ensure(me_cage);
- if (me_low->totface != me_cage->totface) {
+ if ((me_low->totpoly != me_cage->totpoly) || (me_low->totloop != me_cage->totloop)) {
BKE_report(reports, RPT_ERROR,
"Invalid cage object, the cage mesh must have the same number "
"of faces as the active object");
@@ -740,7 +738,6 @@ static int bake(
/* get the cage mesh as it arrives in the renderer */
me_cage = BKE_mesh_new_from_object(bmain, scene, ob_low, 1, 2, 0, 0);
BKE_mesh_split_faces(me_cage);
- BKE_mesh_tessface_ensure(me_cage);
RE_bake_pixels_populate(me_cage, pixel_array_low, num_pixels, &bake_images, uv_layer);
}
@@ -769,7 +766,6 @@ static int bake(
highpoly[i].me = BKE_mesh_new_from_object(bmain, scene, highpoly[i].ob, 1, 2, 0, 0);
highpoly[i].ob->restrictflag &= ~OB_RESTRICT_RENDER;
BKE_mesh_split_faces(highpoly[i].me);
- BKE_mesh_tessface_ensure(highpoly[i].me);
/* lowpoly to highpoly transformation matrix */
copy_m4_m4(highpoly[i].obmat, highpoly[i].ob->obmat);
@@ -873,7 +869,6 @@ cage_cleanup:
me_nores = BKE_mesh_new_from_object(bmain, scene, ob_low, 1, 2, 0, 0);
BKE_mesh_split_faces(me_nores);
- BKE_mesh_tessface_ensure(me_nores);
RE_bake_pixels_populate(me_nores, pixel_array_low, num_pixels, &bake_images, uv_layer);
RE_bake_normal_world_to_tangent(pixel_array_low, num_pixels, depth, result, me_nores, normal_swizzle, ob_low->obmat);