BGE patch: local/global flag to distance contraint actuator.
[blender.git] / source / blender / blenloader / intern / readfile.c
index 66905c6f24025081030a7ec6c392f25f26bab399..85e45e87994daa790ec5b30cedd7da882b9ad523 100644 (file)
@@ -7883,6 +7883,23 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
        }
+       /* direction constraint actuators were always local in previous version */
+       if (main->versionfile < 247 || (main->versionfile == 247 && main->subversionfile < 7)) {
+               bActuator *act;
+               Object *ob;
+               
+               for(ob = main->object.first; ob; ob= ob->id.next) {
+                       for(act= ob->actuators.first; act; act= act->next) {
+                               if (act->type == ACT_CONSTRAINT) {
+                                       bConstraintActuator *coa = act->data;
+                                       if (coa->type == ACT_CONST_TYPE_DIST) {
+                                               coa->flag |= ACT_CONST_LOCAL;
+                                       }
+                               }
+                       }
+               }
+       }
+
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */