diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-08-06 18:29:28 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-08-06 18:29:28 +0300 |
commit | 97c56b7628d100990bb49ee6749374b15001d46e (patch) | |
tree | 5100bb11d796dd10f255108c482f730ae8a1c9fd /source | |
parent | 5f51438185915a2f45dd2c0ddf2a0773c6c39ffd (diff) | |
parent | 96e460ed9b301b5a83399435bbf662a6258b243a (diff) |
Merge branch 'blender-v2.90-release'
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/versioning_290.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index 016b34278cf..12b5a297df5 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -30,6 +30,7 @@ #include "DNA_constraint_types.h" #include "DNA_genfile.h" #include "DNA_gpencil_modifier_types.h" +#include "DNA_gpencil_types.h" #include "DNA_modifier_types.h" #include "DNA_object_types.h" #include "DNA_screen_types.h" @@ -37,6 +38,7 @@ #include "BKE_collection.h" #include "BKE_colortools.h" +#include "BKE_gpencil.h" #include "BKE_lib_id.h" #include "BKE_main.h" #include "BKE_node.h" @@ -185,6 +187,23 @@ void do_versions_after_linking_290(Main *bmain, ReportList *UNUSED(reports)) } } } + + /* Patch first frame for old files. */ + Scene *scene = bmain->scenes.first; + LISTBASE_FOREACH (Object *, ob, &bmain->objects) { + if (ob->type != OB_GPENCIL) { + continue; + } + bGPdata *gpd = ob->data; + LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) { + bGPDframe *gpf = gpl->frames.first; + if (gpf && gpf->framenum > scene->r.sfra) { + bGPDframe *gpf_dup = BKE_gpencil_frame_duplicate(gpf); + gpf_dup->framenum = scene->r.sfra; + BLI_addhead(&gpl->frames, gpf_dup); + } + } + } } /** |