Cycles: Fix crash after recent subd fixes

Was happening when object only had curves (doe example, object with hair
particle system and emitter rendering disabled).
This commit is contained in:
Sergey Sharybin 2016-08-25 11:31:36 +02:00
parent 086ec8af48
commit 86c719f796
1 changed files with 4 additions and 0 deletions

View File

@ -587,6 +587,10 @@ void Mesh::add_vertex_normals()
void Mesh::pack_normals(Scene *scene, uint *tri_shader, float4 *vnormal)
{
Attribute *attr_vN = attributes.find(ATTR_STD_VERTEX_NORMAL);
if(attr_vN == NULL) {
/* Happens on objects with just hair. */
return;
}
float3 *vN = attr_vN->data_float3();
uint shader_id = 0;