diff options
Diffstat (limited to 'intern/cycles/blender/blender_mesh.cpp')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index c7844782e78..9f5446f6e69 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -222,20 +222,22 @@ static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, con /* Sync */ -Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated) +Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool holdout, bool object_updated) { /* test if we can instance or if the object is modified */ BL::ID b_ob_data = b_ob.data(); - BL::ID key = (object_is_modified(b_ob))? b_ob: b_ob_data; + BL::ID key = (object_is_modified(b_ob) || holdout)? b_ob: b_ob_data; /* find shader indices */ vector<uint> used_shaders; BL::Object::material_slots_iterator slot; for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) { - BL::Material material_override = render_layers.front().material_override; + BL::Material material_override = render_layer.material_override; - if(material_override) + if(holdout) + find_shader(PointerRNA_NULL, used_shaders, scene->default_holdout); + else if(material_override) find_shader(material_override, used_shaders, scene->default_surface); else find_shader(slot->material(), used_shaders, scene->default_surface); |