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 <brecht@blender.org>2021-08-04 20:43:40 +0300
committerBrecht Van Lommel <brecht@blender.org>2021-08-05 18:22:38 +0300
commitca64bd0aacdaa9fcf75d693321d4d73c4a6a991a (patch)
treecfbecc0f9cb815d3b17efc0f60261ac590c69d8a /intern/cycles/blender/blender_util.h
parent6c326ba0a24f24763b751483a0ee0cc98abdd921 (diff)
Render: move Cycles visibility, holdout and shadow catcher properties to Blender
The immediate reason for this is that we want to be able to initialize them to different defaults for light objects, which is hard with Python properties. But in general it is useful to be able to share these with other renderers. As a side effect, Eevee now supports a per-object holdout instead of only per-collection. Differential Revision: https://developer.blender.org/D12133
Diffstat (limited to 'intern/cycles/blender/blender_util.h')
-rw-r--r--intern/cycles/blender/blender_util.h13
1 files changed, 6 insertions, 7 deletions
diff --git a/intern/cycles/blender/blender_util.h b/intern/cycles/blender/blender_util.h
index 43dbb4105df..2b2188b023d 100644
--- a/intern/cycles/blender/blender_util.h
+++ b/intern/cycles/blender/blender_util.h
@@ -596,15 +596,14 @@ static inline Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob,
static inline uint object_ray_visibility(BL::Object &b_ob)
{
- PointerRNA cvisibility = RNA_pointer_get(&b_ob.ptr, "cycles_visibility");
uint flag = 0;
- flag |= get_boolean(cvisibility, "camera") ? PATH_RAY_CAMERA : 0;
- flag |= get_boolean(cvisibility, "diffuse") ? PATH_RAY_DIFFUSE : 0;
- flag |= get_boolean(cvisibility, "glossy") ? PATH_RAY_GLOSSY : 0;
- flag |= get_boolean(cvisibility, "transmission") ? PATH_RAY_TRANSMIT : 0;
- flag |= get_boolean(cvisibility, "shadow") ? PATH_RAY_SHADOW : 0;
- flag |= get_boolean(cvisibility, "scatter") ? PATH_RAY_VOLUME_SCATTER : 0;
+ flag |= b_ob.visible_camera() ? PATH_RAY_CAMERA : 0;
+ flag |= b_ob.visible_diffuse() ? PATH_RAY_DIFFUSE : 0;
+ flag |= b_ob.visible_glossy() ? PATH_RAY_GLOSSY : 0;
+ flag |= b_ob.visible_transmission() ? PATH_RAY_TRANSMIT : 0;
+ flag |= b_ob.visible_shadow() ? PATH_RAY_SHADOW : 0;
+ flag |= b_ob.visible_volume_scatter() ? PATH_RAY_VOLUME_SCATTER : 0;
return flag;
}