forked from bartvdbraak/blender
Node poll_instance callback is optional, check if it exists before executing.
This commit is contained in:
parent
66c7b54a88
commit
b2374f8de3
@ -662,7 +662,7 @@ static bool node_group_make_test_selected(bNodeTree *ntree, bNode *gnode, const
|
||||
/* check poll functions for selected nodes */
|
||||
for (node = ntree->nodes.first; node; node = node->next) {
|
||||
if (node_group_make_use_node(node, gnode)) {
|
||||
if (!node->typeinfo->poll_instance(node, ngroup)) {
|
||||
if (node->typeinfo->poll_instance && !node->typeinfo->poll_instance(node, ngroup)) {
|
||||
BKE_reportf(reports, RPT_WARNING, "Can not add node '%s' in a group", node->name);
|
||||
ok = false;
|
||||
break;
|
||||
|
@ -105,7 +105,7 @@ int nodeGroupPoll(bNodeTree *nodetree, bNodeTree *grouptree)
|
||||
return 0;
|
||||
|
||||
for (node=grouptree->nodes.first; node; node=node->next) {
|
||||
if (!node->typeinfo->poll_instance(node, nodetree)) {
|
||||
if (node->typeinfo->poll_instance && !node->typeinfo->poll_instance(node, nodetree)) {
|
||||
valid = 0;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user