diff options
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/composite/nodes/node_composite_common.c | 12 | ||||
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_common.c | 13 |
2 files changed, 21 insertions, 4 deletions
diff --git a/source/blender/nodes/composite/nodes/node_composite_common.c b/source/blender/nodes/composite/nodes/node_composite_common.c index f9a6961c47b..480b9f1e989 100644 --- a/source/blender/nodes/composite/nodes/node_composite_common.c +++ b/source/blender/nodes/composite/nodes/node_composite_common.c @@ -59,6 +59,14 @@ void register_node_type_cmp_group(void) void register_node_type_cmp_custom_group(bNodeType *ntype) { - ntype->insert_link = node_insert_link_default; - ntype->update_internal_links = node_update_internal_links_default; + /* These methods can be overriden but need a default implementation otherwise. */ + if (ntype->poll == NULL) { + ntype->poll = cmp_node_poll_default; + } + if (ntype->insert_link == NULL) { + ntype->insert_link = node_insert_link_default; + } + if (ntype->update_internal_links == NULL) { + ntype->update_internal_links = node_update_internal_links_default; + } } diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c index 0c2b8d939f5..8596c770c62 100644 --- a/source/blender/nodes/shader/nodes/node_shader_common.c +++ b/source/blender/nodes/shader/nodes/node_shader_common.c @@ -242,8 +242,17 @@ void register_node_type_sh_group(void) void register_node_type_sh_custom_group(bNodeType *ntype) { - ntype->insert_link = node_insert_link_default; - ntype->update_internal_links = node_update_internal_links_default; + /* These methods can be overriden but need a default implementation otherwise. */ + if (ntype->poll == NULL) { + ntype->poll = sh_node_poll_default; + } + if (ntype->insert_link == NULL) { + ntype->insert_link = node_insert_link_default; + } + if (ntype->update_internal_links == NULL) { + ntype->update_internal_links = node_update_internal_links_default; + } + node_type_exec(ntype, group_initexec, group_freeexec, group_execute); node_type_gpu(ntype, gpu_group_execute); } |