Fix for regression on bevel material: need do_version support for earlier files.
authorHoward Trickey <howard.trickey@gmail.com>
Thu, 2 Oct 2014 11:49:11 +0000 (07:49 -0400)
committerHoward Trickey <howard.trickey@gmail.com>
Thu, 2 Oct 2014 11:50:23 +0000 (07:50 -0400)
source/blender/blenloader/intern/versioning_270.c

index 67d51ab0493da1b84b22579c8925f2cd779b9281..b2a29e9d1cb31c45f45214ce4e98b269d3c22d5b 100644 (file)
@@ -350,6 +350,20 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                for (br = main->brush.first; br; br = br->id.next) {
                        br->fill_threshold = 0.2f;
                }
+
+               if (!DNA_struct_elem_find(fd->filesdna, "BevelModifierData", "int", "mat")) {
+                       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_Bevel) {
+                                               BevelModifierData *bmd = (BevelModifierData *)md;
+                                               bmd->mat = -1;
+                                       }
+                               }
+                       }
+               }
        }
 
        if (!MAIN_VERSION_ATLEAST(main, 271, 6)) {