Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-25 19:30:26 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-07-25 19:30:26 +0300
commit9a40690242dff4153a48c1da0f0f87a71a020e64 (patch)
tree8e4f32e9db97724877b888b26dfae86654e12b07
parentbd326d0d1fedf2bcedbb72fb8f14847991e6cce6 (diff)
Fix for holdout / indirect only with collection instances.
-rw-r--r--intern/cycles/blender/blender_object.cpp4
-rw-r--r--source/blender/makesrna/intern/rna_object_api.c16
2 files changed, 10 insertions, 10 deletions
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). */