diff options
author | Mai Lavelle <mai.lavelle@gmail.com> | 2016-08-23 21:49:10 +0300 |
---|---|---|
committer | Mai Lavelle <mai.lavelle@gmail.com> | 2016-08-24 17:39:00 +0300 |
commit | 438bcc6d28e975bbefae6f86f21824f9feed0b6c (patch) | |
tree | 6ab8447e2c66fb405f727f6ec05a04f93d2db062 /intern/cycles | |
parent | 74bd80996287b3d7bb99fa9e980bb545f59155f7 (diff) |
Cycles: Fix crash when empty mesh has subdivision
OpenSubdiv doesn't like empty meshes, so we need to be careful not to
subdivide when the mesh is empty.
Diffstat (limited to 'intern/cycles')
-rw-r--r-- | intern/cycles/render/mesh_subdivision.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/intern/cycles/render/mesh_subdivision.cpp b/intern/cycles/render/mesh_subdivision.cpp index f87425f0042..c8cc3abf7d9 100644 --- a/intern/cycles/render/mesh_subdivision.cpp +++ b/intern/cycles/render/mesh_subdivision.cpp @@ -299,7 +299,9 @@ void Mesh::tessellate(DiagSplit *split) bool need_packed_patch_table = false; if(subdivision_type == SUBDIVISION_CATMULL_CLARK) { - osd_data.build_from_mesh(this); + if(subd_faces.size()) { + osd_data.build_from_mesh(this); + } } else #endif @@ -468,7 +470,7 @@ void Mesh::tessellate(DiagSplit *split) /* keep subdivision for corner attributes disabled for now */ attr.flags &= ~ATTR_SUBDIVIDED; } - else { + else if(subd_faces.size()) { osd_data.subdivide_attribute(attr); need_packed_patch_table = true; |