Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/composite/nodes/node_composite_image.c
| Show First 20 Lines • Show All 426 Lines • ▼ Show 20 Lines | for (sock = node->outputs.first; sock; sock = sock->next) { | ||||
| MEM_freeN(sock->storage); | MEM_freeN(sock->storage); | ||||
| } | } | ||||
| MEM_freeN(node->storage); | MEM_freeN(node->storage); | ||||
| } | } | ||||
| static void node_composit_copy_image(bNodeTree *UNUSED(dest_ntree), | static void node_composit_copy_image(bNodeTree *UNUSED(dest_ntree), | ||||
| bNode *dest_node, | bNode *dest_node, | ||||
| bNode *src_node) | const bNode *src_node) | ||||
| { | { | ||||
| bNodeSocket *sock; | bNodeSocket *sock; | ||||
| dest_node->storage = MEM_dupallocN(src_node->storage); | dest_node->storage = MEM_dupallocN(src_node->storage); | ||||
| /* copy extra socket info */ | const bNodeSocket *src_output_sock = src_node->outputs.first; | ||||
| for (sock = src_node->outputs.first; sock; sock = sock->next) { | bNodeSocket *dest_output_sock = dest_node->outputs.first; | ||||
| sock->new_sock->storage = MEM_dupallocN(sock->storage); | while (dest_output_sock != NULL) { | ||||
| dest_output_sock->storage = MEM_dupallocN(src_output_sock->storage); | |||||
| src_output_sock = src_output_sock->next; | |||||
| dest_output_sock = dest_output_sock->next; | |||||
| } | } | ||||
| } | } | ||||
| void register_node_type_cmp_image(void) | void register_node_type_cmp_image(void) | ||||
| { | { | ||||
| static bNodeType ntype; | static bNodeType ntype; | ||||
| cmp_node_type_base(&ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW); | cmp_node_type_base(&ntype, CMP_NODE_IMAGE, "Image", NODE_CLASS_INPUT, NODE_PREVIEW); | ||||
| ▲ Show 20 Lines • Show All 99 Lines • ▼ Show 20 Lines | static void node_composit_free_rlayers(bNode *node) | ||||
| for (sock = node->outputs.first; sock; sock = sock->next) { | for (sock = node->outputs.first; sock; sock = sock->next) { | ||||
| if (sock->storage) { | if (sock->storage) { | ||||
| MEM_freeN(sock->storage); | MEM_freeN(sock->storage); | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static void node_composit_copy_rlayers(bNodeTree *UNUSED(dest_ntree), | static void node_composit_copy_rlayers(bNodeTree *UNUSED(dest_ntree), | ||||
| bNode *UNUSED(dest_node), | bNode *dest_node, | ||||
| bNode *src_node) | const bNode *src_node) | ||||
| { | { | ||||
| bNodeSocket *sock; | |||||
| /* copy extra socket info */ | /* copy extra socket info */ | ||||
| for (sock = src_node->outputs.first; sock; sock = sock->next) { | const bNodeSocket *src_output_sock = src_node->outputs.first; | ||||
| if (sock->storage) { | bNodeSocket *dest_output_sock = dest_node->outputs.first; | ||||
| sock->new_sock->storage = MEM_dupallocN(sock->storage); | while (dest_output_sock != NULL) { | ||||
| } | dest_output_sock->storage = MEM_dupallocN(src_output_sock->storage); | ||||
| src_output_sock = src_output_sock->next; | |||||
| dest_output_sock = dest_output_sock->next; | |||||
| } | } | ||||
| } | } | ||||
| static void cmp_node_rlayers_update(bNodeTree *ntree, bNode *node) | static void cmp_node_rlayers_update(bNodeTree *ntree, bNode *node) | ||||
| { | { | ||||
| cmp_node_image_verify_outputs(ntree, node, true); | cmp_node_image_verify_outputs(ntree, node, true); | ||||
| cmp_node_update_default(ntree, node); | cmp_node_update_default(ntree, node); | ||||
| Show All 17 Lines | |||||