Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTim Stullich <tstullich>2019-05-15 15:45:33 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-15 17:07:50 +0300
commit5ba1a6bee0426e77a01cec8c89999ee4d15ced63 (patch)
tree3f6fa2deef19c31f93c9d68d54814fa85bf5d52a /source/blender/makesrna/intern/rna_light.c
parent2497ee31ec89560a9b72a070a70735caa6655b9e (diff)
Lights: change sun light size to be specified as angle
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_light.c')
-rw-r--r--source/blender/makesrna/intern/rna_light.c8
1 files changed, 8 insertions, 0 deletions
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);
}