forked from blender/blender
Fix #102103: Copy/Paste of nodes is not handling ID references properly. #3
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "tmp-node-copypaste"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This commit fixes several critical issues with previous code:
node (namely, just the
bNode::id
pointer).The new code stores ID reference info in a separate mapping. It uses the
new 'sub-data' foreach_id feature from
BKE_lib_query
to reliably andgenerically process all ID pointers of a node.
The paste handling of ID pointers is split in two steps:
and the result (current valid ID pointer or null if not found) is
stored temporarily in the ID references mapping.
destination nodetree, its ID pointers are updated accordingly.
This allows to keep the 'reference ID' data in the clipboard always
valid, regardless of which IDs are currently existing in Main (i.e. to
keep all available data, even when opening new blendfiles, or doing
undo/redo that would affect the existing IDs).
Pull request closed