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:
authorAntonioya <blendergit@gmail.com>2018-09-20 14:47:59 +0300
committerAntonioya <blendergit@gmail.com>2018-09-20 14:47:59 +0300
commitde994d6b7b1c8789ee2797b8138c2fb115370b9c (patch)
tree552789f8a352bdb1ec28dbf321849a2d232aeeda /source/blender/editors/util/ed_util.c
parent5bfcd6f303b458567870ab64fabf89713d679a78 (diff)
GP: Fix problem with mode opening 2D Animation template
The grease pencil does not need a toggle of mode. This fix also the problem when open grease pencil files that did not keep the mode saved.
Diffstat (limited to 'source/blender/editors/util/ed_util.c')
-rw-r--r--source/blender/editors/util/ed_util.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c
index 30c1606e3d8..10698b9ebab 100644
--- a/source/blender/editors/util/ed_util.c
+++ b/source/blender/editors/util/ed_util.c
@@ -115,11 +115,15 @@ void ED_editors_init(bContext *C)
/* pass */
}
else if (!BKE_object_has_mode_data(ob, mode)) {
- /* For multi-edit mode we may already have mode data. */
- ID *data = ob->data;
- ob->mode = OB_MODE_OBJECT;
- if ((ob == obact) && !ID_IS_LINKED(ob) && !(data && ID_IS_LINKED(data))) {
- ED_object_mode_toggle(C, mode);
+ /* For multi-edit mode we may already have mode data.
+ * (grease pencil does not need it)
+ */
+ if (ob->type != OB_GPENCIL) {
+ ID *data = ob->data;
+ ob->mode = OB_MODE_OBJECT;
+ if ((ob == obact) && !ID_IS_LINKED(ob) && !(data && ID_IS_LINKED(data))) {
+ ED_object_mode_toggle(C, mode);
+ }
}
}
}