[Bf-blender-cvs] [cfca5294cf9] cycles-x: Cycles X: keep around scene tile size in DNA for better forward compatibility

Brecht Van Lommel noreply at git.blender.org
Wed Sep 1 20:02:34 CEST 2021


Commit: cfca5294cf9bd76a45553663ab0d8ef61e7a1fac
Author: Brecht Van Lommel
Date:   Wed Sep 1 19:37:35 2021 +0200
Branches: cycles-x
https://developer.blender.org/rBcfca5294cf9bd76a45553663ab0d8ef61e7a1fac

Cycles X: keep around scene tile size in DNA for better forward compatibility

We can remove these at some point in the future, but for now it's annoying for
files saved in cycles-x to render with tile size 1x1.

===================================================================

M	source/blender/blenloader/intern/versioning_260.c
M	source/blender/makesdna/DNA_scene_defaults.h
M	source/blender/makesdna/DNA_scene_types.h

===================================================================

diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c
index b276d78605e..b71dd5a27bb 100644
--- a/source/blender/blenloader/intern/versioning_260.c
+++ b/source/blender/blenloader/intern/versioning_260.c
@@ -1743,6 +1743,17 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain)
   }
 
   if (!MAIN_VERSION_ATLEAST(bmain, 264, 7)) {
+    /* convert tiles size from resolution and number of tiles */
+    {
+      Scene *scene;
+
+      for (scene = bmain->scenes.first; scene; scene = scene->id.next) {
+        if (scene->r.tilex == 0 || scene->r.tiley == 1) {
+          scene->r.tilex = scene->r.tiley = 64;
+        }
+      }
+    }
+
     /* collision masks */
     {
       Object *ob;
diff --git a/source/blender/makesdna/DNA_scene_defaults.h b/source/blender/makesdna/DNA_scene_defaults.h
index 2b6718dec62..9ecf94ebd6e 100644
--- a/source/blender/makesdna/DNA_scene_defaults.h
+++ b/source/blender/makesdna/DNA_scene_defaults.h
@@ -78,6 +78,8 @@
     .ysch = 1080, \
     .xasp = 1, \
     .yasp = 1, \
+    .tilex = 256, \
+    .tiley = 256, \
     .size = 100, \
  \
     .im_format = _DNA_DEFAULT_ImageFormatData, \
diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h
index 3fa759542d6..4541a49f8ac 100644
--- a/source/blender/makesdna/DNA_scene_types.h
+++ b/source/blender/makesdna/DNA_scene_types.h
@@ -651,6 +651,12 @@ typedef struct RenderData {
    */
   int ysch;
 
+  /**
+   * render tile dimensions
+   */
+  int tilex DNA_DEPRECATED;
+  int tiley DNA_DEPRECATED;
+
   short planes DNA_DEPRECATED;
   short imtype DNA_DEPRECATED;
   short subimtype DNA_DEPRECATED;



More information about the Bf-blender-cvs mailing list