BGE: TrackTo actuator: increasing up & track axis options
[blender.git] / source / blender / blenloader / intern / versioning_270.c
index b812cf13d3b6425cc291f67aa48acc535172014d..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"
 
@@ -298,4 +299,45 @@ 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_col[4]")) {
+                       Material *mat;
+
+                       for (mat = main->mat.first; mat; mat = mat->id.next) {
+                               mat->line_col[0] = mat->line_col[1] = mat->line_col[2] = 0.0f;
+                               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;
+               }
+       }
 }