diff options
author | Miguel Porces <cmporces> | 2019-03-18 13:16:34 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-03-18 13:37:31 +0300 |
commit | 1b06e3378a750774cd7da76ab61f86476f7087cc (patch) | |
tree | 662b6243a21a82b28e4df30bdf995db3055c9f1b /source/blender/nodes/shader | |
parent | d0e28721b04a0235d4f6bfbe42f43672ff923444 (diff) |
Fix T62670: insert_link() method not working for ShaderNodeCustomGroup.
Allow Python to override this method.
Differential Revision: https://developer.blender.org/D4537
Diffstat (limited to 'source/blender/nodes/shader')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_common.c | 13 |
1 files changed, 11 insertions, 2 deletions
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); } |