BGE: TrackTo actuator: increasing up & track axis options
[blender.git] / source / blender / blenloader / intern / versioning_270.c
index 7fa9b4eeee011cd78ccc9b96fc92d9d29f3e4a5a..dde16c8d44f711e866e849f4a2f20445b67d446c 100644 (file)
@@ -42,6 +42,7 @@
 #include "DNA_mesh_types.h"
 #include "DNA_modifier_types.h"
 #include "DNA_linestyle_types.h"
+#include "DNA_actuator_types.h"
 
 #include "DNA_genfile.h"
 
@@ -300,7 +301,7 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
        }
 
        if (!MAIN_VERSION_ATLEAST(main, 271, 1)) {
-               if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "line[4]")) {
+               if (!DNA_struct_elem_find(fd->filesdna, "Material", "float", "line_col[4]")) {
                        Material *mat;
 
                        for (mat = main->mat.first; mat; mat = mat->id.next) {
@@ -308,6 +309,35 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
                                mat->line_col[3] = mat->alpha;
                        }
                }
+       }
+
+       if (!MAIN_VERSION_ATLEAST(main, 271, 2)) {
+               /* init up & track axis property of trackto actuators */
+               Object *ob;
+
+               for (ob = main->object.first; ob; ob = ob->id.next) {
+                       bActuator *act;
+                       for (act = ob->actuators.first; act; act = act->next) {
+                               if (act->type == ACT_EDIT_OBJECT) {
+                                       bEditObjectActuator *eoact = act->data;
+                                       eoact->trackflag = ob->trackflag;
+                                       /* if trackflag is pointing +-Z axis then upflag should point Y axis.
+                                        * Rest of trackflag cases, upflag should be point z axis */
+                                       if ((ob->trackflag == OB_POSZ) || (ob->trackflag == OB_NEGZ)) {
+                                               eoact->upflag = 1;
+                                       }
+                                       else {
+                                               eoact->upflag = 2;
+                                       }
+                               }
+                       }
+               }
+       }
 
+       if (!DNA_struct_elem_find(fd->filesdna, "RenderData", "int", "preview_start_resolution")) {
+               Scene *scene;
+               for (scene = main->scene.first; scene; scene = scene->id.next) {
+                       scene->r.preview_start_resolution = 64;
+               }
        }
 }