Cycles/Eeeve: unify film transparent setting

For existing files, it will use the setting from Cycles or Eevee depending on
the render engine in the scene.

Differential Revision: https://developer.blender.org/D4874
This commit is contained in:
2019-05-16 17:03:16 +02:00
committed by Brecht Van Lommel
parent 2ee762344f
commit 9f6670ca37
10 changed files with 30 additions and 48 deletions

View File

@@ -396,6 +396,20 @@ void blo_do_versions_cycles(FileData *UNUSED(fd), Library *UNUSED(lib), Main *bm
}
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 280, 68)) {
/* Unify Cycles and EEVEE Film Transparency. */
for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
if (STREQ(scene->r.engine, RE_engine_id_CYCLES)) {
IDProperty *cscene = cycles_properties_from_ID(&scene->id);
if (cscene) {
bool cycles_film_transparency = cycles_property_boolean(
cscene, "film_transparent", false);
scene->r.alphamode = cycles_film_transparency ? R_ALPHAPREMUL : R_ADDSKY;
}
}
}
}
}
void do_versions_after_linking_cycles(Main *bmain)