Fix assert in the sculpt pen tilt code

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D9422
This commit is contained in:
Pablo Dobarro 2020-11-02 23:02:02 +01:00
parent 850f9452a4
commit f923b6faa9
1 changed files with 6 additions and 3 deletions

View File

@ -2819,9 +2819,12 @@ void SCULPT_tilt_apply_to_normal(float r_normal[3], StrokeCache *cache, const fl
}
const float rot_max = M_PI_2 * tilt_strength * SCULPT_TILT_SENSITIVITY;
mul_v3_mat3_m4v3(r_normal, cache->vc->obact->obmat, r_normal);
rotate_v3_v3v3fl(r_normal, r_normal, cache->vc->rv3d->viewinv[0], cache->y_tilt * rot_max);
rotate_v3_v3v3fl(r_normal, r_normal, cache->vc->rv3d->viewinv[1], cache->x_tilt * rot_max);
mul_v3_mat3_m4v3(r_normal, cache->vc->obact->imat, r_normal);
float normal_tilt_y[3];
rotate_v3_v3v3fl(normal_tilt_y, r_normal, cache->vc->rv3d->viewinv[0], cache->y_tilt * rot_max);
float normal_tilt_xy[3];
rotate_v3_v3v3fl(
normal_tilt_xy, normal_tilt_y, cache->vc->rv3d->viewinv[1], cache->x_tilt * rot_max);
mul_v3_mat3_m4v3(r_normal, cache->vc->obact->imat, normal_tilt_xy);
normalize_v3(r_normal);
}