From 007c9e4e47552ff77971d2bb80be720f27b03fd1 Mon Sep 17 00:00:00 2001 From: Damien Picard Date: Wed, 5 Apr 2023 01:43:15 +0200 Subject: [PATCH] Fix #106427: Vector Math node does not appear in node search When trying to search for the Vector Math node with a translated interface, the node did not come up because it did not use the proper translation context. The Vector Math node's RNA had a translation context added in db87e2a638, in order for the Floor operation to be disambiguated. I made a mistake and added the context to the entire node struct instead of just the Operation prop. This had the result that the Vector Math was searched with an empty context in the search menu, but could not be found. Replacing the translation context from the struct to the property fixes the issue, and actually allows disambiguating operations such as Floor, which wasn't achieved previously. Pull Request: https://projects.blender.org/blender/blender/pulls/106579 --- source/blender/makesrna/intern/rna_nodetree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index 0e76d3560d7..2399cfe74e3 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -5014,7 +5014,7 @@ static void def_vector_math(StructRNA *srna) RNA_def_property_enum_sdna(prop, NULL, "custom1"); RNA_def_property_enum_items(prop, rna_enum_node_vec_math_items); RNA_def_property_ui_text(prop, "Operation", ""); - RNA_def_struct_translation_context(srna, BLT_I18NCONTEXT_ID_NODETREE); + RNA_def_property_translation_context(prop, BLT_I18NCONTEXT_ID_NODETREE); RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_ShaderNode_socket_update"); }