Fix [#21744] cannot open old file 1 1/2 year old with 2.49 and 2.5 v670
authorMatt Ebb <matt@mke3.net>
Fri, 26 Mar 2010 05:55:55 +0000 (05:55 +0000)
committerMatt Ebb <matt@mke3.net>
Fri, 26 Mar 2010 05:55:55 +0000 (05:55 +0000)
Works around a bizarre situation when an object is it's own parent.
Patch by Elia Sarti, thanks!

source/blender/blenloader/intern/readfile.c

index 58443a73b969e36b8bfbfd10f52bb5702ec3cbbf..19bb72a2d82793ffedde8d082a95075b1de8fd11 100644 (file)
@@ -9471,7 +9471,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                                /* check if top parent has compound shape set and if yes, set this object
                                   to compound shaper as well (was the behaviour before, now it's optional) */
                                Object *parent= newlibadr(fd, lib, ob->parent);
-                               while (parent && parent->parent != NULL) {
+                               while (parent && parent != ob &&  parent->parent != NULL) {
                                        parent = newlibadr(fd, lib, parent->parent);
                                }
                                if(parent) {