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
This commit is contained in:
Tim Stullich
2019-05-15 14:45:33 +02:00
committed by Brecht Van Lommel
parent 2497ee31ec
commit 5ba1a6bee0
12 changed files with 52 additions and 11 deletions

View File

@@ -3418,5 +3418,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
LISTBASE_FOREACH (bArmature *, arm, &bmain->armatures) {
arm->flag &= ~(ARM_FLAG_UNUSED_7 | ARM_FLAG_UNUSED_9);
}
/* Initializes sun lights with the new angular diameter property */
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "sun_angle")) {
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
light->sun_angle = 2.0f * atanf(light->area_size);
}
}
}
}