Changeset View
Standalone View
source/blender/modifiers/intern/MOD_armature.c
| Show First 20 Lines • Show All 260 Lines • ▼ Show 20 Lines | |||||
| static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) | static void blendRead(BlendDataReader *UNUSED(reader), ModifierData *md) | ||||
| { | { | ||||
| ArmatureModifierData *amd = (ArmatureModifierData *)md; | ArmatureModifierData *amd = (ArmatureModifierData *)md; | ||||
| amd->vert_coords_prev = NULL; | amd->vert_coords_prev = NULL; | ||||
| } | } | ||||
| ModifierTypeInfo modifierType_Armature = { | ModifierTypeInfo modifierType_Armature = { | ||||
| /* name */ "Armature", | /* name */ N_("Armature"), | ||||
mont29: This 'name' field is internal data, should not be exposed in the UI to the user, so no need to… | |||||
Done Inline ActionsBut then there’s something I don’t understand: at which point in the code are those new data names extracted to the translation files? In BKE_modifier.h there is this declaration: typedef struct ModifierTypeInfo {
/* The user visible name for this modifier */
char name[32];And in modifier.c: static ModifierData *modifier_allocate_and_init(int type)
{
const ModifierTypeInfo *mti = BKE_modifier_get_info(type);
ModifierData *md = MEM_callocN(mti->structSize, mti->structName);
/* NOTE: this name must be made unique later. */
BLI_strncpy(md->name, DATA_(mti->name), sizeof(md->name));Does it not mean that new modifiers get their names from this name property in ModifierTypeInfo? If so, they actually are exposed to the user. And their translation does happen, but the strings never get extracted to the po(t) file (I think). Anyway, I couldn’t find how to handle the string extraction better than using the macro where they are declared :) pioverfour: But then there’s something I don’t understand: at which point in the code are those new data… | |||||
Not Done Inline ActionsAaaaah right, they are used there as 'data' name... Thought those were extracted automatically by the script from the RNA data, but those default names are not exposed to RNA in the end... So you are right, we need those tags here. mont29: Aaaaah right, they are used there as 'data' name...
Thought those were extracted… | |||||
| /* structName */ "ArmatureModifierData", | /* structName */ "ArmatureModifierData", | ||||
| /* structSize */ sizeof(ArmatureModifierData), | /* structSize */ sizeof(ArmatureModifierData), | ||||
| /* srna */ &RNA_ArmatureModifier, | /* srna */ &RNA_ArmatureModifier, | ||||
| /* type */ eModifierTypeType_OnlyDeform, | /* type */ eModifierTypeType_OnlyDeform, | ||||
| /* flags */ eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_AcceptsVertexCosOnly | | /* flags */ eModifierTypeFlag_AcceptsCVs | eModifierTypeFlag_AcceptsVertexCosOnly | | ||||
| eModifierTypeFlag_SupportsEditmode, | eModifierTypeFlag_SupportsEditmode, | ||||
| /* icon */ ICON_MOD_ARMATURE, | /* icon */ ICON_MOD_ARMATURE, | ||||
| Show All 23 Lines | |||||
This 'name' field is internal data, should not be exposed in the UI to the user, so no need to translate it.