Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/mirror.c
| Context not available. | |||||
| MLoopNorSpaceArray lnors_spacearr = {NULL}; | MLoopNorSpaceArray lnors_spacearr = {NULL}; | ||||
| float(*poly_normals)[3] = MEM_mallocN(sizeof(*poly_normals) * totpoly, __func__); | float(*poly_normals)[3] = MEM_mallocN(sizeof(*poly_normals) * totpoly, __func__); | ||||
| /* The transform matrix of a normal must be | |||||
| * the transpose of inverse of transform matrix of the geometry... */ | |||||
| float mtx_nor[4][4]; | |||||
| invert_m4_m4(mtx_nor, mtx); | |||||
| transpose_m4(mtx_nor); | |||||
| /* calculate custom normals into loop_normals, then mirror first half into second half */ | /* calculate custom normals into loop_normals, then mirror first half into second half */ | ||||
| BKE_mesh_calc_normals_poly(result->mvert, | BKE_mesh_calc_normals_poly(result->mvert, | ||||
| Context not available. | |||||
| mirrorj += mpmirror->totloop - (j - mp->loopstart); | mirrorj += mpmirror->totloop - (j - mp->loopstart); | ||||
| } | } | ||||
| copy_v3_v3(loop_normals[mirrorj], loop_normals[j]); | copy_v3_v3(loop_normals[mirrorj], loop_normals[j]); | ||||
| mul_m4_v3(mtx_nor, loop_normals[mirrorj]); | loop_normals[mirrorj][axis] = -loop_normals[j][axis]; | ||||
| BKE_lnor_space_custom_normal_to_data( | BKE_lnor_space_custom_normal_to_data( | ||||
| lnors_spacearr.lspacearr[mirrorj], loop_normals[mirrorj], clnors[mirrorj]); | lnors_spacearr.lspacearr[mirrorj], loop_normals[mirrorj], clnors[mirrorj]); | ||||
| } | } | ||||
| Context not available. | |||||