diff options
author | Antonio Vazquez <blendergit@gmail.com> | 2020-02-06 13:27:01 +0300 |
---|---|---|
committer | Antonio Vazquez <blendergit@gmail.com> | 2020-02-06 13:30:59 +0300 |
commit | 342ceba5bf6e48ed0200bf13c3c65a5be6c6e1eb (patch) | |
tree | 66d13b1a1313e0288e2ab2cabd20c2a11295ed6d /source | |
parent | 10705807fe0672d9d42bee293aab6d73f1deb6b2 (diff) |
Fix T64058: GPencil - Ensure object mode if linking from a library
If the linked or append grease pencil object was added to the scene, the original file could have the datablock status in a different mode, so it's necessary to be sure is in object mode.
Differential Revision: https://developer.blender.org/D6759
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index f6cf68f7daf..4e571b20b15 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -7227,6 +7227,14 @@ static void direct_link_gpencil(FileData *fd, bGPdata *gpd) gpd->adt = newdataadr(fd, gpd->adt); direct_link_animdata(fd, gpd->adt); + /* If linking from a library ensure full objectmode. */ + if (gpd->id.lib != NULL) { + gpd->flag &= ~GP_DATA_STROKE_PAINTMODE; + gpd->flag &= ~GP_DATA_STROKE_EDITMODE; + gpd->flag &= ~GP_DATA_STROKE_SCULPTMODE; + gpd->flag &= ~GP_DATA_STROKE_WEIGHTMODE; + } + /* init stroke buffer */ gpd->runtime.sbuffer = NULL; gpd->runtime.sbuffer_used = 0; |