Fix T76309: changing AOV type does not update compositor socket
authorBrecht Van Lommel <brecht@blender.org>
Fri, 1 May 2020 21:10:45 +0000 (23:10 +0200)
committerBrecht Van Lommel <brecht@blender.org>
Fri, 1 May 2020 21:10:45 +0000 (23:10 +0200)
source/blender/nodes/composite/nodes/node_composite_image.c

index 10de192277bdb3cab5447a43138d8e4c9e464732..382459993b78c9513a5a2f8b347f284e21c88512 100644 (file)
@@ -86,6 +86,12 @@ static void cmp_node_image_add_pass_output(bNodeTree *ntree,
 {
   bNodeSocket *sock = BLI_findstring(&node->outputs, name, offsetof(bNodeSocket, name));
 
+  /* Replace if types don't match. */
+  if (sock && sock->type != type) {
+    nodeRemoveSocket(ntree, node, sock);
+    sock = NULL;
+  }
+
   /* Create socket if it doesn't exist yet. */
   if (sock == NULL) {
     if (rres_index >= 0) {