Cleanup: remove unexposed nodes

Those nodes are leftovers from my work on particle nodes and are not needed currently.
They can be added back easily if they become necessary.
This commit is contained in:
Jacques Lucke 2021-03-22 12:23:25 +01:00
parent 77887f95cc
commit c4c195672d
11 changed files with 0 additions and 320 deletions

View File

@ -562,8 +562,6 @@ geometry_node_categories = [
NodeItem("NodeFrame"),
NodeItem("NodeReroute"),
]),
# NodeItem("FunctionNodeCombineStrings"),
# NodeItem("FunctionNodeGroupInstanceID"),
]

View File

@ -1402,11 +1402,7 @@ int ntreeTexExecTree(struct bNodeTree *ntree,
* \{ */
#define FN_NODE_BOOLEAN_MATH 1200
#define FN_NODE_SWITCH 1201
#define FN_NODE_FLOAT_COMPARE 1202
#define FN_NODE_GROUP_INSTANCE_ID 1203
#define FN_NODE_COMBINE_STRINGS 1204
#define FN_NODE_OBJECT_TRANSFORMS 1205
#define FN_NODE_RANDOM_FLOAT 1206
#define FN_NODE_INPUT_VECTOR 1207
#define FN_NODE_INPUT_STRING 1208

View File

@ -4947,14 +4947,10 @@ static void registerGeometryNodes()
static void registerFunctionNodes()
{
register_node_type_fn_boolean_math();
register_node_type_fn_combine_strings();
register_node_type_fn_float_compare();
register_node_type_fn_group_instance_id();
register_node_type_fn_input_string();
register_node_type_fn_input_vector();
register_node_type_fn_object_transforms();
register_node_type_fn_random_float();
register_node_type_fn_switch();
}
void BKE_node_system_init(void)

View File

@ -91,20 +91,6 @@ static const EnumPropertyItem node_socket_type_items[] = {
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem node_socket_data_type_items[] = {
{SOCK_FLOAT, "FLOAT", 0, "Float", ""},
{SOCK_INT, "INT", 0, "Int", ""},
{SOCK_BOOLEAN, "BOOLEAN", 0, "Boolean", ""},
{SOCK_VECTOR, "VECTOR", 0, "Vector", ""},
{SOCK_STRING, "STRING", 0, "String", ""},
{SOCK_RGBA, "RGBA", 0, "Color", ""},
{SOCK_OBJECT, "OBJECT", 0, "Object", ""},
{SOCK_IMAGE, "IMAGE", 0, "Image", ""},
{SOCK_GEOMETRY, "GEOMETRY", 0, "Geometry", ""},
{SOCK_COLLECTION, "COLLECTION", 0, "Collection", ""},
{0, NULL, 0, NULL, NULL},
};
static const EnumPropertyItem node_quality_items[] = {
{NTREE_QUALITY_HIGH, "HIGH", 0, "High", "High quality"},
{NTREE_QUALITY_MEDIUM, "MEDIUM", 0, "Medium", "Medium quality"},
@ -4601,17 +4587,6 @@ static void def_float_compare(StructRNA *srna)
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
static void def_fn_switch(StructRNA *srna)
{
PropertyRNA *prop;
prop = RNA_def_property(srna, "data_type", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, node_socket_data_type_items);
RNA_def_property_ui_text(prop, "Data Type", "Data type for inputs and outputs");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_socket_update");
}
static void def_vector_math(StructRNA *srna)
{
PropertyRNA *prop;

View File

@ -132,14 +132,10 @@ set(SRC
composite/node_composite_util.c
function/nodes/node_fn_boolean_math.cc
function/nodes/node_fn_combine_strings.cc
function/nodes/node_fn_float_compare.cc
function/nodes/node_fn_group_instance_id.cc
function/nodes/node_fn_input_string.cc
function/nodes/node_fn_input_vector.cc
function/nodes/node_fn_object_transforms.cc
function/nodes/node_fn_random_float.cc
function/nodes/node_fn_switch.cc
function/node_function_util.cc
geometry/nodes/node_geo_align_rotation_to_vector.cc

View File

@ -21,14 +21,10 @@ extern "C" {
#endif
void register_node_type_fn_boolean_math(void);
void register_node_type_fn_combine_strings(void);
void register_node_type_fn_float_compare(void);
void register_node_type_fn_group_instance_id(void);
void register_node_type_fn_input_string(void);
void register_node_type_fn_input_vector(void);
void register_node_type_fn_object_transforms(void);
void register_node_type_fn_random_float(void);
void register_node_type_fn_switch(void);
#ifdef __cplusplus
}

View File

@ -262,10 +262,6 @@ DefNode(TextureNode, TEX_NODE_PROC+TEX_DISTNOISE, 0, "TEX_DI
DefNode(FunctionNode, FN_NODE_BOOLEAN_MATH, def_boolean_math, "BOOLEAN_MATH", BooleanMath, "Boolean Math", "")
DefNode(FunctionNode, FN_NODE_FLOAT_COMPARE, def_float_compare, "FLOAT_COMPARE", FloatCompare, "Float Compare", "")
DefNode(FunctionNode, FN_NODE_SWITCH, def_fn_switch, "SWITCH", Switch, "Switch", "")
DefNode(FunctionNode, FN_NODE_GROUP_INSTANCE_ID, 0, "GROUP_INSTANCE_ID", GroupInstanceID, "Group Instance ID", "")
DefNode(FunctionNode, FN_NODE_COMBINE_STRINGS, 0, "COMBINE_STRINGS", CombineStrings, "Combine Strings", "")
DefNode(FunctionNode, FN_NODE_OBJECT_TRANSFORMS, 0, "OBJECT_TRANSFORMS", ObjectTransforms, "Object Transforms", "")
DefNode(FunctionNode, FN_NODE_RANDOM_FLOAT, 0, "RANDOM_FLOAT", RandomFloat, "Random Float", "")
DefNode(FunctionNode, FN_NODE_INPUT_VECTOR, def_fn_input_vector, "INPUT_VECTOR", InputVector, "Vector", "")
DefNode(FunctionNode, FN_NODE_INPUT_STRING, def_fn_input_string, "INPUT_STRING", InputString, "String", "")

View File

@ -1,46 +0,0 @@
/*
* 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.
*/
#include "node_function_util.hh"
static bNodeSocketTemplate fn_node_combine_strings_in[] = {
{SOCK_STRING, N_("A")},
{SOCK_STRING, N_("B")},
{-1, ""},
};
static bNodeSocketTemplate fn_node_combine_strings_out[] = {
{SOCK_STRING, N_("Result")},
{-1, ""},
};
static void fn_node_combine_strings_expand_in_mf_network(
blender::nodes::NodeMFNetworkBuilder &builder)
{
static blender::fn::CustomMF_SI_SI_SO<std::string, std::string, std::string> combine_fn{
"Combine Strings", [](const std::string &a, const std::string &b) { return a + b; }};
builder.set_matching_fn(combine_fn);
}
void register_node_type_fn_combine_strings()
{
static bNodeType ntype;
fn_node_type_base(&ntype, FN_NODE_COMBINE_STRINGS, "Combine Strings", 0, 0);
node_type_socket_templates(&ntype, fn_node_combine_strings_in, fn_node_combine_strings_out);
ntype.expand_in_mf_network = fn_node_combine_strings_expand_in_mf_network;
nodeRegisterType(&ntype);
}

View File

@ -1,46 +0,0 @@
/*
* 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.
*/
#include "node_function_util.hh"
static bNodeSocketTemplate fn_node_group_instance_id_out[] = {
{SOCK_STRING, N_("Identifier")},
{-1, ""},
};
static void fn_node_group_instance_id_expand_in_mf_network(
blender::nodes::NodeMFNetworkBuilder &builder)
{
const blender::nodes::DNode &node = builder.dnode();
std::string id = "/";
for (const blender::nodes::DTreeContext *context = node.context();
context->parent_node() != nullptr;
context = context->parent_context()) {
id = "/" + context->parent_node()->name() + id;
}
builder.construct_and_set_matching_fn<blender::fn::CustomMF_Constant<std::string>>(
std::move(id));
}
void register_node_type_fn_group_instance_id()
{
static bNodeType ntype;
fn_node_type_base(&ntype, FN_NODE_GROUP_INSTANCE_ID, "Group Instance ID", 0, 0);
node_type_socket_templates(&ntype, nullptr, fn_node_group_instance_id_out);
ntype.expand_in_mf_network = fn_node_group_instance_id_expand_in_mf_network;
nodeRegisterType(&ntype);
}

View File

@ -1,95 +0,0 @@
/*
* 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.
*/
#include "node_function_util.hh"
#include "BKE_persistent_data_handle.hh"
static bNodeSocketTemplate fn_node_object_transforms_in[] = {
{SOCK_OBJECT, N_("Object")},
{-1, ""},
};
static bNodeSocketTemplate fn_node_object_transforms_out[] = {
{SOCK_VECTOR, N_("Location")},
{-1, ""},
};
class ObjectTransformsFunction : public blender::fn::MultiFunction {
public:
ObjectTransformsFunction()
{
static blender::fn::MFSignature signature = create_signature();
this->set_signature(&signature);
}
static blender::fn::MFSignature create_signature()
{
blender::fn::MFSignatureBuilder signature{"Object Transforms"};
signature.depends_on_context();
signature.single_input<blender::bke::PersistentObjectHandle>("Object");
signature.single_output<blender::float3>("Location");
return signature.build();
}
void call(blender::IndexMask mask,
blender::fn::MFParams params,
blender::fn::MFContext context) const override
{
const blender::VArray<blender::bke::PersistentObjectHandle> &handles =
params.readonly_single_input<blender::bke::PersistentObjectHandle>(0, "Object");
blender::MutableSpan locations = params.uninitialized_single_output<blender::float3>(
1, "Location");
const blender::bke::PersistentDataHandleMap *handle_map =
context.get_global_context<blender::bke::PersistentDataHandleMap>(
"PersistentDataHandleMap");
if (handle_map == nullptr) {
locations.fill_indices(mask, {0, 0, 0});
return;
}
for (int64_t i : mask) {
blender::bke::PersistentObjectHandle handle = handles[i];
const Object *object = handle_map->lookup(handle);
blender::float3 location;
if (object == nullptr) {
location = {0, 0, 0};
}
else {
location = object->loc;
}
locations[i] = location;
}
}
};
static void fn_node_object_transforms_expand_in_mf_network(
blender::nodes::NodeMFNetworkBuilder &builder)
{
static ObjectTransformsFunction fn;
builder.set_matching_fn(fn);
}
void register_node_type_fn_object_transforms()
{
static bNodeType ntype;
fn_node_type_base(&ntype, FN_NODE_OBJECT_TRANSFORMS, "Object Transforms", 0, 0);
node_type_socket_templates(&ntype, fn_node_object_transforms_in, fn_node_object_transforms_out);
ntype.expand_in_mf_network = fn_node_object_transforms_expand_in_mf_network;
nodeRegisterType(&ntype);
}

View File

@ -1,86 +0,0 @@
/*
* 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.
*/
#include "BLI_listbase.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "node_function_util.hh"
static void fn_node_switch_layout(uiLayout *layout, bContext *UNUSED(C), PointerRNA *ptr)
{
uiItemR(layout, ptr, "data_type", 0, "", ICON_NONE);
}
static bNodeSocketTemplate fn_node_switch_in[] = {
{SOCK_BOOLEAN, N_("Switch")},
{SOCK_FLOAT, N_("If False"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
{SOCK_INT, N_("If False"), 0, 0, 0, 0, -10000, 10000},
{SOCK_BOOLEAN, N_("If False")},
{SOCK_VECTOR, N_("If False"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
{SOCK_STRING, N_("If False")},
{SOCK_RGBA, N_("If False"), 0.8f, 0.8f, 0.8f, 1.0f},
{SOCK_OBJECT, N_("If False")},
{SOCK_IMAGE, N_("If False")},
{SOCK_FLOAT, N_("If True"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
{SOCK_INT, N_("If True"), 0, 0, 0, 0, -10000, 10000},
{SOCK_BOOLEAN, N_("If True")},
{SOCK_VECTOR, N_("If True"), 0.0f, 0.0f, 0.0f, 0.0f, -10000.0f, 10000.0f},
{SOCK_STRING, N_("If True")},
{SOCK_RGBA, N_("If True"), 0.8f, 0.8f, 0.8f, 1.0f},
{SOCK_OBJECT, N_("If True")},
{SOCK_IMAGE, N_("If True")},
{-1, ""},
};
static bNodeSocketTemplate fn_node_switch_out[] = {
{SOCK_FLOAT, N_("Result")},
{SOCK_INT, N_("Result")},
{SOCK_BOOLEAN, N_("Result")},
{SOCK_VECTOR, N_("Result")},
{SOCK_STRING, N_("Result")},
{SOCK_RGBA, N_("Result")},
{SOCK_OBJECT, N_("Result")},
{SOCK_IMAGE, N_("Result")},
{-1, ""},
};
static void fn_node_switch_update(bNodeTree *UNUSED(ntree), bNode *node)
{
int index = 0;
LISTBASE_FOREACH (bNodeSocket *, sock, &node->inputs) {
nodeSetSocketAvailability(sock, index == 0 || sock->type == node->custom1);
index++;
}
LISTBASE_FOREACH (bNodeSocket *, sock, &node->outputs) {
nodeSetSocketAvailability(sock, sock->type == node->custom1);
}
}
void register_node_type_fn_switch()
{
static bNodeType ntype;
fn_node_type_base(&ntype, FN_NODE_SWITCH, "Switch", 0, 0);
node_type_socket_templates(&ntype, fn_node_switch_in, fn_node_switch_out);
node_type_update(&ntype, fn_node_switch_update);
ntype.draw_buttons = fn_node_switch_layout;
nodeRegisterType(&ntype);
}