Fix T44512: Cycles fails normal bake /w scale flip
This commit is contained in:
parent
9dadc8f599
commit
e1ed47eb5b
@ -775,11 +775,7 @@ static int bake(
|
||||
copy_m4_m4(highpoly[i].obmat, highpoly[i].ob->obmat);
|
||||
invert_m4_m4(highpoly[i].imat, highpoly[i].obmat);
|
||||
|
||||
/* rotation */
|
||||
normalize_m4_m4(highpoly[i].rotmat, highpoly[i].imat);
|
||||
zero_v3(highpoly[i].rotmat[3]);
|
||||
if (is_negative_m4(highpoly[i].rotmat))
|
||||
negate_mat3_m4(highpoly[i].rotmat);
|
||||
highpoly[i].is_flip_object = is_negative_m4(highpoly[i].ob->obmat);
|
||||
|
||||
i++;
|
||||
}
|
||||
|
@ -61,10 +61,10 @@ typedef struct BakeHighPolyData {
|
||||
struct ModifierData *tri_mod;
|
||||
struct Mesh *me;
|
||||
char restrict_flag;
|
||||
bool is_flip_object;
|
||||
|
||||
float obmat[4][4];
|
||||
float imat[4][4];
|
||||
float rotmat[4][4];
|
||||
} BakeHighPolyData;
|
||||
|
||||
/* external_engine.c */
|
||||
|
@ -300,7 +300,7 @@ static bool cast_ray_highpoly(
|
||||
mul_v3_m4v3(co_high, highpoly[i].imat, co);
|
||||
|
||||
/* rotates */
|
||||
mul_v3_m4v3(dir_high, highpoly[i].rotmat, dir);
|
||||
mul_v3_mat3_m4v3(dir_high, highpoly[i].imat, dir);
|
||||
normalize_v3(dir_high);
|
||||
|
||||
/* cast ray */
|
||||
|
Loading…
Reference in New Issue
Block a user