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.
This commit is contained in:
parent
2b95617b15
commit
6bca0dcf7b
Notes:
blender-bot
2023-02-14 08:42:53 +01:00
Referenced by issue #52415, Copy/Pasting a mesh immediately crashes blender
|
@ -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... */
|
||||
|
||||
|
|
Loading…
Reference in New Issue