Text3d: store number of characters and utf8 length separately
[blender.git] / source / blender / blenloader / intern / versioning_260.c
index 14eb8ff4ea658b95033e39fc21dd669a68170879..d8e3e02b196787bfbfacfc74057fe91ba2fb7e13 100644 (file)
@@ -485,7 +485,7 @@ static void do_versions_affine_tracker_track(MovieTrackingTrack *track)
 static const char *node_get_static_idname(int type, int treetype)
 {
        /* use static type info header to map static int type to identifier string */
-       #define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
+#define DefNode(Category, ID, DefFunc, EnumName, StructName, UIName, UIDesc) \
                case ID: return #Category #StructName;
 
        /* XXX hack, group types share a single static integer identifier, but are registered as separate types */
@@ -498,7 +498,7 @@ static const char *node_get_static_idname(int type, int treetype)
        }
        else {
                switch (type) {
-               #include "NOD_static_types.h"
+#include "NOD_static_types.h"
                }
        }
        return "";
@@ -2108,14 +2108,14 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
 
        if (!MAIN_VERSION_ATLEAST(main, 266, 6)) {
                Brush *brush;
-               #define BRUSH_TEXTURE_OVERLAY (1 << 21)
+#define BRUSH_TEXTURE_OVERLAY (1 << 21)
 
                for (brush = main->brush.first; brush; brush = brush->id.next) {
                        brush->overlay_flags = 0;
                        if (brush->flag & BRUSH_TEXTURE_OVERLAY)
                                brush->overlay_flags |= (BRUSH_OVERLAY_PRIMARY | BRUSH_OVERLAY_CURSOR);
                }
-               #undef BRUSH_TEXTURE_OVERLAY
+#undef BRUSH_TEXTURE_OVERLAY
        }
 
        if (main->versionfile < 267) {
@@ -2271,7 +2271,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
 
        if (!MAIN_VERSION_ATLEAST(main, 268, 2)) {
                Brush *brush;
-               #define BRUSH_FIXED (1 << 6)
+#define BRUSH_FIXED (1 << 6)
                for (brush = main->brush.first; brush; brush = brush->id.next) {
                        brush->flag &= ~BRUSH_FIXED;
 
@@ -2282,7 +2282,7 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                        if (brush->mask_overlay_alpha < 2)
                                brush->mask_overlay_alpha = 33;
                }
-               #undef BRUSH_FIXED
+#undef BRUSH_FIXED
        }
 
 
@@ -2530,7 +2530,88 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                }
        }
 
-       {
+       if (!MAIN_VERSION_ATLEAST(main, 269, 4)) {
+               /* Internal degrees to radians conversions... */
+               {
+                       Scene *scene;
+                       Object *ob;
+                       Lamp *lamp;
+
+                       for (lamp = main->lamp.first; lamp; lamp = lamp->id.next)
+                               lamp->spotsize = DEG2RADF(lamp->spotsize);
+
+                       for (ob = main->object.first; ob; ob = ob->id.next) {
+                               ModifierData *md;
+                               bSensor *bs;
+                               bActuator *ba;
+
+                               for (md = ob->modifiers.first; md; md = md->next) {
+                                       if (md->type == eModifierType_EdgeSplit) {
+                                               EdgeSplitModifierData *emd = (EdgeSplitModifierData *)md;
+                                               emd->split_angle = DEG2RADF(emd->split_angle);
+                                       }
+                                       else if (md->type == eModifierType_Bevel) {
+                                               BevelModifierData *bmd = (BevelModifierData *)md;
+                                               bmd->bevel_angle = DEG2RADF(bmd->bevel_angle);
+                                       }
+                               }
+
+                               for (bs = ob->sensors.first; bs; bs = bs->next) {
+                                       if (bs->type == SENS_RADAR) {
+                                               bRadarSensor *brs = bs->data;
+                                               brs->angle = DEG2RADF(brs->angle);
+                                       }
+                               }
+
+                               for (ba = ob->actuators.first; ba; ba = ba->next) {
+                                       if (ba->type == ACT_CONSTRAINT) {
+                                               bConstraintActuator *bca = ba->data;
+                                               if (bca->type == ACT_CONST_TYPE_ORI) {
+                                                       bca->minloc[0] = DEG2RADF(bca->minloc[0]);
+                                                       bca->maxloc[0] = DEG2RADF(bca->maxloc[0]);
+                                               }
+                                       }
+                                       else if (ba->type == ACT_SOUND) {
+                                               bSoundActuator *bsa = ba->data;
+                                               bsa->sound3D.cone_outer_angle = DEG2RADF(bsa->sound3D.cone_outer_angle);
+                                               bsa->sound3D.cone_inner_angle = DEG2RADF(bsa->sound3D.cone_inner_angle);
+                                       }
+                               }
+                       }
+
+                       for (scene = main->scene.first; scene; scene = scene->id.next) {
+                               Sequence *seq;
+                               SEQ_BEGIN (scene->ed, seq)
+                               {
+                                       if (seq->type == SEQ_TYPE_WIPE) {
+                                               WipeVars *wv = seq->effectdata;
+                                               wv->angle = DEG2RADF(wv->angle);
+                                       }
+                               }
+                               SEQ_END
+                       }
+
+                       FOREACH_NODETREE(main, ntree, id) {
+                               if (ntree->type == NTREE_COMPOSIT) {
+                                       bNode *node;
+                                       for (node = ntree->nodes.first; node; node = node->next) {
+                                               if (node->type == CMP_NODE_BOKEHIMAGE) {
+                                                       NodeBokehImage *n = node->storage;
+                                                       n->angle = DEG2RADF(n->angle);
+                                               }
+                                               if (node->type == CMP_NODE_MASK_BOX) {
+                                                       NodeBoxMask *n = node->storage;
+                                                       n->rotation = DEG2RADF(n->rotation);
+                                               }
+                                               if (node->type == CMP_NODE_MASK_ELLIPSE) {
+                                                       NodeEllipseMask *n = node->storage;
+                                                       n->rotation = DEG2RADF(n->rotation);
+                                               }
+                                       }
+                               }
+                       } FOREACH_NODETREE_END
+               }
+
                if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingPlaneTrack", "float", "image_opacity")) {
                        MovieClip *clip;
                        for (clip = main->movieclip.first; clip; clip = clip->id.next) {
@@ -2544,4 +2625,34 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *main)
                        }
                }
        }
+
+       if (!MAIN_VERSION_ATLEAST(main, 269, 7)) {
+               Scene *scene;
+               for (scene = main->scene.first; scene; scene = scene->id.next) {
+                       Sculpt *sd = scene->toolsettings->sculpt;
+
+                       if (sd) {
+                               int symmetry_flags = sd->flags & 7;
+
+                               if (symmetry_flags & SCULPT_SYMM_X)
+                                       sd->paint.symmetry_flags |= PAINT_SYMM_X;
+                               if (symmetry_flags & SCULPT_SYMM_Y)
+                                       sd->paint.symmetry_flags |= PAINT_SYMM_Y;
+                               if (symmetry_flags & SCULPT_SYMM_Z)
+                                       sd->paint.symmetry_flags |= PAINT_SYMM_Z;
+                               if (symmetry_flags & SCULPT_SYMMETRY_FEATHER)
+                                       sd->paint.symmetry_flags |= PAINT_SYMMETRY_FEATHER;
+                       }
+               }
+       }
+
+       if (!MAIN_VERSION_ATLEAST(main, 269, 8)) {
+               Curve *cu;
+
+               for (cu = main->curve.first; cu; cu = cu->id.next) {
+                       if (cu->str) {
+                               cu->len_wchar = BLI_strlen_utf8(cu->str);
+                       }
+               }
+       }
 }