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
path: root/source
diff options
context:
space:
mode:
authorDalai Felinto <dfelinto@gmail.com>2017-08-16 13:14:31 +0300
committerDalai Felinto <dfelinto@gmail.com>2017-08-16 13:14:31 +0300
commit6bca0dcf7bd6c071f0b03234ac448d5e8e15fdc5 (patch)
tree0bddf7e0450c8dd599e7f0e2b3fc45367aeab809 /source
parent2b95617b152abab5ada310baca3e839df0546e07 (diff)
Fix T52415: Copy/Pasting a mesh immediately crashes blender
Since the paste object is pasted in the active collection, and not on its original one, we need to flush/calculate the new collection base settings (visibility, selectability, ...). DEG_id_tag_update() for the scene now. Though it may be better to tag only the object specific IDs in the future.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/intern/blender_copybuffer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/blender_copybuffer.c b/source/blender/blenkernel/intern/blender_copybuffer.c
index 206b0f2a8cc..2d37f3ab0cb 100644
--- a/source/blender/blenkernel/intern/blender_copybuffer.c
+++ b/source/blender/blenkernel/intern/blender_copybuffer.c
@@ -49,6 +49,7 @@
#include "BKE_main.h"
#include "BKE_scene.h"
+#include "DEG_depsgraph.h"
#include "DEG_depsgraph_build.h"
#include "BLO_readfile.h"
@@ -160,6 +161,10 @@ bool BKE_copybuffer_paste(bContext *C, const char *libname, const short flag, Re
/* recreate dependency graph to include new objects */
DEG_relations_tag_update(bmain);
+ /* Tag update the scene to flush base collection settings, since the new object is added to a
+ * new (active) collection, not its original collection, thus need recalculation. */
+ DEG_id_tag_update(&scene->id, 0);
+
BLO_blendhandle_close(bh);
/* remove library... */