mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
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.
This commit is contained in:
parent
74bd809962
commit
438bcc6d28
1 changed files with 4 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue