Changeset View
Changeset View
Standalone View
Standalone View
source/blender/makesrna/intern/rna_attribute.c
| Show All 15 Lines | |||||
| #include "DNA_customdata_types.h" | #include "DNA_customdata_types.h" | ||||
| #include "DNA_mesh_types.h" | #include "DNA_mesh_types.h" | ||||
| #include "DNA_meshdata_types.h" | #include "DNA_meshdata_types.h" | ||||
| #include "DNA_pointcloud_types.h" | #include "DNA_pointcloud_types.h" | ||||
| #include "BKE_attribute.h" | #include "BKE_attribute.h" | ||||
| #include "BKE_customdata.h" | #include "BKE_customdata.h" | ||||
| #include "BLT_translation.h" | |||||
| #include "WM_types.h" | #include "WM_types.h" | ||||
| const EnumPropertyItem rna_enum_attribute_type_items[] = { | const EnumPropertyItem rna_enum_attribute_type_items[] = { | ||||
| {CD_PROP_FLOAT, "FLOAT", 0, "Float", "Floating-point value"}, | {CD_PROP_FLOAT, "FLOAT", 0, "Float", "Floating-point value"}, | ||||
| {CD_PROP_INT32, "INT", 0, "Integer", "32-bit integer"}, | {CD_PROP_INT32, "INT", 0, "Integer", "32-bit integer"}, | ||||
| {CD_PROP_FLOAT3, "FLOAT_VECTOR", 0, "Vector", "3D vector with floating-point values"}, | {CD_PROP_FLOAT3, "FLOAT_VECTOR", 0, "Vector", "3D vector with floating-point values"}, | ||||
| {CD_PROP_COLOR, "FLOAT_COLOR", 0, "Color", "RGBA color with 32-bit floating-point values"}, | {CD_PROP_COLOR, "FLOAT_COLOR", 0, "Color", "RGBA color with 32-bit floating-point values"}, | ||||
| {CD_PROP_BYTE_COLOR, | {CD_PROP_BYTE_COLOR, | ||||
| ▲ Show 20 Lines • Show All 157 Lines • ▼ Show 20 Lines | const EnumPropertyItem *rna_enum_attribute_domain_itemf(ID *id, | ||||
| bool *r_free) | bool *r_free) | ||||
| { | { | ||||
| EnumPropertyItem *item = NULL; | EnumPropertyItem *item = NULL; | ||||
| const EnumPropertyItem *domain_item = NULL; | const EnumPropertyItem *domain_item = NULL; | ||||
| const ID_Type id_type = GS(id->name); | const ID_Type id_type = GS(id->name); | ||||
| int totitem = 0, a; | int totitem = 0, a; | ||||
| static EnumPropertyItem mesh_vertex_domain_item = { | static EnumPropertyItem mesh_vertex_domain_item = { | ||||
| ATTR_DOMAIN_POINT, "POINT", 0, "Vertex", "Attribute per point/vertex"}; | ATTR_DOMAIN_POINT, "POINT", 0, N_("Vertex"), N_("Attribute per point/vertex")}; | ||||
pioverfour: The message extraction does not work when the `EnumPropertyItem` is `static`, but as far as I… | |||||
Not Done Inline ActionsI indeed do not see any reason for this to be static, since RNA_enum_item_add does not keep any reference to the given item, but copies its value. unless am missing something @Jacques Lucke (JacquesLucke) ? mont29: I indeed do not see any reason for this to be static, since `RNA_enum_item_add` does not keep… | |||||
Not Done Inline ActionsRemoving static here should be fine. I think it makes sense for this to be static, but if that doesn't work with I18n, that's fine too. JacquesLucke: Removing static here should be fine. I think it makes sense for this to be static, but if that… | |||||
Not Done Inline ActionsActually now that they are just marked for translation, and not actually translated, it should be fine to keep this static. mont29: Actually now that they are just marked for translation, and not actually translated, it should… | |||||
Not Done Inline ActionsThese should not be actual translation here? so rather use the N_ marker macro. mont29: These should not be actual translation here? so rather use the `N_` marker macro. | |||||
| for (a = 0; rna_enum_attribute_domain_items[a].identifier; a++) { | for (a = 0; rna_enum_attribute_domain_items[a].identifier; a++) { | ||||
| domain_item = &rna_enum_attribute_domain_items[a]; | domain_item = &rna_enum_attribute_domain_items[a]; | ||||
| if (id_type == ID_PT && !ELEM(domain_item->value, ATTR_DOMAIN_POINT)) { | if (id_type == ID_PT && !ELEM(domain_item->value, ATTR_DOMAIN_POINT)) { | ||||
| continue; | continue; | ||||
| } | } | ||||
| if (id_type == ID_CV && !ELEM(domain_item->value, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) { | if (id_type == ID_CV && !ELEM(domain_item->value, ATTR_DOMAIN_POINT, ATTR_DOMAIN_CURVE)) { | ||||
| continue; | continue; | ||||
| ▲ Show 20 Lines • Show All 938 Lines • Show Last 20 Lines | |||||
The message extraction does not work when the EnumPropertyItem is static, but as far as I could find, it’s the only occurrence of this in the code base.
@Jacques Lucke (JacquesLucke) Is it acceptable to make it not static? If not, what can be done about it?