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:
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/makesdna/DNA_scene_types.h9
-rw-r--r--source/blender/makesrna/intern/rna_scene.c19
2 files changed, 27 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 80b1049ca23..2db81693f51 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -559,7 +559,8 @@ typedef struct BakeData {
char target;
char save_mode;
char margin_type;
- char _pad[5];
+ char view_from;
+ char _pad[4];
struct Object *cage_object;
} BakeData;
@@ -592,6 +593,12 @@ typedef enum eBakeSaveMode {
R_BAKE_SAVE_EXTERNAL = 1,
} eBakeSaveMode;
+/** #BakeData.view_from (char) */
+typedef enum eBakeViewFrom {
+ R_BAKE_VIEW_FROM_ABOVE_SURFACE = 0,
+ R_BAKE_VIEW_FROM_ACTIVE_CAMERA = 1,
+} eBakeViewFrom;
+
/** #BakeData.pass_filter */
typedef enum eBakePassFilter {
R_BAKE_PASS_FILTER_NONE = 0,
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index da30b7f2136..fdf8be9cb33 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -476,6 +476,20 @@ const EnumPropertyItem rna_enum_bake_save_mode_items[] = {
{0, NULL, 0, NULL, NULL},
};
+const EnumPropertyItem rna_enum_bake_view_from_items[] = {
+ {R_BAKE_VIEW_FROM_ABOVE_SURFACE,
+ "ABOVE_SURFACE",
+ 0,
+ "Above Surface",
+ "Cast rays from above the surface"},
+ {R_BAKE_VIEW_FROM_ACTIVE_CAMERA,
+ "ACTIVE_CAMERA",
+ 0,
+ "Active Camera",
+ "Use the active camera's position to cast rays"},
+ {0, NULL, 0, NULL, NULL},
+};
+
#define R_IMF_VIEWS_ENUM_IND \
{R_IMF_VIEWS_INDIVIDUAL, \
"INDIVIDUAL", \
@@ -5413,6 +5427,11 @@ static void rna_def_bake_data(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Save Mode", "Where to save baked image textures");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
+ prop = RNA_def_property(srna, "view_from", PROP_ENUM, PROP_NONE);
+ RNA_def_property_enum_items(prop, rna_enum_bake_view_from_items);
+ RNA_def_property_ui_text(prop, "View From", "Source of reflection ray directions");
+ RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, NULL);
+
/* flags */
prop = RNA_def_property(srna, "use_selected_to_active", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", R_BAKE_TO_ACTIVE);