From 5ba1a6bee0426e77a01cec8c89999ee4d15ced63 Mon Sep 17 00:00:00 2001 From: Tim Stullich Date: Wed, 15 May 2019 14:45:33 +0200 Subject: Lights: change sun light size to be specified as angle MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is the angular diameter as seen from earth, which is between 0.526° and 0.545° in reality. Sharing the size with other light types did not make much sense and meant the unit was unclear. Differential Revision: https://developer.blender.org/D4819 --- source/blender/makesrna/intern/rna_light.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'source/blender/makesrna/intern/rna_light.c') diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c index da2b5752a0f..54c8049d4d2 100644 --- a/source/blender/makesrna/intern/rna_light.c +++ b/source/blender/makesrna/intern/rna_light.c @@ -545,12 +545,20 @@ static void rna_def_spot_light(BlenderRNA *brna) static void rna_def_sun_light(BlenderRNA *brna) { StructRNA *srna; + PropertyRNA *prop; srna = RNA_def_struct(brna, "SunLight", "Light"); RNA_def_struct_sdna(srna, "Light"); RNA_def_struct_ui_text(srna, "Sun Light", "Constant direction parallel ray Light"); RNA_def_struct_ui_icon(srna, ICON_LIGHT_SUN); + prop = RNA_def_property(srna, "angle", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "sun_angle"); + RNA_def_property_float_default(prop, DEG2RADF(0.526f)); + RNA_def_property_range(prop, DEG2RADF(0.0f), DEG2RADF(180.0f)); + RNA_def_property_ui_text(prop, "Angle", "Angular diameter of the Sun as seen from the Earth"); + RNA_def_property_update(prop, 0, "rna_Light_update"); + rna_def_light_energy(srna, true); rna_def_light_shadow(srna, true); } -- cgit v1.2.3