Fix the small mess in read versionning code (we had two "pending versioning" blocks...
authorBastien Montagne <montagne29@wanadoo.fr>
Thu, 7 Nov 2013 13:14:33 +0000 (13:14 +0000)
committerBastien Montagne <montagne29@wanadoo.fr>
Thu, 7 Nov 2013 13:14:33 +0000 (13:14 +0000)
Moved all non-yet-versioned stuff back into a single block at the end, let’s try not to forget to integrate it for 2.69.3! ;)

source/blender/blenloader/intern/readfile.c

index 48c61c7db6b2d8c06fa597f18553cbde302db71b..e4b06aeaece76c472468b043d0101cbe5e18ff8b 100644 (file)
@@ -9701,7 +9701,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
        }
-       
+
        if (!MAIN_VERSION_ATLEAST(main, 269, 1)) {
                /* Removal of Cycles SSS Compatible falloff */
                FOREACH_NODETREE(main, ntree, id) {
@@ -9718,10 +9718,38 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                } FOREACH_NODETREE_END
        }
 
+       if (!MAIN_VERSION_ATLEAST(main, 269, 2)) {
+               /* Initialize CDL settings for Color Balance nodes */
+               FOREACH_NODETREE(main, ntree, id) {
+                       if (ntree->type == NTREE_COMPOSIT) {
+                               bNode *node;
+                               for (node = ntree->nodes.first; node; node = node->next) {
+                                       if (node->type == CMP_NODE_COLORBALANCE) {
+                                               NodeColorBalance *n = node->storage;
+                                               if (node->custom1 == 0) {
+                                                       /* LGG mode stays the same, just init CDL settings */
+                                                       ntreeCompositColorBalanceSyncFromLGG(ntree, node);
+                                               }
+                                               else if (node->custom1 == 1) {
+                                                       /* CDL previously used same variables as LGG, copy them over
+                                                        * and then sync LGG for comparable results in both modes.
+                                                        */
+                                                       copy_v3_v3(n->offset, n->lift);
+                                                       copy_v3_v3(n->power, n->gamma);
+                                                       copy_v3_v3(n->slope, n->gain);
+                                                       ntreeCompositColorBalanceSyncFromCDL(ntree, node);
+                                               }
+                                       }
+                               }
+                       }
+               } FOREACH_NODETREE_END
+       }
+
        {
                bScreen *sc;
                ScrArea *sa;
                SpaceLink *sl;
+               Scene *scene;
 
                /* Update files using invalid (outdated) outlinevis Outliner values. */
                for (sc = main->screen.first; sc; sc = sc->id.next) {
@@ -9761,57 +9789,26 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                }
                        }
                }
-       }
 
-       if (!DNA_struct_elem_find(fd->filesdna, "TriangulateModifierData", "int", "quad_method")) {
-               Object *ob;
-               for (ob = main->object.first; ob; ob = ob->id.next) {
-                       ModifierData *md;
-                       for (md = ob->modifiers.first; md; md = md->next) {
-                               if (md->type == eModifierType_Triangulate) {
-                                       TriangulateModifierData *tmd = (TriangulateModifierData *)md;
-                                       if ((tmd->flag & MOD_TRIANGULATE_BEAUTY)) {
-                                               tmd->quad_method = MOD_TRIANGULATE_QUAD_BEAUTY;
-                                               tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
-                                       }
-                                       else {
-                                               tmd->quad_method = MOD_TRIANGULATE_QUAD_FIXED;
-                                               tmd->ngon_method = MOD_TRIANGULATE_NGON_SCANFILL;
-                                       }
-                               }
-                       }
-               }
-       }
-
-       if (!MAIN_VERSION_ATLEAST(main, 269, 2)) {
-               /* Initialize CDL settings for Color Balance nodes */
-               FOREACH_NODETREE(main, ntree, id) {
-                       if (ntree->type == NTREE_COMPOSIT) {
-                               bNode *node;
-                               for (node = ntree->nodes.first; node; node = node->next) {
-                                       if (node->type == CMP_NODE_COLORBALANCE) {
-                                               NodeColorBalance *n = node->storage;
-                                               if (node->custom1 == 0) {
-                                                       /* LGG mode stays the same, just init CDL settings */
-                                                       ntreeCompositColorBalanceSyncFromLGG(ntree, node);
+               if (!DNA_struct_elem_find(fd->filesdna, "TriangulateModifierData", "int", "quad_method")) {
+                       Object *ob;
+                       for (ob = main->object.first; ob; ob = ob->id.next) {
+                               ModifierData *md;
+                               for (md = ob->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_Triangulate) {
+                                               TriangulateModifierData *tmd = (TriangulateModifierData *)md;
+                                               if ((tmd->flag & MOD_TRIANGULATE_BEAUTY)) {
+                                                       tmd->quad_method = MOD_TRIANGULATE_QUAD_BEAUTY;
+                                                       tmd->ngon_method = MOD_TRIANGULATE_NGON_BEAUTY;
                                                }
-                                               else if (node->custom1 == 1) {
-                                                       /* CDL previously used same variables as LGG, copy them over
-                                                        * and then sync LGG for comparable results in both modes.
-                                                        */
-                                                       copy_v3_v3(n->offset, n->lift);
-                                                       copy_v3_v3(n->power, n->gamma);
-                                                       copy_v3_v3(n->slope, n->gain);
-                                                       ntreeCompositColorBalanceSyncFromCDL(ntree, node);
+                                               else {
+                                                       tmd->quad_method = MOD_TRIANGULATE_QUAD_FIXED;
+                                                       tmd->ngon_method = MOD_TRIANGULATE_NGON_SCANFILL;
                                                }
                                        }
                                }
                        }
-               } FOREACH_NODETREE_END
-       }
-
-       {
-               Scene *scene;
+               }
 
                for (scene = main->scene.first; scene; scene = scene->id.next) {
                        if (scene->gm.matmode == GAME_MAT_TEXFACE) {