Doversion: Set Clay when opening "Blender Render" engine scenes
authorDalai Felinto <dfelinto@gmail.com>
Wed, 19 Jul 2017 16:14:48 +0000 (18:14 +0200)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 19 Jul 2017 16:14:50 +0000 (18:14 +0200)
We get already enough reports of people complaining about crashes on
edit mode unaware that they are in the non-supported Blender Render
engine.

Blender Render is going away, no reason to keep it around. Once we have
a nice fallback on Eevee and fast file loading we can default to Eevee
instead.

source/blender/blenloader/CMakeLists.txt
source/blender/blenloader/intern/versioning_280.c

index 0a678cfe6f8ded76815b8005c7a1e05ba48a91dc..61d1aa18b3cb1e85220f049c1cead96b78f30871 100644 (file)
@@ -81,6 +81,10 @@ if(WITH_INTERNATIONAL)
        add_definitions(-DWITH_INTERNATIONAL)
 endif()
 
+if(WITH_CLAY_ENGINE)
+       add_definitions(-DWITH_CLAY_ENGINE)
+endif()
+
 if(WITH_CODEC_FFMPEG)
        add_definitions(-DWITH_FFMPEG)
 endif()
index d76a121376c5cdd033dd54a8cd0a60829083cece..1c7ecc9ce3b78df3961c66c94ee2cd4fdbaf1962 100644 (file)
@@ -345,7 +345,18 @@ static void do_version_layer_collections_idproperties(ListBase *lb)
 
 void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *main)
 {
+
        if (!MAIN_VERSION_ATLEAST(main, 280, 0)) {
+               for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
+                       if (STREQ(scene->r.engine, RE_engine_id_BLENDER_RENDER)) {
+#ifdef WITH_CLAY_ENGINE
+                               BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_CLAY, sizeof(scene->r.engine));
+#else
+                               BLI_strncpy(scene->r.engine, RE_engine_id_BLENDER_EEVEE, sizeof(scene->r.engine));
+#endif
+                       }
+               }
+
                if (!DNA_struct_elem_find(fd->filesdna, "Scene", "ListBase", "render_layers")) {
                        for (Scene *scene = main->scene.first; scene; scene = scene->id.next) {
                                /* Master Collection */