Fix for [26631] relative blur decimal value from 2.49 is not correctly converted...
authorLukas Toenne <lukas.toenne@googlemail.com>
Sun, 27 Mar 2011 13:49:56 +0000 (13:49 +0000)
committerLukas Toenne <lukas.toenne@googlemail.com>
Sun, 27 Mar 2011 13:49:56 +0000 (13:49 +0000)
This will not work for file saved between the blur node patch and subversion 2, those will still have to be update manually.

source/blender/blenloader/intern/readfile.c

index 647352ec7277c83a010a4dc0d1992543427083e6..b6c0688ee5aed82a8834e435734cf7d98a7bbe96 100644 (file)
@@ -11559,6 +11559,20 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        mesh_calc_normals(me->mvert, me->totvert, me->mface, me->totface, NULL);
        }
 
+       if (main->versionfile < 256 || (main->versionfile == 256 && main->subversionfile < 2)){
+               /* update blur area sizes from 0..1 range to 0..100 percentage */
+               Scene *scene;
+               bNode *node;
+               for (scene=main->scene.first; scene; scene=scene->id.next)
+                       if (scene->nodetree)
+                               for (node=scene->nodetree->nodes.first; node; node=node->next)
+                                       if (node->type==CMP_NODE_BLUR) {
+                                               NodeBlurData *nbd= node->storage;
+                                               nbd->percentx *= 100.0f;
+                                               nbd->percenty *= 100.0f;
+                                       }
+       }
+
        /* put compatibility code here until next subversion bump */
 
        {