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
This commit is contained in:
parent
10705807fe
commit
342ceba5bf
Notes:
blender-bot
2023-02-14 08:06:33 +01:00
Referenced by issue #64058, Grease Pencil Object saved in editmode is not appended in objectmode correctly [cannot be moved and causes assert]
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue