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:
authorDalai Felinto <dfelinto@gmail.com>2016-01-15 18:00:56 +0300
committerDalai Felinto <dfelinto@gmail.com>2016-01-15 18:00:56 +0300
commit9a76354585e2cd2011267e79bd99ca59a06588f8 (patch)
treee775e7c44dc210ef9978b483930ade6a9b4d6fc5 /source/blender/makesrna/intern/rna_render.c
parent9137a4401440d3f3206e989f49f3539079d685b8 (diff)
Cycles-Bake: Custom Baking passes
The combined pass is built with the contributions the user finds fit. It is useful for lightmap baking, as well as non-view dependent effects baking. The manual will be updated once we get closer to the 2.77 release. Meanwhile the new page can be found here: http://dalaifelinto.com/blender-manual/render/cycles/baking.html Reviewers: sergey, brecht Differential Revision: https://developer.blender.org/D1674
Diffstat (limited to 'source/blender/makesrna/intern/rna_render.c')
-rw-r--r--source/blender/makesrna/intern/rna_render.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_render.c b/source/blender/makesrna/intern/rna_render.c
index dd07f3cb038..6fce93dd9f6 100644
--- a/source/blender/makesrna/intern/rna_render.c
+++ b/source/blender/makesrna/intern/rna_render.c
@@ -84,6 +84,21 @@ EnumPropertyItem rna_enum_render_pass_debug_type_items[] = {
{0, NULL, 0, NULL, NULL}
};
+EnumPropertyItem rna_enum_bake_pass_type_items[] = {
+ {SCE_PASS_COMBINED, "COMBINED", 0, "Combined", ""},
+ {SCE_PASS_AO, "AO", 0, "AO", ""},
+ {SCE_PASS_SHADOW, "SHADOW", 0, "Shadow", ""},
+ {SCE_PASS_NORMAL, "NORMAL", 0, "Normal", ""},
+ {SCE_PASS_UV, "UV", 0, "UV", ""},
+ {SCE_PASS_EMIT, "EMIT", 0, "Emit", ""},
+ {SCE_PASS_ENVIRONMENT, "ENVIRONMENT", 0, "Environment", ""},
+ {SCE_PASS_DIFFUSE_COLOR, "DIFFUSE", 0, "Diffuse", ""},
+ {SCE_PASS_GLOSSY_COLOR, "GLOSSY", 0, "Glossy", ""},
+ {SCE_PASS_TRANSM_COLOR, "TRANSMISSION", 0, "Transmission", ""},
+ {SCE_PASS_SUBSURFACE_COLOR, "SUBSURFACE", 0, "Subsurface", ""},
+ {0, NULL, 0, NULL, NULL}
+};
+
#ifdef RNA_RUNTIME
#include "MEM_guardedalloc.h"
@@ -162,7 +177,7 @@ static void engine_render(RenderEngine *engine, struct Scene *scene)
}
static void engine_bake(RenderEngine *engine, struct Scene *scene,
- struct Object *object, const int pass_type,
+ struct Object *object, const int pass_type, const int pass_filter,
const int object_id, const struct BakePixel *pixel_array,
const int num_pixels, const int depth, void *result)
{
@@ -178,6 +193,7 @@ static void engine_bake(RenderEngine *engine, struct Scene *scene,
RNA_parameter_set_lookup(&list, "scene", &scene);
RNA_parameter_set_lookup(&list, "object", &object);
RNA_parameter_set_lookup(&list, "pass_type", &pass_type);
+ RNA_parameter_set_lookup(&list, "pass_filter", &pass_filter);
RNA_parameter_set_lookup(&list, "object_id", &object_id);
RNA_parameter_set_lookup(&list, "pixel_array", &pixel_array);
RNA_parameter_set_lookup(&list, "num_pixels", &num_pixels);
@@ -432,7 +448,9 @@ static void rna_def_render_engine(BlenderRNA *brna)
RNA_def_property_flag(prop, PROP_REQUIRED);
prop = RNA_def_pointer(func, "object", "Object", "", "");
RNA_def_property_flag(prop, PROP_REQUIRED);
- prop = RNA_def_enum(func, "pass_type", rna_enum_render_pass_type_items, 0, "Pass", "Pass to bake");
+ prop = RNA_def_enum(func, "pass_type", rna_enum_bake_pass_type_items, 0, "Pass", "Pass to bake");
+ RNA_def_property_flag(prop, PROP_REQUIRED);
+ prop = RNA_def_int(func, "pass_filter", 0, 0, INT_MAX, "Pass Filter", "Filter to combined, diffuse, glossy, transmission and subsurface passes", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);
prop = RNA_def_int(func, "object_id", 0, 0, INT_MAX, "Object Id", "Id of the current object being baked in relation to the others", 0, INT_MAX);
RNA_def_property_flag(prop, PROP_REQUIRED);