2020-04-20 15:27:12 +02:00
|
|
|
/*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
*/
|
|
|
|
|
|
2020-07-07 18:23:33 +02:00
|
|
|
#include "node_function_util.hh"
|
2020-04-20 15:27:12 +02:00
|
|
|
#include "node_util.h"
|
|
|
|
|
|
2021-12-15 09:51:57 -06:00
|
|
|
#include "NOD_socket_search_link.hh"
|
|
|
|
|
|
2021-04-12 18:43:23 +02:00
|
|
|
static bool fn_node_poll_default(bNodeType *UNUSED(ntype),
|
|
|
|
|
bNodeTree *ntree,
|
|
|
|
|
const char **r_disabled_hint)
|
2020-04-20 15:27:12 +02:00
|
|
|
{
|
|
|
|
|
/* Function nodes are only supported in simulation node trees so far. */
|
2021-04-12 18:43:23 +02:00
|
|
|
if (!STREQ(ntree->idname, "GeometryNodeTree")) {
|
2021-12-01 21:55:04 -05:00
|
|
|
*r_disabled_hint = TIP_("Not a geometry node tree");
|
2021-04-12 18:43:23 +02:00
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
return true;
|
2020-04-20 15:27:12 +02:00
|
|
|
}
|
|
|
|
|
|
2022-01-03 19:32:33 -05:00
|
|
|
void fn_node_type_base(bNodeType *ntype, int type, const char *name, short nclass)
|
2020-04-20 15:27:12 +02:00
|
|
|
{
|
2022-01-03 19:32:33 -05:00
|
|
|
node_type_base(ntype, type, name, nclass);
|
2020-04-20 15:27:12 +02:00
|
|
|
ntype->poll = fn_node_poll_default;
|
2020-12-02 16:31:06 +01:00
|
|
|
ntype->insert_link = node_insert_link_default;
|
2021-12-15 09:51:57 -06:00
|
|
|
ntype->gather_link_search_ops = blender::nodes::search_link_ops_for_basic_node;
|
2020-04-20 15:27:12 +02:00
|
|
|
}
|