diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-06-24 16:02:52 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-06-24 16:03:10 +0300 |
commit | 645431903317c55eab051284c2fa085f57c1543a (patch) | |
tree | 6ddcc256add531b449bfe97c9ddb12f2440b26d3 | |
parent | a9bc880cf8c71693436d5f8b505c8069880a1635 (diff) |
Lamps: Make default size more usable
This way the area light shapes are more visible (and usable) by default.
Changes were discussed with @venomgfx
-rw-r--r-- | source/blender/blenkernel/intern/lamp.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 16 |
2 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/lamp.c b/source/blender/blenkernel/intern/lamp.c index 0e81e6570e2..1d5b6de22f4 100644 --- a/source/blender/blenkernel/intern/lamp.c +++ b/source/blender/blenkernel/intern/lamp.c @@ -72,7 +72,7 @@ void BKE_lamp_init(Lamp *la) la->samp = 3; la->bias = 1.0f; la->soft = 3.0f; - la->area_size = la->area_sizey = la->area_sizez = 0.1f; + la->area_size = la->area_sizey = la->area_sizez = 0.25f; la->buffers = 1; la->preview = NULL; la->falloff_type = LA_FALLOFF_INVSQUARE; diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index c70c61e3d38..336e1075911 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1013,7 +1013,21 @@ static int object_lamp_add_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; ob = ED_object_add_type(C, OB_LAMP, get_lamp_defname(type), loc, rot, false, layer); - BKE_object_obdata_size_init(ob, RNA_float_get(op->ptr, "radius")); + + float size = RNA_float_get(op->ptr, "radius"); + /* Better defaults for lamp size. */ + switch(type) { + case LA_LOCAL: + case LA_SPOT: + break; + case LA_AREA: + size *= 4.0f; + break; + default: + size *= 0.5f; + break; + } + BKE_object_obdata_size_init(ob, size); la = (Lamp *)ob->data; la->type = type; |