Fix T74173 Assert when scaling camera in viewport to zero

This commit is contained in:
Clément Foucault 2020-04-23 21:32:21 +02:00
parent 0fbcb824d0
commit 54e1b63567
Notes: blender-bot 2023-02-13 23:22:49 +01:00
Referenced by issue #74173, Assert when scaling camera in viewport to zero
1 changed files with 4 additions and 0 deletions

View File

@ -1160,6 +1160,10 @@ void OVERLAY_camera_cache_populate(OVERLAY_Data *vedata, Object *ob)
}
else {
copy_v3_fl3(scale, len_v3(ob->obmat[0]), len_v3(ob->obmat[1]), len_v3(ob->obmat[2]));
/* Avoid division by 0. */
if (ELEM(0.0f, scale[0], scale[1], scale[2])) {
return;
}
invert_v3(scale);
}