Commit: 02b1a209be88dc58cb635b79f4d4b300a86733e9
Author: Aras Pranckevicius
Date:   Tue Aug 2 09:28:17 2022 +0300
Branches: blender-v3.3-release
https://developer.blender.org/rB02b1a209be88dc58cb635b79f4d4b300a86733e9

Fix T100118: Crash after Shift+D with nothing selected and then making new 
object

Regression from rB2d041fc46823, the "nothing to do, return" code path
was not re-enabling layer collection sync. Fixes T100118.

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

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

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

diff --git a/source/blender/editors/object/object_add.cc 
b/source/blender/editors/object/object_add.cc
index e9abf8c1441..55366348f38 100644
--- a/source/blender/editors/object/object_add.cc
+++ b/source/blender/editors/object/object_add.cc
@@ -3715,13 +3715,13 @@ static int duplicate_exec(bContext *C, wmOperator *op)
     }
   }
   CTX_DATA_END;
+  /* Sync the collection now, after everything is duplicated. */
+  BKE_layer_collection_resync_allow();
+  BKE_main_collection_sync(bmain);
 
   if (source_bases_new_objects.is_empty()) {
     return OPERATOR_CANCELLED;
   }
-  /* Sync the collection now, after everything is duplicated. */
-  BKE_layer_collection_resync_allow();
-  BKE_main_collection_sync(bmain);
 
   /* After sync we can get to the new Base data, process it here. */
   for (const auto &item : source_bases_new_objects) {

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
List details, subscription details or unsubscribe:
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to