Fix T62670: insert_link() method not working for ShaderNodeCustomGroup.

Allow Python to override this method.

Differential Revision: https://developer.blender.org/D4537
This commit is contained in:
Miguel Porces 2019-03-18 11:16:34 +01:00 committed by Brecht Van Lommel
parent d0e28721b0
commit 1b06e3378a
Notes: blender-bot 2023-02-14 05:01:20 +01:00
Referenced by issue #62670, ShaderNodeCustomGroup insert_link is not listening to inserts
2 changed files with 21 additions and 4 deletions

View File

@ -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;
}
}

View File

@ -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);
}