[Bf-blender-cvs] [0b0c2901f60] master: Render: remove unused Blender Internal view layer settings

Brecht Van Lommel noreply at git.blender.org
Thu Jul 29 18:13:22 CEST 2021


Commit: 0b0c2901f603a7f38a550446125a0e70cd0c29eb
Author: Brecht Van Lommel
Date:   Thu Jul 29 16:34:54 2021 +0200
Branches: master
https://developer.blender.org/rB0b0c2901f603a7f38a550446125a0e70cd0c29eb

Render: remove unused Blender Internal view layer settings

These should have been removed earlier but were forgotten.

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

M	source/blender/blenkernel/intern/layer.c
M	source/blender/editors/object/object_bake_api.c
M	source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
M	source/blender/makesdna/DNA_scene_types.h
M	source/blender/makesrna/intern/rna_scene.c
M	source/blender/render/intern/bake.c
M	source/blender/render/intern/pipeline.c
M	source/blender/render/intern/render_result.c

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

diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index 5322eef6d5e..ae1863f0a47 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -179,7 +179,7 @@ static ViewLayer *view_layer_add(const char *name)
   BLI_strncpy_utf8(view_layer->name, name, sizeof(view_layer->name));
 
   /* Pure rendering pipeline settings. */
-  view_layer->layflag = 0x7FFF; /* solid ztra halo edge strand */
+  view_layer->layflag = SCE_LAY_FLAG_DEFAULT;
   view_layer->passflag = SCE_PASS_COMBINED;
   view_layer->pass_alpha_threshold = 0.5f;
   view_layer->cryptomatte_levels = 6;
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 233f2a65dac..43358f51396 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -416,7 +416,6 @@ static bool is_noncolor_pass(eScenePassType pass_type)
               SCE_PASS_VECTOR,
               SCE_PASS_INDEXOB,
               SCE_PASS_UV,
-              SCE_PASS_RAYHITS,
               SCE_PASS_INDEXMA);
 }
 
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index e290b8a87a3..937a10f26b1 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -138,7 +138,7 @@ BlenderStrokeRenderer::BlenderStrokeRenderer(Render *re, int render_count)
 
   // Scene layer.
   ViewLayer *view_layer = (ViewLayer *)freestyle_scene->view_layers.first;
-  view_layer->layflag = SCE_LAY_SOLID | SCE_LAY_ZTRA;
+  view_layer->layflag = SCE_LAY_SOLID;
 
   // Camera
   Object *object_camera = BKE_object_add(freestyle_bmain, view_layer, OB_CAMERA, nullptr);
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 05bd88acab0..3cd5a068e86 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -233,22 +233,24 @@ typedef struct SceneRenderLayer {
 
 /** #SceneRenderLayer.layflag */
 #define SCE_LAY_SOLID (1 << 0)
-#define SCE_LAY_ZTRA (1 << 1)
-#define SCE_LAY_HALO (1 << 2)
-#define SCE_LAY_EDGE (1 << 3)
+#define SCE_LAY_UNUSED_1 (1 << 1)
+#define SCE_LAY_UNUSED_2 (1 << 2)
+#define SCE_LAY_UNUSED_3 (1 << 3)
 #define SCE_LAY_SKY (1 << 4)
 #define SCE_LAY_STRAND (1 << 5)
 #define SCE_LAY_FRS (1 << 6)
 #define SCE_LAY_AO (1 << 7)
 #define SCE_LAY_VOLUMES (1 << 8)
 #define SCE_LAY_MOTION_BLUR (1 << 9)
-/* flags between (1 << 9) and (1 << 15) are set to 1 already, for future options */
 
-#define SCE_LAY_ALL_Z (1 << 15)
-/* #define SCE_LAY_XOR         (1 << 16) */ /* UNUSED */
+/* Flags between (1 << 9) and (1 << 15) are set to 1 already, for future options. */
+#define SCE_LAY_FLAG_DEFAULT ((1 << 15) - 1)
+
+#define SCE_LAY_UNUSED_4 (1 << 15)
+#define SCE_LAY_UNUSED_5 (1 << 16)
 #define SCE_LAY_DISABLE (1 << 17)
-#define SCE_LAY_ZMASK (1 << 18)
-#define SCE_LAY_NEG_ZMASK (1 << 19)
+#define SCE_LAY_UNUSED_6 (1 << 18)
+#define SCE_LAY_UNUSED_7 (1 << 19)
 
 /** #SceneRenderLayer.passflag */
 typedef enum eScenePassType {
@@ -267,7 +269,7 @@ typedef enum eScenePassType {
   SCE_PASS_UV = (1 << 12),
   SCE_PASS_UNUSED_6 = (1 << 13), /* INDIRECT */
   SCE_PASS_MIST = (1 << 14),
-  SCE_PASS_RAYHITS = (1 << 15),
+  SCE_PASS_UNUSED_7 = (1 << 15), /* RAYHITS */
   SCE_PASS_EMIT = (1 << 16),
   SCE_PASS_ENVIRONMENT = (1 << 17),
   SCE_PASS_INDEXMA = (1 << 18),
@@ -302,7 +304,6 @@ typedef enum eScenePassType {
 #define RE_PASSNAME_INDEXMA "IndexMA"
 #define RE_PASSNAME_MIST "Mist"
 
-#define RE_PASSNAME_RAYHITS "RayHits"
 #define RE_PASSNAME_DIFFUSE_DIRECT "DiffDir"
 #define RE_PASSNAME_DIFFUSE_INDIRECT "DiffInd"
 #define RE_PASSNAME_DIFFUSE_COLOR "DiffCol"
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index 6a28cf34965..7d7eec6f256 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -4120,41 +4120,6 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce
     RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_ViewLayer_pass_update");
   }
 
-  /* layer options */
-  prop = RNA_def_property(srna, "use_zmask", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZMASK);
-  RNA_def_property_ui_text(prop, "Zmask", "Only render what's in front of the solid z values");
-  if (scene) {
-    RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
-  }
-  else {
-    RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-  }
-
-  prop = RNA_def_property(srna, "invert_zmask", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_NEG_ZMASK);
-  RNA_def_property_ui_text(
-      prop,
-      "Zmask Negate",
-      "For Zmask, only render what is behind solid z values instead of in front");
-  if (scene) {
-    RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_Scene_glsl_update");
-  }
-  else {
-    RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-  }
-
-  prop = RNA_def_property(srna, "use_all_z", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ALL_Z);
-  RNA_def_property_ui_text(
-      prop, "All Z", "Fill in Z values for solid faces in invisible layers, for masking");
-  if (scene) {
-    RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
-  }
-  else {
-    RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-  }
-
   prop = RNA_def_property(srna, "use_solid", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SOLID);
   RNA_def_property_ui_text(prop, "Solid", "Render Solid faces in this Layer");
@@ -4164,29 +4129,6 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce
   else {
     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
   }
-
-  prop = RNA_def_property(srna, "use_halo", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_HALO);
-  RNA_def_property_ui_text(prop, "Halo", "Render Halos in this Layer (on top of Solid)");
-  if (scene) {
-    RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
-  }
-  else {
-    RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-  }
-
-  prop = RNA_def_property(srna, "use_ztransp", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_ZTRA);
-  RNA_def_property_ui_text(prop,
-                           "Z-Transparent",
-                           "Render Z-transparent faces in this layer (on top of Solid and Halos)");
-  if (scene) {
-    RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
-  }
-  else {
-    RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-  }
-
   prop = RNA_def_property(srna, "use_sky", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_SKY);
   RNA_def_property_ui_text(prop, "Sky", "Render Sky in this Layer");
@@ -4207,17 +4149,6 @@ void rna_def_view_layer_common(BlenderRNA *brna, StructRNA *srna, const bool sce
     RNA_def_property_clear_flag(prop, PROP_EDITABLE);
   }
 
-  prop = RNA_def_property(srna, "use_edge_enhance", PROP_BOOLEAN, PROP_NONE);
-  RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_EDGE);
-  RNA_def_property_ui_text(
-      prop, "Edge", "Render edge-enhance in this layer (only works for solid faces)");
-  if (scene) {
-    RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
-  }
-  else {
-    RNA_def_property_clear_flag(prop, PROP_EDITABLE);
-  }
-
   prop = RNA_def_property(srna, "use_strand", PROP_BOOLEAN, PROP_NONE);
   RNA_def_property_boolean_sdna(prop, NULL, "layflag", SCE_LAY_STRAND);
   RNA_def_property_ui_text(prop, "Strand", "Render Strands in this Layer");
diff --git a/source/blender/render/intern/bake.c b/source/blender/render/intern/bake.c
index 74e57989f47..76839651b5d 100644
--- a/source/blender/render/intern/bake.c
+++ b/source/blender/render/intern/bake.c
@@ -1056,7 +1056,6 @@ int RE_pass_depth(const eScenePassType pass_type)
     case SCE_PASS_NORMAL:
     case SCE_PASS_VECTOR:
     case SCE_PASS_INDEXOB: /* XXX double check */
-    case SCE_PASS_RAYHITS: /* XXX double check */
     case SCE_PASS_EMIT:
     case SCE_PASS_ENVIRONMENT:
     case SCE_PASS_INDEXMA:
diff --git a/source/blender/render/intern/pipeline.c b/source/blender/render/intern/pipeline.c
index 6329901b4ce..333ee9ecd33 100644
--- a/source/blender/render/intern/pipeline.c
+++ b/source/blender/render/intern/pipeline.c
@@ -2806,7 +2806,6 @@ RenderPass *RE_pass_find_by_type(volatile RenderLayer *rl, int passtype, const c
   CHECK_PASS(INDEXOB);
   CHECK_PASS(INDEXMA);
   CHECK_PASS(MIST);
-  CHECK_PASS(RAYHITS);
   CHECK_PASS(DIFFUSE_DIRECT);
   CHECK_PASS(DIFFUSE_INDIRECT);
   CHECK_PASS(DIFFUSE_COLOR);
diff --git a/source/blender/render/intern/render_result.c b/source/blender/render/intern/render_result.c
index 53252cdb42f..693cddbebbe 100644
--- a/source/blender/render/intern/render_result.c
+++ b/source/blender/render/intern/render_result.c
@@ -332,7 +332,6 @@ RenderResult *render_result_new(
     BLI_strncpy(rl->name, view_layer->name, sizeof(rl->name));
     rl->layflag = view_layer->layflag;
 
-    /* for debugging: view_layer->passflag | SCE_PASS_RAYHITS; */
     rl->passflag = view_layer->passflag;
 
     rl->rectx = rectx;
@@ -399,9 +398,6 @@ RenderResult *render_result_new(
       if (view_layer->passflag & SCE_PASS_MIST) {
         RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 1, RE_PASSNAME_MIST, view, "Z");
       }
-      if (rl->passflag & SCE_PASS_RAYHITS) {
-        RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 4, RE_PASSNAME_RAYHITS, view, "RGB");
-      }
       if (view_layer->passflag & SCE_PASS_DIFFUSE_DIRECT) {
         RENDER_LAYER_ADD_PASS_SAFE(rr, rl, 3, RE_PASSNAME_DIFFUSE_DIRECT, view, "RGB");
       }
@@ -474,7 +470,7 @@ RenderResult *render_result_new(
     }
 
     /* NOTE: this has to be in sync with `scene.c`. */


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list