From ce97a4ad4827e0cdb57dec5cc6939c434a8df2ee 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. --- 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 17932ea364c..a8ba60ea8c5 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"); } -- 2.30.2