bdk-blender/source/blender/windowmanager
Campbell Barton 64ead920a1 Fix #108495: Pasting a material crashes
References to data-blocks in a material were stored in-memory and could
crash if the data-blocks referenced by the material no longer existed
when pasting.

Resolve by using a blend-file for material copy/paste, matching how the
clipboard works in the 3D view-port.

Currently there is no support for including indirectly linked
data-blocks when pasting the material. Instead, data-blocks are restored
by name, by inspecting the current file.

This also fixes a crash where the `SpaceNode::nodetree` could point to
freed memory when pasting a material.

Ref !108496.

Includes contributions by @mont29.

---

Fix back-ported to main [0], including fix [1].

[0]: 5177e2f20b
[1]: 64aa96d421
2023-06-07 13:22:07 +10:00
..
gizmo Cleanup: don't use an inline function which is passed as an argument 2023-05-07 14:50:27 +10:00
intern Fix #108495: Pasting a material crashes 2023-06-07 13:22:07 +10:00
message_bus Cleanup: format (with BraceWrapping::AfterControlStatement "MultiLine") 2023-05-02 09:37:49 +10:00
xr Cleanup: use STRNCPY, SNPRINTF macros 2023-05-09 14:08:19 +10:00
CMakeLists.txt Remove "All Rights Reserved" from Blender Foundation copyright code 2023-03-30 10:51:59 +02:00
WM_api.h Fix saving a quit.blend on exit when a file failed to load 2023-05-31 12:35:22 +10:00
wm_cursors.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_draw.h Remove "All Rights Reserved" from Blender Foundation copyright code 2023-03-30 10:51:59 +02:00
wm_event_system.h Remove "All Rights Reserved" from Blender Foundation copyright code 2023-03-30 10:51:59 +02:00
wm_event_types.h Cleanup: use ".cc" & ".hh" extensions for intern/ghost 2023-04-06 08:29:57 +10:00
wm_files.h Remove "All Rights Reserved" from Blender Foundation copyright code 2023-03-30 10:51:59 +02:00
WM_keymap.h Cleanup: use of the term 'len' & 'maxlen' 2023-05-07 16:46:37 +10:00
WM_message.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
wm_surface.h File headers: SPDX License migration 2022-02-11 09:14:36 +11:00
WM_toolsystem.h Adding const Scene* parameter in many areas. 2022-09-14 21:30:56 +02:00
WM_types.h Suport relative path option per-asset library 2023-04-25 20:56:57 +02:00
wm_window.h Remove "All Rights Reserved" from Blender Foundation copyright code 2023-03-30 10:51:59 +02:00
wm.h Remove "All Rights Reserved" from Blender Foundation copyright code 2023-03-30 10:51:59 +02:00