[Bf-blender-cvs] [7124c663407] master: Fix T87703: Failed assert when dragging object data-block into 3D View

Julian Eisel noreply at git.blender.org
Tue Jun 8 16:46:24 CEST 2021


Commit: 7124c663407c4c0ccca167107799165c01950a1f
Author: Julian Eisel
Date:   Tue Jun 8 16:36:42 2021 +0200
Branches: master
https://developer.blender.org/rB7124c663407c4c0ccca167107799165c01950a1f

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.

===================================================================

M	source/blender/editors/object/object_add.c

===================================================================

diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index ef500be0133..12aaa9c2d9f 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -3483,7 +3483,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");



More information about the Bf-blender-cvs mailing list