[Bf-blender-cvs] [f2d7a28a098] blender2.8: Probes: Modify Add Menu and change defaults.

Clément Foucault noreply at git.blender.org
Thu Jun 15 01:16:31 CEST 2017


Commit: f2d7a28a0984bfebda21c07e9508313f0d92610c
Author: Clément Foucault
Date:   Thu Jun 15 00:53:11 2017 +0200
Branches: blender2.8
https://developer.blender.org/rBf2d7a28a0984bfebda21c07e9508313f0d92610c

Probes: Modify Add Menu and change defaults.

===================================================================

M	source/blender/blenkernel/intern/lightprobe.c
M	source/blender/editors/object/object_add.c

===================================================================

diff --git a/source/blender/blenkernel/intern/lightprobe.c b/source/blender/blenkernel/intern/lightprobe.c
index 97e1ff2733e..a1fa266512b 100644
--- a/source/blender/blenkernel/intern/lightprobe.c
+++ b/source/blender/blenkernel/intern/lightprobe.c
@@ -45,12 +45,14 @@ void BKE_lightprobe_init(LightProbe *probe)
 	BLI_assert(MEMCMP_STRUCT_OFS_IS_ZERO(probe, id));
 
 	probe->grid_resolution_x = probe->grid_resolution_y = probe->grid_resolution_z = 4;
-	probe->distinf = 5.0f;
-	probe->distpar = 5.0f;
+	probe->distinf = 2.5f;
+	probe->distpar = 2.5f;
 	probe->falloff = 0.2f;
-	probe->clipsta = 1.0f;
+	probe->clipsta = 0.8f;
 	probe->clipend = 40.0f;
 	probe->data_draw_size = 1.0f;
+
+	probe->flag = LIGHTPROBE_FLAG_SHOW_INFLUENCE | LIGHTPROBE_FLAG_SHOW_DATA;
 }
 
 void *BKE_lightprobe_add(Main *bmain, const char *name)
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 2649a6d6d69..33af8f94d04 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -152,11 +152,12 @@ static EnumPropertyItem field_type_items[] = {
 	{0, NULL, 0, NULL, NULL}
 };
 
-/* copy from rna_lightprobe.c */
 static EnumPropertyItem lightprobe_type_items[] = {
-	{LIGHTPROBE_TYPE_CUBE, "CUBE", ICON_MESH_UVSPHERE, "Sphere", ""},
+	{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", ""},
 	// {LIGHTPROBE_TYPE_IMAGE, "IMAGE", ICON_NONE, "Image", ""},
+	{2, "GRID", ICON_MESH_GRID, "Grid", "Irradiance probe to capture diffuse indirect lighting"},
 	{0, NULL, 0, NULL, NULL}
 };
 
@@ -534,7 +535,16 @@ static int lightprobe_add_exec(bContext *C, wmOperator *op)
 	BKE_object_obdata_size_init(ob, dia);
 
 	probe = (LightProbe *)ob->data;
-	probe->type = type;
+
+	if (type == 2) {
+		probe->type = LIGHTPROBE_TYPE_GRID;
+		probe->distinf = 0.3f;
+		probe->falloff = 1.0f;
+	}
+	else {
+		probe->type = LIGHTPROBE_TYPE_CUBE;
+		probe->attenuation_type = (type == 1) ? LIGHTPROBE_SHAPE_BOX : LIGHTPROBE_SHAPE_ELIPSOID;
+	}
 
 	DEG_relations_tag_update(CTX_data_main(C));




More information about the Bf-blender-cvs mailing list