Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2020-02-06 13:27:01 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-02-06 13:30:59 +0300
commit342ceba5bf6e48ed0200bf13c3c65a5be6c6e1eb (patch)
tree66d13b1a1313e0288e2ab2cabd20c2a11295ed6d
parent10705807fe0672d9d42bee293aab6d73f1deb6b2 (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
-rw-r--r--source/blender/blenloader/intern/readfile.c8
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;