Fix: incorrect versioning code for lights properties
Due to T64791 we must still use the old Lamp name rather than Light, work around that for now.
This commit is contained in:
parent
b30cc7071b
commit
c859e1afa0
|
@ -1814,7 +1814,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 280, 1)) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "bleedexp")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "bleedexp")) {
|
||||
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
||||
la->bleedexp = 2.5f;
|
||||
}
|
||||
|
@ -1840,7 +1840,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 280, 2)) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "cascade_max_dist")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "cascade_max_dist")) {
|
||||
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
||||
la->cascade_max_dist = 1000.0f;
|
||||
la->cascade_count = 4;
|
||||
|
@ -1849,7 +1849,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "contact_dist")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "contact_dist")) {
|
||||
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
||||
la->contact_dist = 0.2f;
|
||||
la->contact_bias = 0.03f;
|
||||
|
@ -2185,7 +2185,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 280, 13)) {
|
||||
/* Initialize specular factor. */
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "spec_fac")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "spec_fac")) {
|
||||
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
||||
la->spec_fac = 1.0f;
|
||||
}
|
||||
|
@ -3135,7 +3135,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
}
|
||||
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "att_dist")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "att_dist")) {
|
||||
for (Light *la = bmain->lights.first; la; la = la->id.next) {
|
||||
la->att_dist = la->clipend;
|
||||
}
|
||||
|
@ -4051,7 +4051,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
|
||||
/* Initializes sun lights with the new angular diameter property */
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "sun_angle")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "sun_angle")) {
|
||||
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
|
||||
light->sun_angle = 2.0f * atanf(light->area_size);
|
||||
}
|
||||
|
|
|
@ -1908,7 +1908,7 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain)
|
|||
}
|
||||
|
||||
if (!MAIN_VERSION_ATLEAST(bmain, 293, 14)) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Light", "float", "diff_fac")) {
|
||||
if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "diff_fac")) {
|
||||
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
|
||||
light->diff_fac = 1.0f;
|
||||
light->volume_fac = 1.0f;
|
||||
|
|
Loading…
Reference in New Issue