Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2013-04-25 21:40:08 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2013-04-25 21:40:08 +0400
commite22c52af164e848d1032b484c9a1db3ac9381164 (patch)
treecb96757b9f623d5c7af78faa859baaa864f63cc3
parented684977006c072d826127a253495b1d02f6f6e7 (diff)
Fix [#34545] Render layer name is unwantedly translated in composite node editor
Some enums' items actually are generated from data (like the render layers of compo nodes), so they should not be translated. Added a PROP_ENUM_NO_TRANSLATE new RNA flag to tag those enums (only found those for nodes, but may be more of them around). Also fix similar issue in main list of render layers (Py UI code! :P ).
-rw-r--r--release/scripts/startup/bl_ui/properties_render_layer.py2
-rw-r--r--source/blender/makesrna/RNA_types.h5
-rw-r--r--source/blender/makesrna/intern/rna_access.c2
-rw-r--r--source/blender/makesrna/intern/rna_nodetree.c2
4 files changed, 7 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/properties_render_layer.py b/release/scripts/startup/bl_ui/properties_render_layer.py
index 74516ae1835..76e6e6fe3bd 100644
--- a/release/scripts/startup/bl_ui/properties_render_layer.py
+++ b/release/scripts/startup/bl_ui/properties_render_layer.py
@@ -38,7 +38,7 @@ class RENDERLAYER_UL_renderlayers(UIList):
# assert(isinstance(item, bpy.types.SceneRenderLayer)
layer = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
- layout.label(layer.name, icon_value=icon)
+ layout.label(layer.name, icon_value=icon, translate=False)
layout.prop(layer, "use", text="", index=index)
elif self.layout_type in {'GRID'}:
layout.alignment = 'CENTER'
diff --git a/source/blender/makesrna/RNA_types.h b/source/blender/makesrna/RNA_types.h
index b69c95d0363..db0d122df8d 100644
--- a/source/blender/makesrna/RNA_types.h
+++ b/source/blender/makesrna/RNA_types.h
@@ -146,7 +146,7 @@ typedef enum PropertySubType {
} PropertySubType;
/* Make sure enums are updated with thses */
-/* HIGHEST FLAG IN USE: 1 << 28 */
+/* HIGHEST FLAG IN USE: 1 << 29 */
typedef enum PropertyFlag {
/* editable means the property is editable in the user
* interface, properties are editable by default except
@@ -226,7 +226,8 @@ typedef enum PropertyFlag {
PROP_RAW_ARRAY = (1 << 14),
PROP_FREE_POINTERS = (1 << 15),
PROP_DYNAMIC = (1 << 17), /* for dynamic arrays, and retvals of type string */
- PROP_ENUM_NO_CONTEXT = (1 << 24) /* for enum that shouldn't be contextual */
+ PROP_ENUM_NO_CONTEXT = (1 << 24), /* for enum that shouldn't be contextual */
+ PROP_ENUM_NO_TRANSLATE = (1 << 29), /* for enums that shouldn't be translated (e.g. renderlayers' names in nodes) */
} PropertyFlag;
typedef struct CollectionPropertyIterator {
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index cfdfbf4e687..7a0a91cc6e3 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1256,7 +1256,7 @@ void RNA_property_enum_items_gettexted(bContext *C, PointerRNA *ptr, PropertyRNA
RNA_property_enum_items(C, ptr, prop, item, totitem, free);
#ifdef WITH_INTERNATIONAL
- {
+ if (!(prop->flag & PROP_ENUM_NO_TRANSLATE)) {
int i;
/* Note: Only do those tests once, and then use BLF_pgettext. */
int do_iface = BLF_translate_iface();
diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c
index fad66a5e7ed..7c7e35a8cb4 100644
--- a/source/blender/makesrna/intern/rna_nodetree.c
+++ b/source/blender/makesrna/intern/rna_nodetree.c
@@ -3715,6 +3715,7 @@ static void def_node_image_user(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "layer");
RNA_def_property_enum_items(prop, prop_image_layer_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_image_layer_itemf");
+ RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE);
RNA_def_property_ui_text(prop, "Layer", "");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_image_layer_update");
}
@@ -3769,6 +3770,7 @@ static void def_cmp_render_layers(StructRNA *srna)
RNA_def_property_enum_sdna(prop, NULL, "custom1");
RNA_def_property_enum_items(prop, prop_scene_layer_items);
RNA_def_property_enum_funcs(prop, NULL, NULL, "rna_Node_scene_layer_itemf");
+ RNA_def_property_flag(prop, PROP_ENUM_NO_TRANSLATE);
RNA_def_property_ui_text(prop, "Layer", "");
RNA_def_property_update(prop, NC_NODE | NA_EDITED, "rna_Node_update");
}