[Bf-blender-cvs] [64543190331] blender2.8: Lamps: Make default size more usable

Clément Foucault noreply at git.blender.org
Sun Jun 24 15:02:35 CEST 2018


Commit: 645431903317c55eab051284c2fa085f57c1543a
Author: Clément Foucault
Date:   Sun Jun 24 15:02:52 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB645431903317c55eab051284c2fa085f57c1543a

Lamps: Make default size more usable

This way the area light shapes are more visible (and usable) by default.

Changes were discussed with @venomgfx

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

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

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

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;



More information about the Bf-blender-cvs mailing list