diff options
author | Bastien Montagne <bastien@blender.org> | 2020-10-16 12:38:54 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2020-10-16 15:04:17 +0300 |
commit | 6430849366a513b5b46cbfaf9ced5f723d95d9d6 (patch) | |
tree | cb2f12a17ac46686e324c454472c8d73b63b233f /source/blender/blenloader/intern | |
parent | 4475c49e2f901ba034b086ca856848ee2071af34 (diff) |
Fix T81027: Multires objects in sculpt mode can't be linked via collections.
Just clear all non-object mode flags from linked objects at read time.
Reviewers: brecht
Subscribers:
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index c72788c01da..17d9a6d89f0 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3855,18 +3855,17 @@ static void direct_link_object(BlendDataReader *reader, Object *ob) * so for now play safe. */ ob->proxy_from = NULL; - /* loading saved files with editmode enabled works, but for undo we like - * to stay in object mode during undo presses so keep editmode disabled. - * - * Also when linking in a file don't allow edit and pose modes. - * See [T34776, T42780] for more information. - */ const bool is_undo = BLO_read_data_is_undo(reader); - if (is_undo || (ob->id.tag & (LIB_TAG_EXTERN | LIB_TAG_INDIRECT))) { + if (ob->id.tag & (LIB_TAG_EXTERN | LIB_TAG_INDIRECT)) { + /* Do not allow any non-object mode for linked data. + * See T34776, T42780, T81027 for more information. */ + ob->mode &= ~OB_MODE_ALL_MODE_DATA; + } + else if (is_undo) { + /* For undo we want to stay in object mode during undo presses, so keep some edit modes + * disabled. + * TODO: Check if we should not disable more edit modes here? */ ob->mode &= ~(OB_MODE_EDIT | OB_MODE_PARTICLE_EDIT); - if (!is_undo) { - ob->mode &= ~OB_MODE_POSE; - } } BLO_read_data_address(reader, &ob->adt); |