From 578a62cc6253f91169252f38244ae0bca6b263a1 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 10 Oct 2025 03:01:02 +0000 Subject: [PATCH] RNA: expose the language enum to Python scripts As far as I know it wasn't possible for scripts to access language ID's and their names using documented API's. Ref !147769 --- source/blender/makesrna/intern/rna_userdef.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/makesrna/intern/rna_userdef.cc b/source/blender/makesrna/intern/rna_userdef.cc index ad0718f1d46..332db472401 100644 --- a/source/blender/makesrna/intern/rna_userdef.cc +++ b/source/blender/makesrna/intern/rna_userdef.cc @@ -5340,6 +5340,8 @@ static void rna_def_userdef_view(BlenderRNA *brna) /* Language. */ prop = RNA_def_property(srna, "language", PROP_ENUM, PROP_NONE); + /* Set this flag so scripts can access language information at run-time via `enum_items`. */ + RNA_def_property_flag(prop, PROP_ENUM_NO_CONTEXT); RNA_def_property_enum_items(prop, rna_enum_language_default_items); # ifdef WITH_INTERNATIONAL RNA_def_property_enum_funcs(prop, nullptr, nullptr, "rna_lang_enum_properties_itemf");