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:
authorJulian Eisel <julian@blender.org>2021-06-08 17:36:42 +0300
committerBastien Montagne <bastien@blender.org>2021-11-01 11:43:30 +0300
commitd56d5bfafc16dfefcbcd62cbb9363e5d8483519c (patch)
tree8ee27d1c53d515c29915bcdf3b2d7b3602cacac5
parent0930a70e8110557641a98d5caf2e8892b4e2c345 (diff)
Fix T87703: Failed assert when dragging object data-block into 3D View
Talked with Bastien and we ended up looking into this. Issue is that the dupliation through drag & drop should also be considered a "sub-process", like Shift+D duplicating does. Added a comment explaining why this is needed.
-rw-r--r--source/blender/editors/object/object_add.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index ee6879b0168..df3968b2424 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -3448,7 +3448,17 @@ static int object_add_named_exec(bContext *C, wmOperator *op)
}
/* prepare dupli */
- basen = object_add_duplicate_internal(bmain, scene, view_layer, ob, dupflag, 0);
+ basen = object_add_duplicate_internal(
+ bmain,
+ scene,
+ view_layer,
+ ob,
+ dupflag,
+ /* Sub-process flag because the new-ID remapping (#BKE_libblock_relink_to_newid()) in this
+ * function will only work if the object is already linked in the view layer, which is not
+ * the case here. So we have to do the new-ID relinking ourselves (#copy_object_set_idnew()).
+ */
+ LIB_ID_DUPLICATE_IS_SUBPROCESS);
if (basen == NULL) {
BKE_report(op->reports, RPT_ERROR, "Object could not be duplicated");