diff options
author | Joshua Leung <aligorith@gmail.com> | 2015-12-13 11:09:47 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2015-12-13 11:09:47 +0300 |
commit | fd5d4cfeff289764c42a9faf85a38690ae38f18e (patch) | |
tree | 8f37c92eebda36e90d4c7e76a922050493be7030 /source/blender/blenloader | |
parent | a1f87064c4c0cd9e8eafc19c599c4ad4ccdba49f (diff) |
GPencil: Bump subversion and ensure that the datablock-level onionskinning flag is set correctly
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 8a2045ddacf..8cf933207ab 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -936,9 +936,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } - { - Scene *scene; - for (scene = main->scene.first; scene; scene = scene->id.next) { + if (!MAIN_VERSION_ATLEAST(main, 276, 4)) { + for (Scene *scene = main->scene.first; scene; scene = scene->id.next) { ToolSettings *ts = scene->toolsettings; if (ts->gp_sculpt.brush[0].size == 0) { @@ -1012,5 +1011,23 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) ts->gpencil_ima_align = GP_PROJECT_VIEWSPACE; } } + + for (bGPdata *gpd = main->gpencil.first; gpd; gpd = gpd->id.next) { + bool enabled = false; + + /* Ensure that the datablock's onionskinning toggle flag + * stays in sync with the status of the actual layers + */ + for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) { + if (gpl->flag & GP_LAYER_ONIONSKIN) { + enabled = true; + } + } + + if (enabled) + gpd->flag |= GP_DATA_SHOW_ONIONSKINS; + else + gpd->flag &= ~GP_DATA_SHOW_ONIONSKINS; + } } } |