diff options
author | Jeroen Bakker <j.bakker@atmind.nl> | 2019-05-16 18:03:16 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-05-16 18:40:13 +0300 |
commit | 9f6670ca375552c1382ac340ad184e2e1882c2aa (patch) | |
tree | f303417f32a784129398ffe6a8ab621a358165e1 /source/blender/blenloader | |
parent | 2ee762344f8742618804e869536e3efee6ab0bd0 (diff) |
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
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_cycles.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c index ace90350a21..3fc6d982e0f 100644 --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@ -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) |