[Bf-blender-cvs] [6430849366a] master: Fix T81027: Multires objects in sculpt mode can't be linked via collections.
Bastien Montagne
noreply at git.blender.org
Fri Oct 16 14:04:36 CEST 2020
Commit: 6430849366a513b5b46cbfaf9ced5f723d95d9d6
Author: Bastien Montagne
Date: Fri Oct 16 11:38:54 2020 +0200
Branches: master
https://developer.blender.org/rB6430849366a513b5b46cbfaf9ced5f723d95d9d6
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:
===================================================================
M source/blender/blenloader/intern/readfile.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list