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>2017-11-18 08:06:27 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2017-11-29 20:11:40 +0300
commite4b54f44c1b19069de5818d47ce899c690e9b56d (patch)
treed57650c436e12a7c1bb5647df58fff60961b1155 /intern/cycles/blender
parent7e349f27457a8348c73cc81a4c4b66b34e379c26 (diff)
Cycles: add object level holdout property.
This works the same as the holdout shader and Z mask layer. Combined with overrides in 2.8 this is intended to replace the Z mask layer bits.
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r--intern/cycles/blender/addon/properties.py9
-rw-r--r--intern/cycles/blender/addon/ui.py4
-rw-r--r--intern/cycles/blender/blender_object.cpp5
3 files changed, 15 insertions, 3 deletions
diff --git a/intern/cycles/blender/addon/properties.py b/intern/cycles/blender/addon/properties.py
index e5084138a9c..b17593a19d6 100644
--- a/intern/cycles/blender/addon/properties.py
+++ b/intern/cycles/blender/addon/properties.py
@@ -1087,6 +1087,15 @@ class CyclesObjectSettings(bpy.types.PropertyGroup):
default=False,
)
+ cls.is_holdout = BoolProperty(
+ name="Holdout",
+ description="Render objects as a holdout or matte, creating a "
+ "hole in the image with zero alpha, to fill out in "
+ "compositing with real footange or another render",
+ default=False,
+ )
+
+
@classmethod
def unregister(cls):
del bpy.types.Object.cycles
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index 03ca1ab6c7f..6badfed76d5 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -868,7 +868,9 @@ class CYCLES_OBJECT_PT_cycles_settings(CyclesButtonsPanel, Panel):
if ob.type != 'LAMP':
flow.prop(visibility, "shadow")
- layout.prop(cob, "is_shadow_catcher")
+ row = layout.row()
+ row.prop(cob, "is_shadow_catcher")
+ row.prop(cob, "is_holdout")
col = layout.column()
col.label(text="Performance:")
diff --git a/intern/cycles/blender/blender_object.cpp b/intern/cycles/blender/blender_object.cpp
index f02d5496112..38ef1bc5249 100644
--- a/intern/cycles/blender/blender_object.cpp
+++ b/intern/cycles/blender/blender_object.cpp
@@ -295,7 +295,9 @@ Object *BlenderSync::sync_object(BL::Object& b_parent,
}
/* Visibility flags for both parent and child. */
- bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0;
+ PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
+ bool use_holdout = (layer_flag & render_layer.holdout_layer) != 0 ||
+ get_boolean(cobject, "is_holdout");
uint visibility = object_ray_visibility(b_ob) & PATH_RAY_ALL_VISIBILITY;
if(b_parent.ptr.data != b_ob.ptr.data) {
@@ -374,7 +376,6 @@ Object *BlenderSync::sync_object(BL::Object& b_parent,
object_updated = true;
}
- PointerRNA cobject = RNA_pointer_get(&b_ob.ptr, "cycles");
bool is_shadow_catcher = get_boolean(cobject, "is_shadow_catcher");
if(is_shadow_catcher != object->is_shadow_catcher) {
object->is_shadow_catcher = is_shadow_catcher;