diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-02 13:33:45 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-05-02 13:33:45 +0400 |
commit | 1e2afcddd3f1fd7b82fc0ea78fec2d80021fe844 (patch) | |
tree | 8bec6696a9a624affbb56ae9531fc6598f631d81 /intern/cycles/blender | |
parent | 5d4fd04f05fc20d1a15817e5de4f1e2b776ab2b6 (diff) |
Fix #31168: cycles mask layer should only affect objects for camera rays.
Fix: texture coordinate normal output was not correct, still changed under
object transform.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/blender_mesh.cpp | 12 | ||||
-rw-r--r-- | intern/cycles/blender/blender_object.cpp | 12 | ||||
-rw-r--r-- | intern/cycles/blender/blender_sync.h | 2 |
3 files changed, 13 insertions, 13 deletions
diff --git a/intern/cycles/blender/blender_mesh.cpp b/intern/cycles/blender/blender_mesh.cpp index f77e6551de0..867cc71bf47 100644 --- a/intern/cycles/blender/blender_mesh.cpp +++ b/intern/cycles/blender/blender_mesh.cpp @@ -198,11 +198,11 @@ static void create_subd_mesh(Mesh *mesh, BL::Mesh b_mesh, PointerRNA *cmesh, con /* Sync */ -Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool holdout, bool object_updated) +Mesh *BlenderSync::sync_mesh(BL::Object b_ob, 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) || holdout)? b_ob: b_ob_data; + BL::ID key = (object_is_modified(b_ob))? b_ob: b_ob_data; BL::Material material_override = render_layer.material_override; /* find shader indices */ @@ -212,18 +212,14 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool holdout, bool object_updated) for(b_ob.material_slots.begin(slot); slot != b_ob.material_slots.end(); ++slot) { BL::Material material_override = render_layer.material_override; - if(holdout) - find_shader(PointerRNA_NULL, used_shaders, scene->default_holdout); - else if(material_override) + if(material_override) find_shader(material_override, used_shaders, scene->default_surface); else find_shader(slot->material(), used_shaders, scene->default_surface); } if(used_shaders.size() == 0) { - if(holdout) - used_shaders.push_back(scene->default_holdout); - else if(material_override) + if(material_override) find_shader(material_override, used_shaders, scene->default_surface); else used_shaders.push_back(scene->default_surface); diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp index b1cd778c6d3..bbf48050222 100644 --- a/intern/cycles/blender/blender_object.cpp +++ b/intern/cycles/blender/blender_object.cpp @@ -232,11 +232,15 @@ void BlenderSync::sync_object(BL::Object b_parent, int b_index, BL::Object b_ob, if(object_map.sync(&object, b_ob, b_parent, key)) object_updated = true; - /* holdout? */ - bool holdout = (layer_flag & render_layer.holdout_layer) != 0; - + bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0; + /* mesh sync */ - object->mesh = sync_mesh(b_ob, holdout, object_updated); + object->mesh = sync_mesh(b_ob, object_updated); + + if(use_holdout != object->use_holdout) { + object->use_holdout = use_holdout; + scene->object_manager->tag_update(scene); + } /* object sync */ if(object_updated || (object->mesh && object->mesh->need_update)) { diff --git a/intern/cycles/blender/blender_sync.h b/intern/cycles/blender/blender_sync.h index acdcea1ef9b..d6a7218f74f 100644 --- a/intern/cycles/blender/blender_sync.h +++ b/intern/cycles/blender/blender_sync.h @@ -79,7 +79,7 @@ private: void sync_shaders(); void sync_nodes(Shader *shader, BL::ShaderNodeTree b_ntree); - Mesh *sync_mesh(BL::Object b_ob, bool holdout, bool object_updated); + Mesh *sync_mesh(BL::Object b_ob, bool object_updated); void sync_object(BL::Object b_parent, int b_index, BL::Object b_object, Transform& tfm, uint layer_flag, int motion); void sync_light(BL::Object b_parent, int b_index, BL::Object b_ob, Transform& tfm); void sync_background_light(); |