Fix #120103: crash pasting geonodes referencing an ID into new file #120576

Closed
Philipp Oeser wants to merge 2 commits from lichtwerk/blender:120103 into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.

2 Commits

Author SHA1 Message Date
Philipp Oeser f13c2f0d17 Move the existing library information to use the new struct 2024-04-12 17:32:52 +02:00
Philipp Oeser c649457573 Fix #120103: crash pasting geonodes referencing an ID into new file
The was already functionality for checking bNode.id when pasting
(reassigning IDs -- name-based -- when not in a new file), but we can
also have IDs referenced in sockets (e.g. SOCKET_OBJECT) and these were
not handled leading to crashes since the sockets were just duplicated.

Now also do what is done with bNode.id with IDs referenced in sockets.

NOTE: unsure if we should increment usercount here (but apparently
bNode.id also does not do it)
NOTE: there is a bit of duplicated code (but since assigning directly to
socket.default_value didnt update properly had to go through typed
socket values)
NOTE: introduces NodeClipboardItemIDInfo which could also be used for
the handling of bNode.id
2024-04-12 15:52:37 +02:00