Nodes: Add "Legacy" to legacy node UI names, skip in search
Currently there is no way to tell that these node types are deprecated in the UI. This commit adds "(Legacy)" to the end of the names. It also makes it simple to skip these in the various node searches more automatically than before. Fixes T101700 Differential Revision: https://developer.blender.org/D16223
This commit is contained in:
parent
0d25169dc5
commit
a1bc05b200
Notes:
blender-bot
2023-02-14 08:06:35 +01:00
Referenced by issue #101700, Two Mix node in Geometry Node Editor when searched
|
@ -182,6 +182,9 @@ static void gather_add_node_operations(const bContext &C,
|
|||
/* Skip the empty group type. */
|
||||
continue;
|
||||
}
|
||||
if (StringRefNull(node_type->ui_name).endswith("(Legacy)")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
AddNodeItem item{};
|
||||
item.ui_name = IFACE_(node_type->ui_name);
|
||||
|
|
|
@ -274,7 +274,9 @@ static void gather_socket_link_operations(const bContext &C,
|
|||
if (!(node_type->poll && node_type->poll(node_type, &node_tree, &disabled_hint))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (StringRefNull(node_type->ui_name).endswith("(Legacy)")) {
|
||||
continue;
|
||||
}
|
||||
if (node_type->gather_link_search_ops) {
|
||||
nodes::GatherLinkSearchOpParams params{*node_type, node_tree, socket, search_link_ops};
|
||||
node_type->gather_link_search_ops(params);
|
||||
|
|
|
@ -415,7 +415,8 @@ void register_node_type_cmp_cryptomatte_legacy()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_CRYPTOMATTE_LEGACY, "Cryptomatte", NODE_CLASS_MATTE);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_CRYPTOMATTE_LEGACY, "Cryptomatte (Legacy)", NODE_CLASS_MATTE);
|
||||
node_type_socket_templates(&ntype, nullptr, file_ns::cmp_node_cryptomatte_out);
|
||||
node_type_init(&ntype, legacy_file_ns::node_init_cryptomatte_legacy);
|
||||
node_type_storage(
|
||||
|
|
|
@ -54,7 +54,8 @@ void register_node_type_cmp_sephsva()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_SEPHSVA_LEGACY, "Separate HSVA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_SEPHSVA_LEGACY, "Separate HSVA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_sephsva_declare;
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
|
@ -107,7 +108,8 @@ void register_node_type_cmp_combhsva()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_COMBHSVA_LEGACY, "Combine HSVA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_COMBHSVA_LEGACY, "Combine HSVA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_combhsva_declare;
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
|
|
|
@ -54,7 +54,8 @@ void register_node_type_cmp_seprgba()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_SEPRGBA_LEGACY, "Separate RGBA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_SEPRGBA_LEGACY, "Separate RGBA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_seprgba_declare;
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
|
@ -107,7 +108,8 @@ void register_node_type_cmp_combrgba()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_COMBRGBA_LEGACY, "Combine RGBA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_COMBRGBA_LEGACY, "Combine RGBA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_combrgba_declare;
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
|
|
|
@ -81,7 +81,8 @@ void register_node_type_cmp_sepycca()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_SEPYCCA_LEGACY, "Separate YCbCrA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_SEPYCCA_LEGACY, "Separate YCbCrA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_sepycca_declare;
|
||||
node_type_init(&ntype, file_ns::node_composit_init_mode_sepycca);
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
|
@ -168,7 +169,8 @@ void register_node_type_cmp_combycca()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_COMBYCCA_LEGACY, "Combine YCbCrA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_COMBYCCA_LEGACY, "Combine YCbCrA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_combycca_declare;
|
||||
node_type_init(&ntype, file_ns::node_composit_init_mode_combycca);
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
|
|
|
@ -54,7 +54,8 @@ void register_node_type_cmp_sepyuva()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_SEPYUVA_LEGACY, "Separate YUVA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_SEPYUVA_LEGACY, "Separate YUVA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_sepyuva_declare;
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
|
@ -107,7 +108,8 @@ void register_node_type_cmp_combyuva()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
cmp_node_type_base(&ntype, CMP_NODE_COMBYUVA_LEGACY, "Combine YUVA", NODE_CLASS_CONVERTER);
|
||||
cmp_node_type_base(
|
||||
&ntype, CMP_NODE_COMBYUVA_LEGACY, "Combine YUVA (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::cmp_node_combyuva_declare;
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
ntype.get_compositor_shader_node = file_ns::get_compositor_shader_node;
|
||||
|
|
|
@ -150,7 +150,7 @@ void register_node_type_sh_mix_rgb()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
sh_fn_node_type_base(&ntype, SH_NODE_MIX_RGB_LEGACY, "Mix", NODE_CLASS_OP_COLOR);
|
||||
sh_fn_node_type_base(&ntype, SH_NODE_MIX_RGB_LEGACY, "Mix (Legacy)", NODE_CLASS_OP_COLOR);
|
||||
ntype.declare = file_ns::sh_node_mix_rgb_declare;
|
||||
ntype.labelfunc = node_blend_label;
|
||||
node_type_gpu(&ntype, file_ns::gpu_shader_mix_rgb);
|
||||
|
|
|
@ -36,7 +36,7 @@ void register_node_type_sh_sephsv()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
sh_node_type_base(&ntype, SH_NODE_SEPHSV_LEGACY, "Separate HSV", NODE_CLASS_CONVERTER);
|
||||
sh_node_type_base(&ntype, SH_NODE_SEPHSV_LEGACY, "Separate HSV (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::node_declare_sephsv;
|
||||
node_type_gpu(&ntype, file_ns::gpu_shader_sephsv);
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
|
@ -73,7 +73,7 @@ void register_node_type_sh_combhsv()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
sh_node_type_base(&ntype, SH_NODE_COMBHSV_LEGACY, "Combine HSV", NODE_CLASS_CONVERTER);
|
||||
sh_node_type_base(&ntype, SH_NODE_COMBHSV_LEGACY, "Combine HSV (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::node_declare_combhsv;
|
||||
node_type_gpu(&ntype, file_ns::gpu_shader_combhsv);
|
||||
ntype.gather_link_search_ops = nullptr;
|
||||
|
|
|
@ -76,7 +76,8 @@ void register_node_type_sh_seprgb()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
sh_fn_node_type_base(&ntype, SH_NODE_SEPRGB_LEGACY, "Separate RGB", NODE_CLASS_CONVERTER);
|
||||
sh_fn_node_type_base(
|
||||
&ntype, SH_NODE_SEPRGB_LEGACY, "Separate RGB (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::sh_node_seprgb_declare;
|
||||
node_type_gpu(&ntype, file_ns::gpu_shader_seprgb);
|
||||
ntype.build_multi_function = file_ns::sh_node_seprgb_build_multi_function;
|
||||
|
@ -120,7 +121,8 @@ void register_node_type_sh_combrgb()
|
|||
|
||||
static bNodeType ntype;
|
||||
|
||||
sh_fn_node_type_base(&ntype, SH_NODE_COMBRGB_LEGACY, "Combine RGB", NODE_CLASS_CONVERTER);
|
||||
sh_fn_node_type_base(
|
||||
&ntype, SH_NODE_COMBRGB_LEGACY, "Combine RGB (Legacy)", NODE_CLASS_CONVERTER);
|
||||
ntype.declare = file_ns::sh_node_combrgb_declare;
|
||||
node_type_gpu(&ntype, file_ns::gpu_shader_combrgb);
|
||||
ntype.build_multi_function = file_ns::sh_node_combrgb_build_multi_function;
|
||||
|
|
|
@ -42,7 +42,8 @@ void register_node_type_tex_compose(void)
|
|||
{
|
||||
static bNodeType ntype;
|
||||
|
||||
tex_node_type_base(&ntype, TEX_NODE_COMPOSE_LEGACY, "Combine RGBA", NODE_CLASS_OP_COLOR);
|
||||
tex_node_type_base(
|
||||
&ntype, TEX_NODE_COMPOSE_LEGACY, "Combine RGBA (Legacy)", NODE_CLASS_OP_COLOR);
|
||||
node_type_socket_templates(&ntype, inputs, outputs);
|
||||
node_type_exec(&ntype, NULL, NULL, exec);
|
||||
|
||||
|
|
Loading…
Reference in New Issue