diff options
author | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-05-11 13:48:42 +0300 |
---|---|---|
committer | Kévin Dietrich <kevin.dietrich@mailoo.org> | 2016-05-11 13:48:42 +0300 |
commit | 75976a24d7dd7e8463d477de6dd30b9a1a0edb87 (patch) | |
tree | 3d3429267b51a9e74196e13f38f9009439750cdf /source/blender/blenloader | |
parent | e5b71e10179ed43bcae476a915a2bd399eeaea63 (diff) | |
parent | 67d2de882841f56c9cd35f0f0e7329b0c9190c97 (diff) |
Merge branch 'master' into openvdb
Conflicts:
intern/cycles/kernel/kernel_compat_cpu.h
intern/cycles/kernel/kernel_globals.h
intern/cycles/util/util_task.cpp
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 21 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 78 | ||||
-rw-r--r-- | source/blender/blenloader/intern/writefile.c | 2 |
3 files changed, 98 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 14f30ba2bb3..e2d3805831a 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -6163,6 +6163,11 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd) for (gps = gpf->strokes.first; gps; gps = gps->next) { gps->points = newdataadr(fd, gps->points); + + /* the triangulation is not saved, so need to be recalculated */ + gps->flag |= GP_STROKE_RECALC_CACHES; + gps->triangles = NULL; + gps->tot_triangles = 0; } } } @@ -7451,9 +7456,13 @@ static void direct_link_mask(FileData *fd, Mask *mask) MaskSpline *spline; MaskLayerShape *masklay_shape; + /* can't use newdataadr since it's a pointer within an array */ + MaskSplinePoint *act_point_search = NULL; + link_list(fd, &masklay->splines); for (spline = masklay->splines.first; spline; spline = spline->next) { + MaskSplinePoint *points_old = spline->points; int i; spline->points = newdataadr(fd, spline->points); @@ -7464,6 +7473,14 @@ static void direct_link_mask(FileData *fd, Mask *mask) if (point->tot_uw) point->uw = newdataadr(fd, point->uw); } + + /* detect active point */ + if ((act_point_search == NULL) && + (masklay->act_point >= points_old) && + (masklay->act_point < points_old + spline->tot_point)) + { + act_point_search = &spline->points[masklay->act_point - points_old]; + } } link_list(fd, &masklay->splines_shapes); @@ -7481,7 +7498,7 @@ static void direct_link_mask(FileData *fd, Mask *mask) } masklay->act_spline = newdataadr(fd, masklay->act_spline); - masklay->act_point = newdataadr(fd, masklay->act_point); + masklay->act_point = act_point_search; } } @@ -8210,7 +8227,7 @@ static void do_versions(FileData *fd, Library *lib, Main *main) /* WATCH IT!!!: pointers from libdata have not been converted yet here! */ /* WATCH IT 2!: Userdef struct init see do_versions_userdef() above! */ - /* don't forget to set version number in BKE_blender.h! */ + /* don't forget to set version number in BKE_blender_version.h! */ } #if 0 // XXX: disabled for now... we still don't have this in the right place in the loading code for it to work diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index b9191d545ed..efd167d49d5 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -137,6 +137,30 @@ static void do_version_constraints_stretch_to_limits(ListBase *lb) } } +static void do_version_action_editor_properties_region(ListBase *regionbase) +{ + ARegion *ar; + + for (ar = regionbase->first; ar; ar = ar->next) { + if (ar->regiontype == RGN_TYPE_UI) { + /* already exists */ + return; + } + else if (ar->regiontype == RGN_TYPE_WINDOW) { + /* add new region here */ + ARegion *arnew = MEM_callocN(sizeof(ARegion), "buttons for action"); + + BLI_insertlinkbefore(regionbase, ar, arnew); + + arnew->regiontype = RGN_TYPE_UI; + arnew->alignment = RGN_ALIGN_RIGHT; + arnew->flag = RGN_FLAG_HIDDEN; + + return; + } + } +} + void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) { if (!MAIN_VERSION_ATLEAST(main, 270, 0)) { @@ -1040,6 +1064,15 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } + /* init grease pencil smooth level iterations */ + for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) { + for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + if (gpl->draw_smoothlvl == 0) { + gpl->draw_smoothlvl = 1; + } + } + } + for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) { for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { @@ -1072,5 +1105,50 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { + CurvePaintSettings *cps = &scene->toolsettings->curve_paint_settings; + if (cps->error_threshold == 0) { + cps->curve_type = CU_BEZIER; + cps->flag |= CURVE_PAINT_FLAG_CORNERS_DETECT; + cps->error_threshold = 8; + cps->radius_max = 1.0f; + cps->corner_angle = DEG2RADF(70.0f); + } + } + + for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { + Sequence *seq; + + SEQ_BEGIN (scene->ed, seq) + { + if (seq->type == SEQ_TYPE_TEXT) { + TextVars *data = seq->effectdata; + if (data->color[3] == 0.0f) { + copy_v4_fl(data->color, 1.0f); + data->shadow_color[3] = 1.0f; + } + } + } + SEQ_END + } + + /* Adding "Properties" region to DopeSheet */ + for (bScreen *screen = main->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + /* handle pushed-back space data first */ + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_ACTION) { + SpaceAction *saction = (SpaceAction *)sl; + do_version_action_editor_properties_region(&saction->regionbase); + } + } + + /* active spacedata info must be handled too... */ + if (sa->spacetype == SPACE_ACTION) { + do_version_action_editor_properties_region(&sa->regionbase); + } + } + } } } diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c index 48d949bc929..92371cefb4c 100644 --- a/source/blender/blenloader/intern/writefile.c +++ b/source/blender/blenloader/intern/writefile.c @@ -145,7 +145,7 @@ #include "BLI_mempool.h" #include "BKE_action.h" -#include "BKE_blender.h" +#include "BKE_blender_version.h" #include "BKE_bpath.h" #include "BKE_curve.h" #include "BKE_constraint.h" |