From 83a001267aba8f2ef193ac1d3520b27374689249 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 16 Jun 2017 15:00:02 +0200 Subject: Probe: Add planar type. --- source/blender/editors/object/object_add.c | 11 ++++++++--- source/blender/makesdna/DNA_lightprobe_types.h | 3 +-- source/blender/makesrna/intern/rna_lightprobe.c | 2 +- 3 files changed, 10 insertions(+), 6 deletions(-) (limited to 'source') 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} -- cgit v1.2.3