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 /source/blender/makesrna/intern/rna_object.c
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 'source/blender/makesrna/intern/rna_object.c')
-rw-r--r--source/blender/makesrna/intern/rna_object.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c
index f0b83f3eb46..bef430b0314 100644
--- a/source/blender/makesrna/intern/rna_object.c
+++ b/source/blender/makesrna/intern/rna_object.c
@@ -2963,6 +2963,59 @@ static void rna_def_object_visibility(StructRNA *srna)
RNA_def_property_ui_text(prop, "Display Instancer", "Make instancer visible in the viewport");
RNA_def_property_update(
prop, NC_OBJECT | ND_DRAW, "rna_Object_duplicator_visibility_flag_update");
+
+ /* Ray visibility. */
+ prop = RNA_def_property(srna, "visible_camera", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "visibility_flag", OB_HIDE_CAMERA);
+ RNA_def_property_ui_text(prop, "Camera Visibility", "Object visibility to camera rays");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
+
+ prop = RNA_def_property(srna, "visible_diffuse", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "visibility_flag", OB_HIDE_DIFFUSE);
+ RNA_def_property_ui_text(prop, "Diffuse Visibility", "Object visibility to diffuse rays");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
+
+ prop = RNA_def_property(srna, "visible_glossy", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "visibility_flag", OB_HIDE_GLOSSY);
+ RNA_def_property_ui_text(prop, "Glossy Visibility", "Object visibility to glossy rays");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
+
+ prop = RNA_def_property(srna, "visible_transmission", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "visibility_flag", OB_HIDE_TRANSMISSION);
+ RNA_def_property_ui_text(
+ prop, "Transmission Visibility", "Object visibility to transmission rays");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
+
+ prop = RNA_def_property(srna, "visible_volume_scatter", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "visibility_flag", OB_HIDE_VOLUME_SCATTER);
+ RNA_def_property_ui_text(
+ prop, "Volume Scatter Visibility", "Object visibility to volume scattering rays");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
+
+ prop = RNA_def_property(srna, "visible_shadow", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_negative_sdna(prop, NULL, "visibility_flag", OB_HIDE_SHADOW);
+ RNA_def_property_ui_text(prop, "Shadow Visibility", "Object visibility to shadow rays");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
+
+ /* Holdout and shadow catcher. */
+ prop = RNA_def_property(srna, "is_holdout", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "visibility_flag", OB_HOLDOUT);
+ RNA_def_property_ui_text(
+ prop,
+ "Holdout",
+ "Render objects as a holdout or matte, creating a hole in the image with zero alpha, to "
+ "fill out in compositing with real footage or another render");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_hide_update");
+
+ prop = RNA_def_property(srna, "is_shadow_catcher", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "visibility_flag", OB_SHADOW_CATCHER);
+ RNA_def_property_ui_text(
+ prop,
+ "Shadow Catcher",
+ "Only render shadows and reflections on this object, for compositing renders into real "
+ "footage. Objects with this setting are considered to already exist in the footage, "
+ "objects without it are synthetic objects being composited into it");
+ RNA_def_property_update(prop, NC_OBJECT | ND_DRAW, "rna_Object_internal_update_draw");
}
static void rna_def_object(BlenderRNA *brna)