[Bf-blender-cvs] [83a001267ab] blender2.8: Probe: Add planar type.
Clément Foucault
noreply at git.blender.org
Mon Jun 19 10:48:06 CEST 2017
Commit: 83a001267aba8f2ef193ac1d3520b27374689249
Author: Clément Foucault
Date: Fri Jun 16 15:00:02 2017 +0200
Branches: blender2.8
https://developer.blender.org/rB83a001267aba8f2ef193ac1d3520b27374689249
Probe: Add planar type.
===================================================================
M source/blender/editors/object/object_add.c
M source/blender/makesdna/DNA_lightprobe_types.h
M source/blender/makesrna/intern/rna_lightprobe.c
===================================================================
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index e8343dce384..49bcdd3d5ae 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -155,9 +155,9 @@ static EnumPropertyItem field_type_items[] = {
static EnumPropertyItem lightprobe_type_items[] = {
{0, "SPHERE", ICON_MESH_UVSPHERE, "Sphere", "Reflection probe with sphere attenuation"},
{1, "CUBE", ICON_MESH_CUBE, "Cube", "Reflection probe with cube attenuation"},
- // {LIGHTPROBE_TYPE_PLANAR, "PLANAR", ICON_MESH_PLANE, "Planar", ""},
+ {2, "PLANAR", ICON_MESH_PLANE, "Planar", "Planar reflection probe"},
// {LIGHTPROBE_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", ""},
- {2, "GRID", ICON_MESH_GRID, "Grid", "Irradiance probe to capture diffuse indirect lighting"},
+ {3, "GRID", ICON_MESH_GRID, "Grid", "Irradiance probe to capture diffuse indirect lighting"},
{0, NULL, 0, NULL, NULL}
};
@@ -536,11 +536,16 @@ static int lightprobe_add_exec(bContext *C, wmOperator *op)
probe = (LightProbe *)ob->data;
- if (type == 2) {
+ if (type == 3) {
probe->type = LIGHTPROBE_TYPE_GRID;
probe->distinf = 0.3f;
probe->falloff = 1.0f;
}
+ else if (type == 2) {
+ probe->type = LIGHTPROBE_TYPE_PLANAR;
+ probe->distinf = 0.3f;
+ probe->falloff = 0.6f;
+ }
else {
probe->type = LIGHTPROBE_TYPE_CUBE;
probe->attenuation_type = (type == 1) ? LIGHTPROBE_SHAPE_BOX : LIGHTPROBE_SHAPE_ELIPSOID;
diff --git a/source/blender/makesdna/DNA_lightprobe_types.h b/source/blender/makesdna/DNA_lightprobe_types.h
index 779528dd3d8..e65c36672b5 100644
--- a/source/blender/makesdna/DNA_lightprobe_types.h
+++ b/source/blender/makesdna/DNA_lightprobe_types.h
@@ -73,8 +73,7 @@ typedef struct LightProbe {
enum {
LIGHTPROBE_TYPE_CUBE = 0,
LIGHTPROBE_TYPE_PLANAR = 1,
- LIGHTPROBE_TYPE_IMAGE = 2,
- LIGHTPROBE_TYPE_GRID = 3,
+ LIGHTPROBE_TYPE_GRID = 2,
};
/* Probe->flag */
diff --git a/source/blender/makesrna/intern/rna_lightprobe.c b/source/blender/makesrna/intern/rna_lightprobe.c
index 93a57d0ea57..5daaf7c67d4 100644
--- a/source/blender/makesrna/intern/rna_lightprobe.c
+++ b/source/blender/makesrna/intern/rna_lightprobe.c
@@ -64,7 +64,7 @@ static EnumPropertyItem parallax_type_items[] = {
static EnumPropertyItem lightprobe_type_items[] = {
{LIGHTPROBE_TYPE_CUBE, "CUBEMAP", ICON_NONE, "Cubemap", "Capture reflections"},
- // {LIGHTPROBE_TYPE_PLANAR, "PLANAR", ICON_NONE, "Planar", ""},
+ {LIGHTPROBE_TYPE_PLANAR, "PLANAR", ICON_NONE, "Planar", ""},
// {LIGHTPROBE_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", ""},
{LIGHTPROBE_TYPE_GRID, "GRID", ICON_NONE, "Grid", "Volume used for precomputing indirect lighting"},
{0, NULL, 0, NULL, NULL}
More information about the Bf-blender-cvs
mailing list