[Bf-blender-cvs] [b98ff5c] master: Fix T37303, Fix T37163: cycles mask layers that are also excluded not rendering correct with multiple render layers.
Brecht Van Lommel
noreply at git.blender.org
Tue Nov 26 20:37:22 CET 2013
Commit: b98ff5cb5b2c14c33b16e3b129e1e08810e90a6c
Author: Brecht Van Lommel
Date: Tue Nov 26 20:34:29 2013 +0100
http://developer.blender.org/rBb98ff5cb5b2c14c33b16e3b129e1e08810e90a6c
Fix T37303, Fix T37163: cycles mask layers that are also excluded not rendering
correct with multiple render layers.
This case is somewhat weak, we now do a few more checks on sync than I would
like, but it's not too bad.
===================================================================
M intern/cycles/blender/blender_object.cpp
M release/scripts/addons
M release/scripts/addons_contrib
===================================================================
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index ba584e1..dfe9751 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -267,13 +267,38 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
/* mesh sync */
object->mesh = sync_mesh(b_ob, object_updated, hide_tris);
- /* sspecial case not tracked by object update flags */
+ /* special case not tracked by object update flags */
+
+ /* holdout */
if(use_holdout != object->use_holdout) {
object->use_holdout = use_holdout;
scene->object_manager->tag_update(scene);
object_updated = true;
}
+ /* visibility flags for both parent and child */
+ uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
+ if(b_parent.ptr.data != b_ob.ptr.data) {
+ visibility &= object_ray_visibility(b_parent);
+ object->random_id ^= hash_int(hash_string(b_parent.name().c_str()));
+ }
+
+ /* make holdout objects on excluded layer invisible for non-camera rays */
+ if(use_holdout && (layer_flag & render_layer.exclude_layer))
+ visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
+
+ /* camera flag is not actually used, instead is tested
+ * against render layer flags */
+ if(visibility & PATH_RAY_CAMERA) {
+ visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
+ visibility &= ~PATH_RAY_CAMERA;
+ }
+
+ if(visibility != object->visibility) {
+ object->visibility = visibility;
+ object_updated = true;
+ }
+
/* object sync
* transform comparison should not be needed, but duplis don't work perfect
* in the depsgraph and may not signal changes, so this is a workaround */
@@ -295,24 +320,10 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
else
object->random_id = hash_int_2d(object->random_id, 0);
- /* visibility flags for both parent */
- object->visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
- if(b_parent.ptr.data != b_ob.ptr.data) {
- object->visibility &= object_ray_visibility(b_parent);
+ if(b_parent.ptr.data != b_ob.ptr.data)
object->random_id ^= hash_int(hash_string(b_parent.name().c_str()));
- }
-
- /* make holdout objects on excluded layer invisible for non-camera rays */
- if(use_holdout && (layer_flag & render_layer.exclude_layer))
- object->visibility &= ~(PATH_RAY_ALL_VISIBILITY - PATH_RAY_CAMERA);
-
- /* camera flag is not actually used, instead is tested
- * against render layer flags */
- if(object->visibility & PATH_RAY_CAMERA) {
- object->visibility |= layer_flag << PATH_RAY_LAYER_SHIFT;
- object->visibility &= ~PATH_RAY_CAMERA;
- }
+ /* dupli texture coordinates */
if (b_dupli_ob) {
object->dupli_generated = 0.5f*get_float3(b_dupli_ob.orco()) - make_float3(0.5f, 0.5f, 0.5f);
object->dupli_uv = get_float2(b_dupli_ob.uv());
diff --git a/release/scripts/addons b/release/scripts/addons
index 6501c6c..dbf7e49 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 6501c6cadfef1804dfa4b7aa2eb208207570a42a
+Subproject commit dbf7e49d9b37fa61b5c42d33864f6b4fbfa6d705
diff --git a/release/scripts/addons_contrib b/release/scripts/addons_contrib
index 6695fc6..4fe6a9e 160000
--- a/release/scripts/addons_contrib
+++ b/release/scripts/addons_contrib
@@ -1 +1 @@
-Subproject commit 6695fc64a51fcc64c96bc31c5b209a54d8ea9ba6
+Subproject commit 4fe6a9e046f9578a0dadb1186269ac5e406a8c15
More information about the Bf-blender-cvs
mailing list