diff options
author | Jacques Lucke <jacques@blender.org> | 2020-04-09 12:12:16 +0300 |
---|---|---|
committer | Jacques Lucke <jacques@blender.org> | 2020-04-09 12:12:16 +0300 |
commit | 5c15a74d63ba8728d3df1c21abf3f3bd2d52a605 (patch) | |
tree | 969f56c61ad3cc26d6f79554fee9e37e940c2f05 /source/blender | |
parent | 7dfdb1a8a0cb21b80e50e227b5b12e4c9bfdf78d (diff) |
copy object/image pointer in node_socket_copy_default_value
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/nodes/intern/node_socket.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/nodes/intern/node_socket.c b/source/blender/nodes/intern/node_socket.c index af492c42d78..4433038acf9 100644 --- a/source/blender/nodes/intern/node_socket.c +++ b/source/blender/nodes/intern/node_socket.c @@ -30,6 +30,7 @@ #include "BLI_string.h" #include "BLI_utildefines.h" +#include "BKE_lib_id.h" #include "BKE_node.h" #include "RNA_access.h" @@ -334,15 +335,17 @@ void node_socket_copy_default_value(bNodeSocket *to, const bNodeSocket *from) break; } case SOCK_OBJECT: { - /* Not sure how to handle user count here yet. For now just don't copy the pointer. */ bNodeSocketValueObject *toval = to->default_value; - toval->value = NULL; + bNodeSocketValueObject *fromval = from->default_value; + *toval = *fromval; + id_us_plus(&toval->value->id); break; } case SOCK_IMAGE: { - /* Not sure how to handle user count here yet. For now just don't copy the pointer. */ bNodeSocketValueImage *toval = to->default_value; - toval->value = NULL; + bNodeSocketValueImage *fromval = from->default_value; + *toval = *fromval; + id_us_plus(&toval->value->id); break; } } |