Cleanup: Remove unused code in node editor

This commit is contained in:
Hans Goudey 2023-01-03 20:02:43 -05:00
parent 1d636f5e05
commit 03abc38624
Notes: blender-bot 2023-02-13 13:40:21 +01:00
Referenced by issue #103635, Metal backend shows everything in pink
1 changed files with 0 additions and 80 deletions

View File

@ -819,86 +819,6 @@ void ED_node_post_apply_transform(bContext * /*C*/, bNodeTree * /*ntree*/)
namespace blender::ed::space_node {
/* -------------------------------------------------------------------- */
/** \name Generic Operator Functions for Nodes
* \{ */
#if 0 /* UNUSED */
static bool edit_node_poll(bContext *C)
{
return ED_operator_node_active(C);
}
static void edit_node_properties(wmOperatorType *ot)
{
/* XXX could node be a context pointer? */
RNA_def_string(ot->srna, "node", nullptr, MAX_NAME, "Node", "");
RNA_def_int(ot->srna, "socket", 0, 0, MAX_SOCKET, "Socket", "", 0, MAX_SOCKET);
RNA_def_enum(ot->srna, "in_out", rna_enum_node_socket_in_out_items, SOCK_IN, "Socket Side", "");
}
static int edit_node_invoke_properties(bContext *C, wmOperator *op)
{
if (!RNA_struct_property_is_set(op->ptr, "node")) {
bNode *node = CTX_data_pointer_get_type(C, "node", &RNA_Node).data;
if (!node) {
return 0;
}
else {
RNA_string_set(op->ptr, "node", node->name);
}
}
if (!RNA_struct_property_is_set(op->ptr, "in_out")) {
RNA_enum_set(op->ptr, "in_out", SOCK_IN);
}
if (!RNA_struct_property_is_set(op->ptr, "socket")) {
RNA_int_set(op->ptr, "socket", 0);
}
return 1;
}
static void edit_node_properties_get(
wmOperator *op, bNodeTree *ntree, bNode **r_node, bNodeSocket **r_sock, int *r_in_out)
{
bNode *node;
bNodeSocket *sock = nullptr;
char nodename[MAX_NAME];
int sockindex;
int in_out;
RNA_string_get(op->ptr, "node", nodename);
node = nodeFindNodebyName(ntree, nodename);
in_out = RNA_enum_get(op->ptr, "in_out");
sockindex = RNA_int_get(op->ptr, "socket");
switch (in_out) {
case SOCK_IN:
sock = BLI_findlink(&node->inputs, sockindex);
break;
case SOCK_OUT:
sock = BLI_findlink(&node->outputs, sockindex);
break;
}
if (r_node) {
*r_node = node;
}
if (r_sock) {
*r_sock = sock;
}
if (r_in_out) {
*r_in_out = in_out;
}
}
#endif
/** \} */
/* -------------------------------------------------------------------- */
/** \name Node Generic
* \{ */