Fix T38521: skin modifier crash with zero radius vertices.

This commit is contained in:
Brecht Van Lommel 2014-02-07 13:41:19 +01:00
parent 1f5029b184
commit 52bae9691b
Notes: blender-bot 2023-02-14 11:25:11 +01:00
Referenced by issue #38521, blender crashes when scaling all vertex radii to zero when skin modifier present
1 changed files with 5 additions and 1 deletions

View File

@ -774,7 +774,11 @@ static int calc_edge_subdivisions(const MVert *mvert, const MVertSkin *nodes,
avg[0] = half_v2(evs[0]->radius);
avg[1] = half_v2(evs[1]->radius);
num_subdivisions = (int)((float)edge_len / (avg[0] + avg[1]));
if (avg[0] + avg[1] == 0.0f)
num_subdivisions = 0;
else
num_subdivisions = (int)((float)edge_len / (avg[0] + avg[1]));
/* If both ends are branch nodes, two intermediate nodes are
* required */