diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2017-06-15 01:53:11 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2017-06-15 01:57:16 +0300 |
commit | f2d7a28a0984bfebda21c07e9508313f0d92610c (patch) | |
tree | 283f13417d15b852ec3d78660ebca6324b99bedc /source | |
parent | f5203e6cba27d8b0ed132fabe7c13866167000f0 (diff) |
Probes: Modify Add Menu and change defaults.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/lightprobe.c | 8 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 16 |
2 files changed, 18 insertions, 6 deletions
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)); |