[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [45712] branches/soc-2011-tomato: Cycles: render layer "Exclude Layers" added.

Brecht Van Lommel brechtvanlommel at pandora.be
Tue Apr 17 14:49:39 CEST 2012


Revision: 45712
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=45712
Author:   blendix
Date:     2012-04-17 12:49:39 +0000 (Tue, 17 Apr 2012)
Log Message:
-----------
Cycles: render layer "Exclude Layers" added.

Scene layers (all object that influence the render, directly or indirectly) are
shared between all render layers. However sometimes it's useful to leave out some
object influence for a particular render layer. That's what this option allows you
to do.

Modified Paths:
--------------
    branches/soc-2011-tomato/intern/cycles/blender/addon/ui.py
    branches/soc-2011-tomato/intern/cycles/blender/blender_sync.cpp
    branches/soc-2011-tomato/source/blender/makesdna/DNA_scene_types.h
    branches/soc-2011-tomato/source/blender/makesrna/intern/rna_scene.c
    branches/soc-2011-tomato/source/blender/render/extern/include/RE_pipeline.h
    branches/soc-2011-tomato/source/blender/render/intern/source/render_result.c

Modified: branches/soc-2011-tomato/intern/cycles/blender/addon/ui.py
===================================================================
--- branches/soc-2011-tomato/intern/cycles/blender/addon/ui.py	2012-04-17 12:14:16 UTC (rev 45711)
+++ branches/soc-2011-tomato/intern/cycles/blender/addon/ui.py	2012-04-17 12:49:39 UTC (rev 45712)
@@ -178,11 +178,8 @@
 
         col = split.column()
         col.prop(scene, "layers", text="Scene")
-        col.label(text="Material:")
-        col.prop(rl, "material_override", text="")
+        col.prop(rl, "layers_exclude", text="Exclude")
 
-        col.prop(rl, "use_sky", "Use Environment")
-
         col = split.column()
         col.prop(rl, "layers", text="Layer")
         col.label(text="Mask Layers:")
@@ -191,6 +188,15 @@
         split = layout.split()
 
         col = split.column()
+        col.label(text="Material:")
+        col.prop(rl, "material_override", text="")
+
+        col = split.column()
+        col.prop(rl, "use_sky", "Use Environment")
+
+        split = layout.split()
+
+        col = split.column()
         col.label(text="Passes:")
         col.prop(rl, "use_pass_combined")
         col.prop(rl, "use_pass_z")

Modified: branches/soc-2011-tomato/intern/cycles/blender/blender_sync.cpp
===================================================================
--- branches/soc-2011-tomato/intern/cycles/blender/blender_sync.cpp	2012-04-17 12:14:16 UTC (rev 45711)
+++ branches/soc-2011-tomato/intern/cycles/blender/blender_sync.cpp	2012-04-17 12:49:39 UTC (rev 45712)
@@ -222,7 +222,7 @@
 	for(r.layers.begin(b_rlay); b_rlay != r.layers.end(); ++b_rlay) {
 		if((!layer && first_layer) || (layer && b_rlay->name() == layer)) {
 			render_layer.name = b_rlay->name();
-			render_layer.scene_layer = get_layer(b_scene.layers());
+			render_layer.scene_layer = get_layer(b_scene.layers()) & ~get_layer(b_rlay->layers_exclude());
 			render_layer.layer = get_layer(b_rlay->layers());
 			render_layer.holdout_layer = get_layer(b_rlay->layers_zmask());
 			render_layer.layer |= render_layer.holdout_layer;

Modified: branches/soc-2011-tomato/source/blender/makesdna/DNA_scene_types.h
===================================================================
--- branches/soc-2011-tomato/source/blender/makesdna/DNA_scene_types.h	2012-04-17 12:14:16 UTC (rev 45711)
+++ branches/soc-2011-tomato/source/blender/makesdna/DNA_scene_types.h	2012-04-17 12:49:39 UTC (rev 45712)
@@ -176,12 +176,11 @@
 	struct Material *mat_override;
 	struct Group *light_override;
 	
-	unsigned int lay;		/* scene->lay itself has priority over this */
-	unsigned int lay_zmask;	/* has to be after lay, this is for Z-masking */
+	unsigned int lay;		  /* scene->lay itself has priority over this */
+	unsigned int lay_zmask;	  /* has to be after lay, this is for Z-masking */
+	unsigned int lay_exclude; /* not used by internal, exclude */
 	int layflag;
 	
-	int pad;
-	
 	int passflag;			/* pass_xor has to be after passflag */
 	int pass_xor;
 } SceneRenderLayer;

Modified: branches/soc-2011-tomato/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2011-tomato/source/blender/makesrna/intern/rna_scene.c	2012-04-17 12:14:16 UTC (rev 45711)
+++ branches/soc-2011-tomato/source/blender/makesrna/intern/rna_scene.c	2012-04-17 12:49:39 UTC (rev 45712)
@@ -1905,6 +1905,13 @@
 	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, "layers_exclude", PROP_BOOLEAN, PROP_LAYER);
+	RNA_def_property_boolean_sdna(prop, NULL, "lay_exclude", 1);
+	RNA_def_property_array(prop, 20);
+	RNA_def_property_ui_text(prop, "Exclude Layers", "Exclude scene layers from having any influence");
+	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);
+
 	/* layer options */
 	prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_negative_sdna(prop, NULL, "layflag", SCE_LAY_DISABLE);

Modified: branches/soc-2011-tomato/source/blender/render/extern/include/RE_pipeline.h
===================================================================
--- branches/soc-2011-tomato/source/blender/render/extern/include/RE_pipeline.h	2012-04-17 12:14:16 UTC (rev 45711)
+++ branches/soc-2011-tomato/source/blender/render/extern/include/RE_pipeline.h	2012-04-17 12:49:39 UTC (rev 45712)
@@ -82,7 +82,7 @@
 	
 	/* copy of RenderData */
 	char name[RE_MAXNAME];		
-	unsigned int lay, lay_zmask;
+	unsigned int lay, lay_zmask, lay_exclude;
 	int layflag, passflag, pass_xor;		
 	
 	struct Material *mat_override;

Modified: branches/soc-2011-tomato/source/blender/render/intern/source/render_result.c
===================================================================
--- branches/soc-2011-tomato/source/blender/render/intern/source/render_result.c	2012-04-17 12:14:16 UTC (rev 45711)
+++ branches/soc-2011-tomato/source/blender/render/intern/source/render_result.c	2012-04-17 12:49:39 UTC (rev 45712)
@@ -458,6 +458,7 @@
 		BLI_strncpy(rl->name, srl->name, sizeof(rl->name));
 		rl->lay= srl->lay;
 		rl->lay_zmask= srl->lay_zmask;
+		rl->lay_exclude= srl->lay_exclude;
 		rl->layflag= srl->layflag;
 		rl->passflag= srl->passflag; // for debugging: srl->passflag|SCE_PASS_RAYHITS;
 		rl->pass_xor= srl->pass_xor;




More information about the Bf-blender-cvs mailing list