[Bf-blender-cvs] [9a40690242d] blender2.8: Fix for holdout / indirect only with collection instances.

Brecht Van Lommel noreply at git.blender.org
Wed Jul 25 18:31:31 CEST 2018


Commit: 9a40690242dff4153a48c1da0f0f87a71a020e64
Author: Brecht Van Lommel
Date:   Wed Jul 25 18:30:26 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB9a40690242dff4153a48c1da0f0f87a71a020e64

Fix for holdout / indirect only with collection instances.

===================================================================

M	intern/cycles/blender/blender_object.cpp
M	source/blender/makesrna/intern/rna_object_api.c

===================================================================

diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index 42e2198779e..a1f39d0848f 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -347,7 +347,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
 	/* Visibility flags for both parent and child. */
 	PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
 	bool use_holdout = get_boolean(cobject, "is_holdout") ||
-	                   b_ob.holdout_get(b_view_layer);
+	                   b_parent.holdout_get(b_view_layer);
 	uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
 
 	if(b_parent.ptr.data != b_ob.ptr.data) {
@@ -362,7 +362,7 @@ Object *BlenderSync::sync_object(BL::Depsgraph& b_depsgraph,
 #endif
 
 	/* Clear camera visibility for indirect only objects. */
-	bool use_indirect_only = b_ob.indirect_only_get(b_view_layer);
+	bool use_indirect_only = b_parent.indirect_only_get(b_view_layer);
 	if(use_indirect_only) {
 		visibility &= ~PATH_RAY_CAMERA;
 	}
diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c
index 44709db9d94..8f8f3176096 100644
--- a/source/blender/makesrna/intern/rna_object_api.c
+++ b/source/blender/makesrna/intern/rna_object_api.c
@@ -129,10 +129,10 @@ static bool rna_Object_select_get(Object *ob, bContext *C, ReportList *reports)
 
 	if (!base) {
 		BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name);
-		return -1;
+		return false;
 	}
 
-	return ((base->flag & BASE_SELECTED) != 0) ? 1 : 0;
+	return ((base->flag & BASE_SELECTED) != 0);
 }
 
 static bool rna_Object_visible_get(Object *ob, bContext *C, ReportList *reports)
@@ -142,10 +142,10 @@ static bool rna_Object_visible_get(Object *ob, bContext *C, ReportList *reports)
 
 	if (!base) {
 		BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name);
-		return -1;
+		return false;
 	}
 
-	return ((base->flag & BASE_VISIBLE) != 0) ? 1 : 0;
+	return ((base->flag & BASE_VISIBLE) != 0);
 }
 
 static bool rna_Object_holdout_get(Object *ob, ReportList *reports, ViewLayer *view_layer)
@@ -154,10 +154,10 @@ static bool rna_Object_holdout_get(Object *ob, ReportList *reports, ViewLayer *v
 
 	if (!base) {
 		BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name);
-		return -1;
+		return false;
 	}
 
-	return ((base->flag & BASE_HOLDOUT) != 0) ? 1 : 0;
+	return ((base->flag & BASE_HOLDOUT) != 0);
 }
 
 static bool rna_Object_indirect_only_get(Object *ob, ReportList *reports, ViewLayer *view_layer)
@@ -166,10 +166,10 @@ static bool rna_Object_indirect_only_get(Object *ob, ReportList *reports, ViewLa
 
 	if (!base) {
 		BKE_reportf(reports, RPT_ERROR, "Object '%s' not in View Layer '%s'!", ob->id.name + 2, view_layer->name);
-		return -1;
+		return false;
 	}
 
-	return ((base->flag & BASE_INDIRECT_ONLY) != 0) ? 1 : 0;
+	return ((base->flag & BASE_INDIRECT_ONLY) != 0);
 }
 
 /* Convert a given matrix from a space to another (using the object and/or a bone as reference). */



More information about the Bf-blender-cvs mailing list