More new data names translation (most cases should be covered now).

Also done a few cleanup here and there...
This commit is contained in:
Bastien Montagne 2013-03-25 08:29:06 +00:00
parent 1b4c9e1ad4
commit 6926596174
44 changed files with 268 additions and 165 deletions

@ -37,6 +37,10 @@
#define TEXT_DOMAIN_NAME "blender" #define TEXT_DOMAIN_NAME "blender"
#ifdef __cplusplus
extern "C" {
#endif
/* blf_lang.c */ /* blf_lang.c */
/* Search the path directory to the locale files, this try all /* Search the path directory to the locale files, this try all
@ -218,4 +222,8 @@ typedef struct
{NULL, NULL, NULL} \ {NULL, NULL, NULL} \
} }
#ifdef __cplusplus
};
#endif
#endif /* __BLF_TRANSLATION_H__ */ #endif /* __BLF_TRANSLATION_H__ */

@ -119,7 +119,7 @@ void recalc_all_library_objects(struct Main *main);
void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) ); void set_free_windowmanager_cb(void (*func)(struct bContext *, struct wmWindowManager *) );
/* use when "" is given to new_id() */ /* use when "" is given to new_id() */
#define ID_FALLBACK_NAME "Untitled" #define ID_FALLBACK_NAME N_("Untitled")
#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT)) #define IS_TAGGED(_id) ((_id) && (((ID *)_id)->flag & LIB_DOIT))

@ -47,18 +47,19 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLI_ghash.h" #include "BLI_ghash.h"
#include "BKE_animsys.h" #include "BLF_translation.h"
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_anim.h" #include "BKE_anim.h"
#include "BKE_animsys.h"
#include "BKE_constraint.h" #include "BKE_constraint.h"
#include "BKE_global.h"
#include "BKE_fcurve.h" #include "BKE_fcurve.h"
#include "BKE_global.h"
#include "BKE_idprop.h"
#include "BKE_library.h" #include "BKE_library.h"
#include "BKE_main.h" #include "BKE_main.h"
#include "BKE_object.h" #include "BKE_object.h"
#include "BKE_idprop.h"
#include "BIK_api.h" #include "BIK_api.h"
#include "RNA_access.h" #include "RNA_access.h"
@ -296,11 +297,11 @@ bActionGroup *action_groups_add_new(bAction *act, const char name[])
/* make it selected, with default name */ /* make it selected, with default name */
agrp->flag = AGRP_SELECTED; agrp->flag = AGRP_SELECTED;
BLI_strncpy(agrp->name, name[0] ? name : "Group", sizeof(agrp->name)); BLI_strncpy(agrp->name, name[0] ? name : DATA_("Group"), sizeof(agrp->name));
/* add to action, and validate */ /* add to action, and validate */
BLI_addtail(&act->groups, agrp); BLI_addtail(&act->groups, agrp);
BLI_uniquename(&act->groups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name)); BLI_uniquename(&act->groups, agrp, DATA_("Group"), '.', offsetof(bActionGroup, name), sizeof(agrp->name));
/* return the new group */ /* return the new group */
return agrp; return agrp;
@ -825,9 +826,9 @@ void BKE_pose_add_group(Object *ob)
return; return;
grp = MEM_callocN(sizeof(bActionGroup), "PoseGroup"); grp = MEM_callocN(sizeof(bActionGroup), "PoseGroup");
BLI_strncpy(grp->name, "Group", sizeof(grp->name)); BLI_strncpy(grp->name, DATA_("Group"), sizeof(grp->name));
BLI_addtail(&pose->agroups, grp); BLI_addtail(&pose->agroups, grp);
BLI_uniquename(&pose->agroups, grp, "Group", '.', offsetof(bActionGroup, name), sizeof(grp->name)); BLI_uniquename(&pose->agroups, grp, DATA_("Group"), '.', offsetof(bActionGroup, name), sizeof(grp->name));
pose->active_group = BLI_countlist(&pose->agroups); pose->active_group = BLI_countlist(&pose->agroups);
} }

@ -42,6 +42,8 @@
#include "BLI_dynstr.h" #include "BLI_dynstr.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "DNA_anim_types.h" #include "DNA_anim_types.h"
#include "DNA_lamp_types.h" #include "DNA_lamp_types.h"
#include "DNA_material_types.h" #include "DNA_material_types.h"
@ -973,8 +975,8 @@ KeyingSet *BKE_keyingset_add(ListBase *list, const char idname[], const char nam
/* allocate new KeyingSet */ /* allocate new KeyingSet */
ks = MEM_callocN(sizeof(KeyingSet), "KeyingSet"); ks = MEM_callocN(sizeof(KeyingSet), "KeyingSet");
BLI_strncpy(ks->idname, (idname) ? idname : (name) ? name : "KeyingSet", sizeof(ks->idname)); BLI_strncpy(ks->idname, (idname) ? idname : (name) ? name : DATA_("KeyingSet"), sizeof(ks->idname));
BLI_strncpy(ks->name, (name) ? name : (idname) ? idname : "Keying Set", sizeof(ks->name)); BLI_strncpy(ks->name, (name) ? name : (idname) ? idname : DATA_("Keying Set"), sizeof(ks->name));
ks->flag = flag; ks->flag = flag;
ks->keyingflag = keyingflag; ks->keyingflag = keyingflag;
@ -983,10 +985,10 @@ KeyingSet *BKE_keyingset_add(ListBase *list, const char idname[], const char nam
BLI_addtail(list, ks); BLI_addtail(list, ks);
/* Make sure KeyingSet has a unique idname */ /* Make sure KeyingSet has a unique idname */
BLI_uniquename(list, ks, "KeyingSet", '.', offsetof(KeyingSet, idname), sizeof(ks->idname)); BLI_uniquename(list, ks, DATA_("KeyingSet"), '.', offsetof(KeyingSet, idname), sizeof(ks->idname));
/* Make sure KeyingSet has a unique label (this helps with identification) */ /* Make sure KeyingSet has a unique label (this helps with identification) */
BLI_uniquename(list, ks, "Keying Set", '.', offsetof(KeyingSet, name), sizeof(ks->name)); BLI_uniquename(list, ks, DATA_("Keying Set"), '.', offsetof(KeyingSet, name), sizeof(ks->name));
/* return new KeyingSet for further editing */ /* return new KeyingSet for further editing */
return ks; return ks;

@ -100,7 +100,7 @@
/* Find the first available, non-duplicate name for a given constraint */ /* Find the first available, non-duplicate name for a given constraint */
void BKE_unique_constraint_name(bConstraint *con, ListBase *list) void BKE_unique_constraint_name(bConstraint *con, ListBase *list)
{ {
BLI_uniquename(list, con, "Const", '.', offsetof(bConstraint, name), sizeof(con->name)); BLI_uniquename(list, con, DATA_("Const"), '.', offsetof(bConstraint, name), sizeof(con->name));
} }
/* ----------------- Evaluation Loop Preparation --------------- */ /* ----------------- Evaluation Loop Preparation --------------- */

@ -51,6 +51,8 @@
#include "BLI_mempool.h" #include "BLI_mempool.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_customdata.h" #include "BKE_customdata.h"
#include "BKE_customdata_file.h" #include "BKE_customdata_file.h"
#include "BKE_global.h" #include "BKE_global.h"
@ -1051,11 +1053,11 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 4: CD_MFACE */ /* 4: CD_MFACE */
{sizeof(MFace), "MFace", 1, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(MFace), "MFace", 1, NULL, NULL, NULL, NULL, NULL, NULL},
/* 5: CD_MTFACE */ /* 5: CD_MTFACE */
{sizeof(MTFace), "MTFace", 1, "UVMap", layerCopy_tface, NULL, {sizeof(MTFace), "MTFace", 1, N_("UVMap"), layerCopy_tface, NULL,
layerInterp_tface, layerSwap_tface, layerDefault_tface}, layerInterp_tface, layerSwap_tface, layerDefault_tface},
/* 6: CD_MCOL */ /* 6: CD_MCOL */
/* 4 MCol structs per face */ /* 4 MCol structs per face */
{sizeof(MCol) * 4, "MCol", 4, "Col", NULL, NULL, layerInterp_mcol, {sizeof(MCol) * 4, "MCol", 4, N_("Col"), NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
/* 7: CD_ORIGINDEX */ /* 7: CD_ORIGINDEX */
{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
@ -1065,25 +1067,25 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
/* 9: CD_POLYINDEX (deprecated) */ /* 9: CD_POLYINDEX (deprecated) */
{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 10: CD_PROP_FLT */ /* 10: CD_PROP_FLT */
{sizeof(MFloatProperty), "MFloatProperty", 1, "Float", layerCopy_propFloat, NULL, NULL, NULL}, {sizeof(MFloatProperty), "MFloatProperty", 1, N_("Float"), layerCopy_propFloat, NULL, NULL, NULL},
/* 11: CD_PROP_INT */ /* 11: CD_PROP_INT */
{sizeof(MIntProperty), "MIntProperty", 1, "Int", layerCopy_propInt, NULL, NULL, NULL}, {sizeof(MIntProperty), "MIntProperty", 1, N_("Int"), layerCopy_propInt, NULL, NULL, NULL},
/* 12: CD_PROP_STR */ /* 12: CD_PROP_STR */
{sizeof(MStringProperty), "MStringProperty", 1, "String", layerCopy_propString, NULL, NULL, NULL}, {sizeof(MStringProperty), "MStringProperty", 1, N_("String"), layerCopy_propString, NULL, NULL, NULL},
/* 13: CD_ORIGSPACE */ /* 13: CD_ORIGSPACE */
{sizeof(OrigSpaceFace), "OrigSpaceFace", 1, "UVMap", layerCopy_origspace_face, NULL, {sizeof(OrigSpaceFace), "OrigSpaceFace", 1, N_("UVMap"), layerCopy_origspace_face, NULL,
layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face}, layerInterp_origspace_face, layerSwap_origspace_face, layerDefault_origspace_face},
/* 14: CD_ORCO */ /* 14: CD_ORCO */
{sizeof(float) * 3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(float) * 3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 15: CD_MTEXPOLY */ /* 15: CD_MTEXPOLY */
/* note, when we expose the UV Map / TexFace split to the user, change this back to face Texture */ /* note, when we expose the UV Map / TexFace split to the user, change this back to face Texture */
{sizeof(MTexPoly), "MTexPoly", 1, "UVMap" /* "Face Texture" */, NULL, NULL, NULL, NULL, NULL}, {sizeof(MTexPoly), "MTexPoly", 1, N_("UVMap") /* "Face Texture" */, NULL, NULL, NULL, NULL, NULL},
/* 16: CD_MLOOPUV */ /* 16: CD_MLOOPUV */
{sizeof(MLoopUV), "MLoopUV", 1, "UV coord", NULL, NULL, layerInterp_mloopuv, NULL, NULL, {sizeof(MLoopUV), "MLoopUV", 1, N_("UV coord"), NULL, NULL, layerInterp_mloopuv, NULL, NULL,
layerEqual_mloopuv, layerMultiply_mloopuv, layerInitMinMax_mloopuv, layerEqual_mloopuv, layerMultiply_mloopuv, layerInitMinMax_mloopuv,
layerAdd_mloopuv, layerDoMinMax_mloopuv, layerCopyValue_mloopuv}, layerAdd_mloopuv, layerDoMinMax_mloopuv, layerCopyValue_mloopuv},
/* 17: CD_MLOOPCOL */ /* 17: CD_MLOOPCOL */
{sizeof(MLoopCol), "MLoopCol", 1, "Col", NULL, NULL, layerInterp_mloopcol, NULL, {sizeof(MLoopCol), "MLoopCol", 1, N_("Col"), NULL, NULL, layerInterp_mloopcol, NULL,
layerDefault_mloopcol, layerEqual_mloopcol, layerMultiply_mloopcol, layerInitMinMax_mloopcol, layerDefault_mloopcol, layerEqual_mloopcol, layerMultiply_mloopcol, layerInitMinMax_mloopcol,
layerAdd_mloopcol, layerDoMinMax_mloopcol, layerCopyValue_mloopcol}, layerAdd_mloopcol, layerDoMinMax_mloopcol, layerCopyValue_mloopcol},
/* 18: CD_TANGENT */ /* 18: CD_TANGENT */
@ -1094,38 +1096,38 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL,
layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps}, layerRead_mdisps, layerWrite_mdisps, layerFilesize_mdisps},
/* 20: CD_PREVIEW_MCOL */ /* 20: CD_PREVIEW_MCOL */
{sizeof(MCol) * 4, "MCol", 4, "PreviewCol", NULL, NULL, layerInterp_mcol, {sizeof(MCol) * 4, "MCol", 4, N_("PreviewCol"), NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
/* 21: CD_ID_MCOL */ /* 21: CD_ID_MCOL */
{sizeof(MCol) * 4, "MCol", 4, "IDCol", NULL, NULL, layerInterp_mcol, {sizeof(MCol) * 4, "MCol", 4, N_("IDCol"), NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
/* 22: CD_TEXTURE_MCOL */ /* 22: CD_TEXTURE_MCOL */
{sizeof(MCol) * 4, "MCol", 4, "TexturedCol", NULL, NULL, layerInterp_mcol, {sizeof(MCol) * 4, "MCol", 4, N_("TexturedCol"), NULL, NULL, layerInterp_mcol,
layerSwap_mcol, layerDefault_mcol}, layerSwap_mcol, layerDefault_mcol},
/* 23: CD_CLOTH_ORCO */ /* 23: CD_CLOTH_ORCO */
{sizeof(float) * 3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(float) * 3, "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 24: CD_RECAST */ /* 24: CD_RECAST */
{sizeof(MRecast), "MRecast", 1, "Recast", NULL, NULL, NULL, NULL}, {sizeof(MRecast), "MRecast", 1, N_("Recast"), NULL, NULL, NULL, NULL},
/* BMESH ONLY */ /* BMESH ONLY */
/* 25: CD_MPOLY */ /* 25: CD_MPOLY */
{sizeof(MPoly), "MPoly", 1, "NGon Face", NULL, NULL, NULL, NULL, NULL}, {sizeof(MPoly), "MPoly", 1, N_("NGon Face"), NULL, NULL, NULL, NULL, NULL},
/* 26: CD_MLOOP */ /* 26: CD_MLOOP */
{sizeof(MLoop), "MLoop", 1, "NGon Face-Vertex", NULL, NULL, NULL, NULL, NULL}, {sizeof(MLoop), "MLoop", 1, N_("NGon Face-Vertex"), NULL, NULL, NULL, NULL, NULL},
/* 27: CD_SHAPE_KEYINDEX */ /* 27: CD_SHAPE_KEYINDEX */
{sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL}, {sizeof(int), "", 0, NULL, NULL, NULL, NULL, NULL, NULL},
/* 28: CD_SHAPEKEY */ /* 28: CD_SHAPEKEY */
{sizeof(float) * 3, "", 0, "ShapeKey", NULL, NULL, layerInterp_shapekey}, {sizeof(float) * 3, "", 0, N_("ShapeKey"), NULL, NULL, layerInterp_shapekey},
/* 29: CD_BWEIGHT */ /* 29: CD_BWEIGHT */
{sizeof(float), "", 0, "BevelWeight", NULL, NULL, layerInterp_bweight}, {sizeof(float), "", 0, N_("BevelWeight"), NULL, NULL, layerInterp_bweight},
/* 30: CD_CREASE */ /* 30: CD_CREASE */
{sizeof(float), "", 0, "SubSurfCrease", NULL, NULL, layerInterp_bweight}, {sizeof(float), "", 0, N_("SubSurfCrease"), NULL, NULL, layerInterp_bweight},
/* 31: CD_ORIGSPACE_MLOOP */ /* 31: CD_ORIGSPACE_MLOOP */
{sizeof(OrigSpaceLoop), "OrigSpaceLoop", 1, "OS Loop", NULL, NULL, layerInterp_mloop_origspace, NULL, NULL, {sizeof(OrigSpaceLoop), "OrigSpaceLoop", 1, N_("OS Loop"), NULL, NULL, layerInterp_mloop_origspace, NULL, NULL,
layerEqual_mloop_origspace, layerMultiply_mloop_origspace, layerInitMinMax_mloop_origspace, layerEqual_mloop_origspace, layerMultiply_mloop_origspace, layerInitMinMax_mloop_origspace,
layerAdd_mloop_origspace, layerDoMinMax_mloop_origspace, layerCopyValue_mloop_origspace}, layerAdd_mloop_origspace, layerDoMinMax_mloop_origspace, layerCopyValue_mloop_origspace},
/* 32: CD_PREVIEW_MLOOPCOL */ /* 32: CD_PREVIEW_MLOOPCOL */
{sizeof(MLoopCol), "MLoopCol", 1, "PreviewLoopCol", NULL, NULL, layerInterp_mloopcol, NULL, {sizeof(MLoopCol), "MLoopCol", 1, N_("PreviewLoopCol"), NULL, NULL, layerInterp_mloopcol, NULL,
layerDefault_mloopcol, layerEqual_mloopcol, layerMultiply_mloopcol, layerInitMinMax_mloopcol, layerDefault_mloopcol, layerEqual_mloopcol, layerMultiply_mloopcol, layerInitMinMax_mloopcol,
layerAdd_mloopcol, layerDoMinMax_mloopcol, layerCopyValue_mloopcol}, layerAdd_mloopcol, layerDoMinMax_mloopcol, layerCopyValue_mloopcol},
/* 33: CD_BM_ELEM_PYPTR */ /* 33: CD_BM_ELEM_PYPTR */
@ -1221,8 +1223,8 @@ void customData_mask_layers__print(CustomDataMask mask)
/********************* CustomData functions *********************/ /********************* CustomData functions *********************/
static void customData_update_offsets(CustomData *data); static void customData_update_offsets(CustomData *data);
static CustomDataLayer *customData_add_layer__internal(CustomData *data, static CustomDataLayer *customData_add_layer__internal(CustomData *data, int type, int alloctype, void *layerdata,
int type, int alloctype, void *layerdata, int totelem, const char *name); int totelem, const char *name);
void CustomData_update_typemap(CustomData *data) void CustomData_update_typemap(CustomData *data)
{ {
@ -1592,8 +1594,8 @@ static int customData_resize(CustomData *data, int amount)
return 1; return 1;
} }
static CustomDataLayer *customData_add_layer__internal(CustomData *data, static CustomDataLayer *customData_add_layer__internal(CustomData *data, int type, int alloctype, void *layerdata,
int type, int alloctype, void *layerdata, int totelem, const char *name) int totelem, const char *name)
{ {
const LayerTypeInfo *typeInfo = layerType_getInfo(type); const LayerTypeInfo *typeInfo = layerType_getInfo(type);
int size = typeInfo->size * totelem, flag = 0, index = data->totlayer; int size = typeInfo->size * totelem, flag = 0, index = data->totlayer;
@ -1649,7 +1651,7 @@ static CustomDataLayer *customData_add_layer__internal(CustomData *data,
data->layers[index].flag = flag; data->layers[index].flag = flag;
data->layers[index].data = newlayerdata; data->layers[index].data = newlayerdata;
if (name || (name = typeInfo->defaultname)) { if (name || (name = DATA_(typeInfo->defaultname))) {
BLI_strncpy(data->layers[index].name, name, sizeof(data->layers[index].name)); BLI_strncpy(data->layers[index].name, name, sizeof(data->layers[index].name));
CustomData_set_layer_unique_name(data, index); CustomData_set_layer_unique_name(data, index);
} }
@ -2909,8 +2911,9 @@ void CustomData_set_layer_unique_name(CustomData *data, int index)
if (!typeInfo->defaultname) if (!typeInfo->defaultname)
return; return;
BLI_uniquename_cb(customdata_unique_check, &data_arg, typeInfo->defaultname, '.', nlayer->name, sizeof(nlayer->name)); BLI_uniquename_cb(customdata_unique_check, &data_arg, DATA_(typeInfo->defaultname), '.', nlayer->name,
sizeof(nlayer->name));
} }
void CustomData_validate_layer_name(const CustomData *data, int type, const char *name, char *outname) void CustomData_validate_layer_name(const CustomData *data, int type, const char *name, char *outname)

@ -47,6 +47,8 @@
#include "BLI_string.h" #include "BLI_string.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_deform.h" /* own include */ #include "BKE_deform.h" /* own include */
void defgroup_copy_list(ListBase *outbase, ListBase *inbase) void defgroup_copy_list(ListBase *outbase, ListBase *inbase)
@ -459,7 +461,7 @@ void defgroup_unique_name(bDeformGroup *dg, Object *ob)
data.ob = ob; data.ob = ob;
data.dg = dg; data.dg = dg;
BLI_uniquename_cb(defgroup_unique_check, &data, "Group", '.', dg->name, sizeof(dg->name)); BLI_uniquename_cb(defgroup_unique_check, &data, DATA_("Group"), '.', dg->name, sizeof(dg->name));
} }
static int is_char_sep(const char c) static int is_char_sep(const char c)

@ -1024,7 +1024,8 @@ void dynamicPaint_Modifier_free(struct DynamicPaintModifierData *pmd)
DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *canvas, Scene *scene) DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *canvas, Scene *scene)
{ {
DynamicPaintSurface *surface = MEM_callocN(sizeof(DynamicPaintSurface), "DynamicPaintSurface"); DynamicPaintSurface *surface = MEM_callocN(sizeof(DynamicPaintSurface), "DynamicPaintSurface");
if (!surface) return NULL; if (!surface)
return NULL;
surface->canvas = canvas; surface->canvas = canvas;
surface->format = MOD_DPAINT_SURFACE_F_VERTEX; surface->format = MOD_DPAINT_SURFACE_F_VERTEX;
@ -1080,7 +1081,8 @@ DynamicPaintSurface *dynamicPaint_createNewSurface(DynamicPaintCanvasSettings *c
modifier_path_init(surface->image_output_path, sizeof(surface->image_output_path), "cache_dynamicpaint"); modifier_path_init(surface->image_output_path, sizeof(surface->image_output_path), "cache_dynamicpaint");
dynamicPaintSurface_setUniqueName(surface, "Surface"); /* Using ID_BRUSH i18n context, as we have no physics/dpaint one for now... */
dynamicPaintSurface_setUniqueName(surface, CTX_DATA_(BLF_I18NCONTEXT_ID_BRUSH, "Surface"));
surface->effector_weights = BKE_add_effector_weights(NULL); surface->effector_weights = BKE_add_effector_weights(NULL);

@ -47,6 +47,8 @@
#include "BLI_math.h" #include "BLI_math.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_fcurve.h" #include "BKE_fcurve.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_action.h" #include "BKE_action.h"
@ -1557,8 +1559,9 @@ DriverVar *driver_add_new_variable(ChannelDriver *driver)
BLI_addtail(&driver->variables, dvar); BLI_addtail(&driver->variables, dvar);
/* give the variable a 'unique' name */ /* give the variable a 'unique' name */
strcpy(dvar->name, "var"); strcpy(dvar->name, CTX_DATA_(BLF_I18NCONTEXT_ID_ACTION, "var"));
BLI_uniquename(&driver->variables, dvar, "var", '_', offsetof(DriverVar, name), sizeof(dvar->name)); BLI_uniquename(&driver->variables, dvar, CTX_DATA_(BLF_I18NCONTEXT_ID_ACTION, "var"), '_',
offsetof(DriverVar, name), sizeof(dvar->name));
/* set the default type to 'single prop' */ /* set the default type to 'single prop' */
driver_change_variable_type(dvar, DVAR_TYPE_SINGLE_PROP); driver_change_variable_type(dvar, DVAR_TYPE_SINGLE_PROP);

@ -39,6 +39,8 @@
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "DNA_gpencil_types.h" #include "DNA_gpencil_types.h"
#include "BKE_global.h" #include "BKE_global.h"
@ -184,7 +186,7 @@ bGPDlayer *gpencil_layer_addnew(bGPdata *gpd, const char *name, int setactive)
/* auto-name */ /* auto-name */
BLI_strncpy(gpl->info, name, sizeof(gpl->info)); BLI_strncpy(gpl->info, name, sizeof(gpl->info));
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info)); BLI_uniquename(&gpd->layers, gpl, DATA_("GP_Layer"), '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
/* make this one the active one */ /* make this one the active one */
if (setactive) if (setactive)

@ -65,6 +65,7 @@
#include "BLI_dynstr.h" #include "BLI_dynstr.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_ipo.h" #include "BKE_ipo.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
@ -1117,7 +1118,8 @@ static void fcurve_add_to_list(ListBase *groups, ListBase *list, FCurve *fcu, ch
BLI_strncpy(agrp->name, grpname, sizeof(agrp->name)); BLI_strncpy(agrp->name, grpname, sizeof(agrp->name));
BLI_addtail(&tmp_act.groups, agrp); BLI_addtail(&tmp_act.groups, agrp);
BLI_uniquename(&tmp_act.groups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name)); BLI_uniquename(&tmp_act.groups, agrp, DATA_("Group"), '.', offsetof(bActionGroup, name),
sizeof(agrp->name));
} }
/* add F-Curve to group */ /* add F-Curve to group */

@ -40,6 +40,8 @@
#include "BLI_math_vector.h" #include "BLI_math_vector.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "DNA_anim_types.h" #include "DNA_anim_types.h"
#include "DNA_key_types.h" #include "DNA_key_types.h"
#include "DNA_lattice_types.h" #include "DNA_lattice_types.h"
@ -1441,11 +1443,13 @@ KeyBlock *BKE_keyblock_add(Key *key, const char *name)
BLI_strncpy(kb->name, name, sizeof(kb->name)); BLI_strncpy(kb->name, name, sizeof(kb->name));
} }
else { else {
if (tot == 1) BLI_strncpy(kb->name, "Basis", sizeof(kb->name)); if (tot == 1)
else BLI_snprintf(kb->name, sizeof(kb->name), "Key %d", tot - 1); BLI_strncpy(kb->name, DATA_("Basis"), sizeof(kb->name));
else
BLI_snprintf(kb->name, sizeof(kb->name), DATA_("Key %d"), tot - 1);
} }
BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name)); BLI_uniquename(&key->block, kb, DATA_("Key"), '.', offsetof(KeyBlock, name), sizeof(kb->name));
kb->uid = key->uidgen++; kb->uid = key->uidgen++;

@ -71,11 +71,13 @@
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_dynstr.h" #include "BLI_dynstr.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BKE_bpath.h"
#include "BLF_translation.h"
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_armature.h" #include "BKE_armature.h"
#include "BKE_bpath.h"
#include "BKE_brush.h" #include "BKE_brush.h"
#include "BKE_camera.h" #include "BKE_camera.h"
#include "BKE_context.h" #include "BKE_context.h"
@ -1355,25 +1357,23 @@ bool new_id(ListBase *lb, ID *id, const char *tname)
char name[MAX_ID_NAME - 2]; char name[MAX_ID_NAME - 2];
/* if library, don't rename */ /* if library, don't rename */
if (id->lib) return false; if (id->lib)
return false;
/* if no libdata given, look up based on ID */ /* if no libdata given, look up based on ID */
if (lb == NULL) lb = which_libbase(G.main, GS(id->name)); if (lb == NULL)
lb = which_libbase(G.main, GS(id->name));
/* if no name given, use name of current ID /* if no name given, use name of current ID
* else make a copy (tname args can be const) */ * else make a copy (tname args can be const) */
if (tname == NULL) if (tname == NULL)
tname = id->name + 2; tname = id->name + 2;
strncpy(name, tname, sizeof(name) - 1); BLI_strncpy(name, tname, sizeof(name));
/* if result > MAX_ID_NAME-3, strncpy don't put the final '\0' to name.
* easier to assign each time then to check if its needed */
name[sizeof(name) - 1] = 0;
if (name[0] == '\0') { if (name[0] == '\0') {
/* disallow empty names */ /* disallow empty names */
strcpy(name, ID_FALLBACK_NAME); BLI_strncpy(name, DATA_(ID_FALLBACK_NAME), sizeof(name));
} }
else { else {
/* disallow non utf8 chars, /* disallow non utf8 chars,

@ -40,6 +40,8 @@
#include "BLI_listbase.h" #include "BLI_listbase.h"
#include "BLI_math.h" #include "BLI_math.h"
#include "BLF_translation.h"
#include "DNA_mask_types.h" #include "DNA_mask_types.h"
#include "DNA_node_types.h" #include "DNA_node_types.h"
#include "DNA_screen_types.h" #include "DNA_screen_types.h"
@ -187,7 +189,8 @@ void BKE_mask_layer_remove(Mask *mask, MaskLayer *masklay)
void BKE_mask_layer_unique_name(Mask *mask, MaskLayer *masklay) void BKE_mask_layer_unique_name(Mask *mask, MaskLayer *masklay)
{ {
BLI_uniquename(&mask->masklayers, masklay, "MaskLayer", '.', offsetof(MaskLayer, name), sizeof(masklay->name)); BLI_uniquename(&mask->masklayers, masklay, DATA_("MaskLayer"), '.', offsetof(MaskLayer, name),
sizeof(masklay->name));
} }
MaskLayer *BKE_mask_layer_copy(MaskLayer *masklay) MaskLayer *BKE_mask_layer_copy(MaskLayer *masklay)

@ -122,8 +122,8 @@ void modifier_unique_name(ListBase *modifiers, ModifierData *md)
{ {
if (modifiers && md) { if (modifiers && md) {
ModifierTypeInfo *mti = modifierType_getInfo(md->type); ModifierTypeInfo *mti = modifierType_getInfo(md->type);
BLI_uniquename(modifiers, md, mti->name, '.', offsetof(ModifierData, name), sizeof(md->name)); BLI_uniquename(modifiers, md, DATA_(mti->name), '.', offsetof(ModifierData, name), sizeof(md->name));
} }
} }

@ -45,6 +45,8 @@
#include "BLI_string.h" #include "BLI_string.h"
#include "BLI_ghash.h" #include "BLI_ghash.h"
#include "BLF_translation.h"
#include "DNA_anim_types.h" #include "DNA_anim_types.h"
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "DNA_sound_types.h" #include "DNA_sound_types.h"
@ -264,7 +266,7 @@ NlaTrack *add_nlatrack(AnimData *adt, NlaTrack *prev)
/* must have unique name, but we need to seed this */ /* must have unique name, but we need to seed this */
strcpy(nlt->name, "NlaTrack"); strcpy(nlt->name, "NlaTrack");
BLI_uniquename(&adt->nla_tracks, nlt, "NlaTrack", '.', offsetof(NlaTrack, name), sizeof(nlt->name)); BLI_uniquename(&adt->nla_tracks, nlt, DATA_("NlaTrack"), '.', offsetof(NlaTrack, name), sizeof(nlt->name));
/* return the new track */ /* return the new track */
return nlt; return nlt;
@ -1320,7 +1322,7 @@ void BKE_nlastrip_validate_name(AnimData *adt, NlaStrip *strip)
/* if the hash-table has a match for this name, try other names... /* if the hash-table has a match for this name, try other names...
* - in an extreme case, it might not be able to find a name, but then everything else in Blender would fail too :) * - in an extreme case, it might not be able to find a name, but then everything else in Blender would fail too :)
*/ */
BLI_uniquename_cb(nla_editbone_name_check, (void *)gh, "NlaStrip", '.', strip->name, sizeof(strip->name)); BLI_uniquename_cb(nla_editbone_name_check, (void *)gh, DATA_("NlaStrip"), '.', strip->name, sizeof(strip->name));
/* free the hash... */ /* free the hash... */
BLI_ghash_free(gh, NULL, NULL); BLI_ghash_free(gh, NULL, NULL);

@ -792,7 +792,7 @@ int nodeFindNode(bNodeTree *ntree, bNodeSocket *sock, bNode **nodep, int *sockin
/* Find the first available, non-duplicate name for a given node */ /* Find the first available, non-duplicate name for a given node */
void nodeUniqueName(bNodeTree *ntree, bNode *node) void nodeUniqueName(bNodeTree *ntree, bNode *node)
{ {
BLI_uniquename(&ntree->nodes, node, "Node", '.', offsetof(bNode, name), sizeof(node->name)); BLI_uniquename(&ntree->nodes, node, DATA_("Node"), '.', offsetof(bNode, name), sizeof(node->name));
} }
bNode *nodeAddNode(const struct bContext *C, bNodeTree *ntree, const char *idname) bNode *nodeAddNode(const struct bContext *C, bNodeTree *ntree, const char *idname)

@ -57,6 +57,8 @@
#include "BLI_callbacks.h" #include "BLI_callbacks.h"
#include "BLI_string.h" #include "BLI_string.h"
#include "BLF_translation.h"
#include "BKE_anim.h" #include "BKE_anim.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_action.h" #include "BKE_action.h"
@ -76,9 +78,8 @@
#include "BKE_rigidbody.h" #include "BKE_rigidbody.h"
#include "BKE_scene.h" #include "BKE_scene.h"
#include "BKE_sequencer.h" #include "BKE_sequencer.h"
#include "BKE_world.h"
#include "BKE_sound.h" #include "BKE_sound.h"
#include "BKE_world.h"
#include "RE_engine.h" #include "RE_engine.h"
@ -1262,11 +1263,11 @@ SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
SceneRenderLayer *srl; SceneRenderLayer *srl;
if (!name) if (!name)
name = "RenderLayer"; name = DATA_("RenderLayer");
srl = MEM_callocN(sizeof(SceneRenderLayer), "new render layer"); srl = MEM_callocN(sizeof(SceneRenderLayer), "new render layer");
BLI_strncpy(srl->name, name, sizeof(srl->name)); BLI_strncpy(srl->name, name, sizeof(srl->name));
BLI_uniquename(&sce->r.layers, srl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(srl->name)); BLI_uniquename(&sce->r.layers, srl, DATA_("RenderLayer"), '.', offsetof(SceneRenderLayer, name), sizeof(srl->name));
BLI_addtail(&sce->r.layers, srl); BLI_addtail(&sce->r.layers, srl);
/* note, this is also in render, pipeline.c, to make layer when scenedata doesnt have it */ /* note, this is also in render, pipeline.c, to make layer when scenedata doesnt have it */

@ -39,6 +39,8 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLI_math.h" #include "BLI_math.h"
#include "BLF_translation.h"
#include "DNA_sequence_types.h" #include "DNA_sequence_types.h"
#include "BKE_colortools.h" #include "BKE_colortools.h"
@ -162,13 +164,13 @@ static void colorBalance_apply(SequenceModifierData *smd, ImBuf *ibuf, ImBuf *ma
} }
static SequenceModifierTypeInfo seqModifier_ColorBalance = { static SequenceModifierTypeInfo seqModifier_ColorBalance = {
"Color Balance", /* name */ CTX_N_(BLF_I18NCONTEXT_ID_SEQUENCE, "Color Balance"), /* name */
"ColorBalanceModifierData", /* struct_name */ "ColorBalanceModifierData", /* struct_name */
sizeof(ColorBalanceModifierData), /* struct_size */ sizeof(ColorBalanceModifierData), /* struct_size */
colorBalance_init_data, /* init_data */ colorBalance_init_data, /* init_data */
NULL, /* free_data */ NULL, /* free_data */
NULL, /* copy_data */ NULL, /* copy_data */
colorBalance_apply /* apply */ colorBalance_apply /* apply */
}; };
/* **** Curves Modifier **** */ /* **** Curves Modifier **** */
@ -271,13 +273,13 @@ static void curves_apply(struct SequenceModifierData *smd, ImBuf *ibuf, ImBuf *m
} }
static SequenceModifierTypeInfo seqModifier_Curves = { static SequenceModifierTypeInfo seqModifier_Curves = {
"Curves", /* name */ CTX_N_(BLF_I18NCONTEXT_ID_SEQUENCE, "Curves"), /* name */
"CurvesModifierData", /* struct_name */ "CurvesModifierData", /* struct_name */
sizeof(CurvesModifierData), /* struct_size */ sizeof(CurvesModifierData), /* struct_size */
curves_init_data, /* init_data */ curves_init_data, /* init_data */
curves_free_data, /* free_data */ curves_free_data, /* free_data */
curves_copy_data, /* copy_data */ curves_copy_data, /* copy_data */
curves_apply /* apply */ curves_apply /* apply */
}; };
/* **** Hue Correct Modifier **** */ /* **** Hue Correct Modifier **** */
@ -379,13 +381,13 @@ static void hue_correct_apply(struct SequenceModifierData *smd, ImBuf *ibuf, ImB
} }
static SequenceModifierTypeInfo seqModifier_HueCorrect = { static SequenceModifierTypeInfo seqModifier_HueCorrect = {
"Hue Correct", /* name */ CTX_N_(BLF_I18NCONTEXT_ID_SEQUENCE, "Hue Correct"), /* name */
"HueCorrectModifierData", /* struct_name */ "HueCorrectModifierData", /* struct_name */
sizeof(HueCorrectModifierData), /* struct_size */ sizeof(HueCorrectModifierData), /* struct_size */
hue_correct_init_data, /* init_data */ hue_correct_init_data, /* init_data */
hue_correct_free_data, /* free_data */ hue_correct_free_data, /* free_data */
hue_correct_copy_data, /* copy_data */ hue_correct_copy_data, /* copy_data */
hue_correct_apply /* apply */ hue_correct_apply /* apply */
}; };
/* **** Bright/Contrast Modifier **** */ /* **** Bright/Contrast Modifier **** */
@ -476,13 +478,13 @@ static void brightcontrast_apply(struct SequenceModifierData *smd, ImBuf *ibuf,
} }
static SequenceModifierTypeInfo seqModifier_BrightContrast = { static SequenceModifierTypeInfo seqModifier_BrightContrast = {
"Bright/Contrast", /* name */ CTX_N_(BLF_I18NCONTEXT_ID_SEQUENCE, "Bright/Contrast"), /* name */
"BrightContrastModifierData", /* struct_name */ "BrightContrastModifierData", /* struct_name */
sizeof(BrightContrastModifierData), /* struct_size */ sizeof(BrightContrastModifierData), /* struct_size */
NULL, /* init_data */ NULL, /* init_data */
NULL, /* free_data */ NULL, /* free_data */
NULL, /* copy_data */ NULL, /* copy_data */
brightcontrast_apply /* apply */ brightcontrast_apply /* apply */
}; };
/*********************** Modifier functions *************************/ /*********************** Modifier functions *************************/
@ -572,7 +574,8 @@ void BKE_sequence_modifier_unique_name(Sequence *seq, SequenceModifierData *smd)
{ {
SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type); SequenceModifierTypeInfo *smti = BKE_sequence_modifier_type_info_get(smd->type);
BLI_uniquename(&seq->modifiers, smd, smti->name, '.', offsetof(SequenceModifierData, name), sizeof(smd->name)); BLI_uniquename(&seq->modifiers, smd, CTX_DATA_(BLF_I18NCONTEXT_ID_SEQUENCE, smti->name), '.',
offsetof(SequenceModifierData, name), sizeof(smd->name));
} }
SequenceModifierData *BKE_sequence_modifier_find_by_name(Sequence *seq, char *name) SequenceModifierData *BKE_sequence_modifier_find_by_name(Sequence *seq, char *name)

@ -535,7 +535,8 @@ MovieTrackingTrack *BKE_tracking_track_add(MovieTracking *tracking, ListBase *tr
void BKE_tracking_track_unique_name(ListBase *tracksbase, MovieTrackingTrack *track) void BKE_tracking_track_unique_name(ListBase *tracksbase, MovieTrackingTrack *track)
{ {
BLI_uniquename(tracksbase, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name)); BLI_uniquename(tracksbase, track, CTX_DATA_(BLF_I18NCONTEXT_ID_MOVIECLIP, "Track"), '.',
offsetof(MovieTrackingTrack, name), sizeof(track->name));
} }
void BKE_tracking_track_free(MovieTrackingTrack *track) void BKE_tracking_track_free(MovieTrackingTrack *track)
@ -1234,7 +1235,7 @@ int BKE_tracking_object_delete(MovieTracking *tracking, MovieTrackingObject *obj
void BKE_tracking_object_unique_name(MovieTracking *tracking, MovieTrackingObject *object) void BKE_tracking_object_unique_name(MovieTracking *tracking, MovieTrackingObject *object)
{ {
BLI_uniquename(&tracking->objects, object, "Object", '.', BLI_uniquename(&tracking->objects, object, DATA_("Object"), '.',
offsetof(MovieTrackingObject, name), sizeof(object->name)); offsetof(MovieTrackingObject, name), sizeof(object->name));
} }
@ -2095,7 +2096,8 @@ static void tracks_map_merge(TracksMap *map, MovieTracking *tracking)
track->next = track->prev = NULL; track->next = track->prev = NULL;
BLI_addtail(&new_tracks, track); BLI_addtail(&new_tracks, track);
BLI_uniquename(&new_tracks, track, "Track", '.', offsetof(MovieTrackingTrack, name), sizeof(track->name)); BLI_uniquename(&new_tracks, track, CTX_DATA_(BLF_I18NCONTEXT_ID_MOVIECLIP, "Track"), '.',
offsetof(MovieTrackingTrack, name), sizeof(track->name));
track = next; track = next;
} }

@ -38,6 +38,8 @@
#include "BLI_path_util.h" #include "BLI_path_util.h"
#include "BLI_string.h" #include "BLI_string.h"
#include "BLF_translation.h"
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_armature.h" #include "BKE_armature.h"
#include "BKE_fcurve.h" #include "BKE_fcurve.h"
@ -217,7 +219,8 @@ void AnimationImporter::add_fcurves_to_object(Object *ob, std::vector<FCurve *>&
BLI_strncpy(grp->name, bone_name, sizeof(grp->name)); BLI_strncpy(grp->name, bone_name, sizeof(grp->name));
BLI_addtail(&act->groups, grp); BLI_addtail(&act->groups, grp);
BLI_uniquename(&act->groups, grp, "Group", '.', offsetof(bActionGroup, name), 64); BLI_uniquename(&act->groups, grp, CTX_DATA_(BLF_I18NCONTEXT_ID_ACTION, "Group"), '.',
offsetof(bActionGroup, name), 64);
} }
/* add F-Curve to group */ /* add F-Curve to group */
@ -1968,14 +1971,15 @@ void AnimationImporter::add_bone_fcurve(Object *ob, COLLADAFW::Node *node, FCurv
if (grp == NULL) { if (grp == NULL) {
/* Add a new group, and make it active */ /* Add a new group, and make it active */
grp = (bActionGroup *)MEM_callocN(sizeof(bActionGroup), "bActionGroup"); grp = (bActionGroup *)MEM_callocN(sizeof(bActionGroup), "bActionGroup");
grp->flag = AGRP_SELECTED; grp->flag = AGRP_SELECTED;
BLI_strncpy(grp->name, bone_name, sizeof(grp->name)); BLI_strncpy(grp->name, bone_name, sizeof(grp->name));
BLI_addtail(&act->groups, grp); BLI_addtail(&act->groups, grp);
BLI_uniquename(&act->groups, grp, "Group", '.', offsetof(bActionGroup, name), 64); BLI_uniquename(&act->groups, grp, CTX_DATA_(BLF_I18NCONTEXT_ID_ACTION, "Group"), '.',
offsetof(bActionGroup, name), 64);
} }
/* add F-Curve to group */ /* add F-Curve to group */
action_groups_add_channel(act, grp, fcu); action_groups_add_channel(act, grp, fcu);
} }

@ -29,6 +29,7 @@ set(INC
. .
../blenkernel ../blenkernel
../blenlib ../blenlib
../blenfont
../blenloader ../blenloader
../editors/include ../editors/include
../makesdna ../makesdna
@ -107,6 +108,10 @@ if(WITH_BUILDINFO)
add_definitions(-DWITH_BUILDINFO) add_definitions(-DWITH_BUILDINFO)
endif() endif()
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
if(CMAKE_COMPILER_IS_GNUCXX) if(CMAKE_COMPILER_IS_GNUCXX)
# COLLADAFWArray.h gives error with gcc 4.5 # COLLADAFWArray.h gives error with gcc 4.5
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fpermissive")

@ -32,12 +32,42 @@ defs = []
# TODO sanitize inc path building # TODO sanitize inc path building
# relative paths to include dirs, space-separated, string # relative paths to include dirs, space-separated, string
incs = [
'../ikplugin',
'#/intern/iksolver/extern',
'../blenlib',
'../blenfont',
'../blenkernel',
'../windowmanager',
'../blenloader',
'../makesdna',
'../makesrna',
'../editors/include',
'../imbuf',
'../bmesh',
'#/intern/guardedalloc',
]
if env['OURPLATFORM']=='darwin': if env['OURPLATFORM']=='darwin':
incs = '../ikplugin ../../../intern/iksolver/extern ../blenlib ../blenkernel ../windowmanager ../blenloader ../makesdna ../makesrna ../editors/include ../imbuf ../bmesh ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter [OPENCOLLADA]/COLLADABaseUtils [OPENCOLLADA]/COLLADAFramework [OPENCOLLADA]/COLLADASaxFrameworkLoader [OPENCOLLADA]/GeneratedSaxParser '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC']) incs += [
env['BF_OPENCOLLADA_INC'] + '/COLLADAStreamWriter',
env['BF_OPENCOLLADA_INC'] + '/COLLADABaseUtils',
env['BF_OPENCOLLADA_INC'] + '/COLLADAFramework',
env['BF_OPENCOLLADA_INC'] + '/COLLADASaxFrameworkLoader',
env['BF_OPENCOLLADA_INC'] + '/GeneratedSaxParser',
]
else: else:
incs = '../ikplugin ../../../intern/iksolver/extern ../blenlib ../blenkernel ../windowmanager ../makesdna ../blenloader ../makesrna ../editors/include ../imbuf ../bmesh ../../../intern/guardedalloc [OPENCOLLADA]/COLLADAStreamWriter/include [OPENCOLLADA]/COLLADABaseUtils/include [OPENCOLLADA]/COLLADAFramework/include [OPENCOLLADA]/COLLADASaxFrameworkLoader/include [OPENCOLLADA]/GeneratedSaxParser/include '.replace('[OPENCOLLADA]', env['BF_OPENCOLLADA_INC']) incs += [
env['BF_OPENCOLLADA_INC'] + '/COLLADAStreamWriter/include',
env['BF_OPENCOLLADA_INC'] + '/COLLADABaseUtils/include',
env['BF_OPENCOLLADA_INC'] + '/COLLADAFramework/include',
env['BF_OPENCOLLADA_INC'] + '/COLLADASaxFrameworkLoader/include',
env['BF_OPENCOLLADA_INC'] + '/GeneratedSaxParser/include',
]
if env['BF_BUILDINFO']: if env['BF_BUILDINFO']:
defs.append('WITH_BUILDINFO') defs.append('WITH_BUILDINFO')
env.BlenderLib ('bf_collada', sources, Split(incs), defs, libtype='core', priority=200 ) if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
env.BlenderLib ('bf_collada', sources, incs, defs, libtype='core', priority=200 )

@ -38,6 +38,8 @@
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_ghash.h" #include "BLI_ghash.h"
#include "BLF_translation.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_action.h" #include "BKE_action.h"
#include "BKE_armature.h" #include "BKE_armature.h"
@ -85,7 +87,7 @@ void unique_editbone_name(ListBase *edbo, char *name, EditBone *bone)
data.lb = edbo; data.lb = edbo;
data.bone = bone; data.bone = bone;
BLI_uniquename_cb(editbone_unique_check, &data, "Bone", '.', name, sizeof(bone->name)); BLI_uniquename_cb(editbone_unique_check, &data, DATA_("Bone"), '.', name, sizeof(bone->name));
} }
/* ************************************************** */ /* ************************************************** */
@ -98,7 +100,7 @@ static bool bone_unique_check(void *arg, const char *name)
static void unique_bone_name(bArmature *arm, char *name) static void unique_bone_name(bArmature *arm, char *name)
{ {
BLI_uniquename_cb(bone_unique_check, (void *)arm, "Bone", '.', name, sizeof(((Bone *)NULL)->name)); BLI_uniquename_cb(bone_unique_check, (void *)arm, DATA_("Bone"), '.', name, sizeof(((Bone *)NULL)->name));
} }
/* helper call for armature_bone_rename */ /* helper call for armature_bone_rename */

@ -462,7 +462,7 @@ static int poselib_add_exec(bContext *C, wmOperator *op)
} }
/* validate name */ /* validate name */
BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name)); BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name));
/* use Keying Set to determine what to store for the pose */ /* use Keying Set to determine what to store for the pose */
/* FIXME: in the past, the Keying Set respected selections (LocRotScale), but the current one doesn't /* FIXME: in the past, the Keying Set respected selections (LocRotScale), but the current one doesn't
@ -666,7 +666,7 @@ static int poselib_rename_exec(bContext *C, wmOperator *op)
/* copy name and validate it */ /* copy name and validate it */
BLI_strncpy(marker->name, newname, sizeof(marker->name)); BLI_strncpy(marker->name, newname, sizeof(marker->name));
BLI_uniquename(&act->markers, marker, "Pose", '.', offsetof(TimeMarker, name), sizeof(marker->name)); BLI_uniquename(&act->markers, marker, DATA_("Pose"), '.', offsetof(TimeMarker, name), sizeof(marker->name));
/* send notifiers for this - using keyframe editing notifiers, since action /* send notifiers for this - using keyframe editing notifiers, since action
* may be being shown in anim editors as active action * may be being shown in anim editors as active action

@ -6150,20 +6150,20 @@ static const char *get_curve_defname(int type)
if ((type & CU_TYPE) == CU_BEZIER) { if ((type & CU_TYPE) == CU_BEZIER) {
switch (stype) { switch (stype) {
case CU_PRIM_CURVE: return DATA_("BezierCurve"); case CU_PRIM_CURVE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "BezierCurve");
case CU_PRIM_CIRCLE: return DATA_("BezierCircle"); case CU_PRIM_CIRCLE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "BezierCircle");
case CU_PRIM_PATH: return DATA_("CurvePath"); case CU_PRIM_PATH: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "CurvePath");
default: default:
return DATA_("Curve"); return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "Curve");
} }
} }
else { else {
switch (stype) { switch (stype) {
case CU_PRIM_CURVE: return DATA_("NurbsCurve"); case CU_PRIM_CURVE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "NurbsCurve");
case CU_PRIM_CIRCLE: return DATA_("NurbsCircle"); case CU_PRIM_CIRCLE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "NurbsCircle");
case CU_PRIM_PATH: return DATA_("NurbsPath"); case CU_PRIM_PATH: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "NurbsPath");
default: default:
return DATA_("Curve"); return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "Curve");
} }
} }
} }
@ -6173,13 +6173,13 @@ static const char *get_surf_defname(int type)
int stype = type & CU_PRIMITIVE; int stype = type & CU_PRIMITIVE;
switch (stype) { switch (stype) {
case CU_PRIM_CURVE: return DATA_("SurfCurve"); case CU_PRIM_CURVE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfCurve");
case CU_PRIM_CIRCLE: return DATA_("SurfCircle"); case CU_PRIM_CIRCLE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfCircle");
case CU_PRIM_PATCH: return DATA_("SurfPatch"); case CU_PRIM_PATCH: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfPatch");
case CU_PRIM_SPHERE: return DATA_("SurfSphere"); case CU_PRIM_SPHERE: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfSphere");
case CU_PRIM_DONUT: return DATA_("SurfTorus"); case CU_PRIM_DONUT: return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "SurfTorus");
default: default:
return DATA_("Surface"); return CTX_DATA_(BLF_I18NCONTEXT_ID_CURVE, "Surface");
} }
} }

@ -108,7 +108,7 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op)
unsigned int layer; unsigned int layer;
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Plane"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Plane"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out", if (!EDBM_op_call_and_selectf(em, op, "verts.out",
@ -149,7 +149,7 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op)
unsigned int layer; unsigned int layer;
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Cube"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cube"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_cube matrix=%m4 size=%f", mat, dia * 2.0f)) { if (!EDBM_op_call_and_selectf(em, op, "verts.out", "create_cube matrix=%m4 size=%f", mat, dia * 2.0f)) {
@ -198,7 +198,7 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op)
cap_tri = (cap_end == 2); cap_tri = (cap_end == 2);
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Circle"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Circle"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out", if (!EDBM_op_call_and_selectf(em, op, "verts.out",
@ -253,7 +253,7 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op)
cap_tri = (cap_end == 2); cap_tri = (cap_end == 2);
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Cylinder"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cylinder"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf( if (!EDBM_op_call_and_selectf(
@ -314,7 +314,7 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op)
cap_tri = (cap_end == 2); cap_tri = (cap_end == 2);
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Cone"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Cone"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf( if (!EDBM_op_call_and_selectf(
@ -371,7 +371,7 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op)
unsigned int layer; unsigned int layer;
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Grid"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Grid"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out", if (!EDBM_op_call_and_selectf(em, op, "verts.out",
@ -427,7 +427,7 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op)
if (!view_aligned) if (!view_aligned)
rot[0] += (float)M_PI / 2.0f; rot[0] += (float)M_PI / 2.0f;
obedit = make_prim_init(C, DATA_("Suzanne"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Suzanne"), &dia, mat, &state, loc, rot, layer);
mat[0][0] *= dia; mat[0][0] *= dia;
mat[1][1] *= dia; mat[1][1] *= dia;
mat[2][2] *= dia; mat[2][2] *= dia;
@ -470,7 +470,7 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op)
unsigned int layer; unsigned int layer;
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Sphere"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Sphere"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf(em, op, "verts.out", if (!EDBM_op_call_and_selectf(em, op, "verts.out",
@ -522,7 +522,7 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op)
unsigned int layer; unsigned int layer;
ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL); ED_object_add_generic_get_opts(C, op, loc, rot, &enter_editmode, &layer, NULL);
obedit = make_prim_init(C, DATA_("Icosphere"), &dia, mat, &state, loc, rot, layer); obedit = make_prim_init(C, CTX_DATA_(BLF_I18NCONTEXT_ID_MESH, "Icosphere"), &dia, mat, &state, loc, rot, layer);
em = BMEdit_FromObject(obedit); em = BMEdit_FromObject(obedit);
if (!EDBM_op_call_and_selectf( if (!EDBM_op_call_and_selectf(

@ -452,7 +452,7 @@ static int effector_add_exec(bContext *C, wmOperator *op)
if (!ob) if (!ob)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
rename_id(&ob->id, DATA_("CurveGuide")); rename_id(&ob->id, CTX_DATA_(BLF_I18NCONTEXT_ID_OBJECT, "CurveGuide"));
((Curve *)ob->data)->flag |= CU_PATH | CU_3D; ((Curve *)ob->data)->flag |= CU_PATH | CU_3D;
ED_object_editmode_enter(C, 0); ED_object_editmode_enter(C, 0);
ED_object_new_primitive_matrix(C, ob, loc, rot, mat, FALSE); ED_object_new_primitive_matrix(C, ob, loc, rot, mat, FALSE);
@ -465,7 +465,7 @@ static int effector_add_exec(bContext *C, wmOperator *op)
if (!ob) if (!ob)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
rename_id(&ob->id, DATA_("Field")); rename_id(&ob->id, CTX_DATA_(BLF_I18NCONTEXT_ID_OBJECT, "Field"));
if (ELEM(type, PFIELD_WIND, PFIELD_VORTEX)) if (ELEM(type, PFIELD_WIND, PFIELD_VORTEX))
ob->empty_drawtype = OB_SINGLE_ARROW; ob->empty_drawtype = OB_SINGLE_ARROW;
} }
@ -822,13 +822,13 @@ void OBJECT_OT_drop_named_image(wmOperatorType *ot)
static const char *get_lamp_defname(int type) static const char *get_lamp_defname(int type)
{ {
switch (type) { switch (type) {
case LA_LOCAL: return DATA_("Point"); case LA_LOCAL: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Point");
case LA_SUN: return DATA_("Sun"); case LA_SUN: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Sun");
case LA_SPOT: return DATA_("Spot"); case LA_SPOT: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Spot");
case LA_HEMI: return DATA_("Hemi"); case LA_HEMI: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Hemi");
case LA_AREA: return DATA_("Area"); case LA_AREA: return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Area");
default: default:
return DATA_("Lamp"); return CTX_DATA_(BLF_I18NCONTEXT_ID_LAMP, "Lamp");
} }
} }

@ -52,6 +52,8 @@
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_customdata.h" #include "BKE_customdata.h"
#include "BKE_deform.h" #include "BKE_deform.h"
@ -135,7 +137,7 @@ bDeformGroup *ED_vgroup_add_name(Object *ob, const char *name)
bDeformGroup *ED_vgroup_add(Object *ob) bDeformGroup *ED_vgroup_add(Object *ob)
{ {
return ED_vgroup_add_name(ob, "Group"); return ED_vgroup_add_name(ob, DATA_("Group"));
} }
void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup) void ED_vgroup_delete(Object *ob, bDeformGroup *defgroup)

@ -66,12 +66,14 @@ static int surface_slot_add_exec(bContext *C, wmOperator *UNUSED(op))
/* Make sure we're dealing with a canvas */ /* Make sure we're dealing with a canvas */
pmd = (DynamicPaintModifierData *)modifiers_findByType(cObject, eModifierType_DynamicPaint); pmd = (DynamicPaintModifierData *)modifiers_findByType(cObject, eModifierType_DynamicPaint);
if (!pmd || !pmd->canvas) return OPERATOR_CANCELLED; if (!pmd || !pmd->canvas)
return OPERATOR_CANCELLED;
canvas = pmd->canvas; canvas = pmd->canvas;
surface = dynamicPaint_createNewSurface(canvas, CTX_data_scene(C)); surface = dynamicPaint_createNewSurface(canvas, CTX_data_scene(C));
if (!surface) return OPERATOR_CANCELLED; if (!surface)
return OPERATOR_CANCELLED;
/* set preview for this surface only and set active */ /* set preview for this surface only and set active */
canvas->active_sur = 0; canvas->active_sur = 0;

@ -46,6 +46,8 @@
#include "BLI_math.h" #include "BLI_math.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_curve.h" #include "BKE_curve.h"
@ -376,7 +378,7 @@ static int new_material_exec(bContext *C, wmOperator *UNUSED(op))
ma = BKE_material_copy(ma); ma = BKE_material_copy(ma);
} }
else { else {
ma = BKE_material_add(bmain, "Material"); ma = BKE_material_add(bmain, DATA_("Material"));
if (BKE_scene_use_new_shading_nodes(scene)) { if (BKE_scene_use_new_shading_nodes(scene)) {
ED_node_shader_default(C, &ma->id); ED_node_shader_default(C, &ma->id);
@ -429,7 +431,7 @@ static int new_texture_exec(bContext *C, wmOperator *UNUSED(op))
if (tex) if (tex)
tex = BKE_texture_copy(tex); tex = BKE_texture_copy(tex);
else else
tex = add_texture(bmain, "Texture"); tex = add_texture(bmain, DATA_("Texture"));
/* hook into UI */ /* hook into UI */
uiIDContextProperty(C, &ptr, &prop); uiIDContextProperty(C, &ptr, &prop);

@ -3520,7 +3520,7 @@ static int scene_new_exec(bContext *C, wmOperator *op)
int type = RNA_enum_get(op->ptr, "type"); int type = RNA_enum_get(op->ptr, "type");
if (type == SCE_COPY_NEW) { if (type == SCE_COPY_NEW) {
newscene = BKE_scene_add(bmain, "Scene"); newscene = BKE_scene_add(bmain, DATA_("Scene"));
} }
else { /* different kinds of copying */ else { /* different kinds of copying */
newscene = BKE_scene_copy(scene, type); newscene = BKE_scene_copy(scene, type);

@ -506,8 +506,8 @@ static void namebutton_cb(bContext *C, void *tsep, char *oldname)
Object *ob = (Object *)tselem->id; // id = object Object *ob = (Object *)tselem->id; // id = object
bActionGroup *grp = te->directdata; bActionGroup *grp = te->directdata;
BLI_uniquename(&ob->pose->agroups, grp, "Group", '.', offsetof(bActionGroup, name), BLI_uniquename(&ob->pose->agroups, grp, CTX_DATA_(BLF_I18NCONTEXT_ID_ACTION, "Group"), '.',
sizeof(grp->name)); offsetof(bActionGroup, name), sizeof(grp->name));
WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob); WM_event_add_notifier(C, NC_OBJECT | ND_POSE, ob);
} }
break; break;

@ -2690,7 +2690,7 @@ void VIEW3D_OT_view_center_pick(wmOperatorType *ot)
{ {
/* identifiers */ /* identifiers */
ot->name = "Center View to Mouse"; ot->name = "Center View to Mouse";
ot->description = "Center the view to the ZDepth Position under the Mouse Cursor"; ot->description = "Center the view to the Z-depth position under the mouse cursor";
ot->idname = "VIEW3D_OT_view_center_pick"; ot->idname = "VIEW3D_OT_view_center_pick";
/* api callbacks */ /* api callbacks */

@ -96,7 +96,8 @@ static bool uniqueOrientationNameCheck(void *arg, const char *name)
static void uniqueOrientationName(ListBase *lb, char *name) static void uniqueOrientationName(ListBase *lb, char *name)
{ {
BLI_uniquename_cb(uniqueOrientationNameCheck, lb, "Space", '.', name, sizeof(((TransformOrientation *)NULL)->name)); BLI_uniquename_cb(uniqueOrientationNameCheck, lb, CTX_DATA_(BLF_I18NCONTEXT_ID_SCENE, "Space"), '.', name,
sizeof(((TransformOrientation *)NULL)->name));
} }
void BIF_createTransformOrientation(bContext *C, ReportList *reports, char *name, int use, int overwrite) void BIF_createTransformOrientation(bContext *C, ReportList *reports, char *name, int use, int overwrite)

@ -122,7 +122,7 @@ static void rna_Actuator_name_set(PointerRNA *ptr, const char *value)
if (ptr->id.data) { if (ptr->id.data) {
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->actuators, act, "Actuator", '.', offsetof(bActuator, name), sizeof(act->name)); BLI_uniquename(&ob->actuators, act, DATA_("Actuator"), '.', offsetof(bActuator, name), sizeof(act->name));
} }
} }

@ -31,6 +31,8 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "RNA_define.h" #include "RNA_define.h"
#include "rna_internal.h" #include "rna_internal.h"
@ -88,7 +90,8 @@ static void rna_Constroller_name_set(PointerRNA *ptr, const char *value)
if (ptr->id.data) { if (ptr->id.data) {
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->controllers, cont, "Controller", '.', offsetof(bController, name), sizeof(cont->name)); BLI_uniquename(&ob->controllers, cont, DATA_("Controller"), '.', offsetof(bController, name),
sizeof(cont->name));
} }
} }

@ -33,6 +33,8 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "RNA_access.h" #include "RNA_access.h"
#include "RNA_define.h" #include "RNA_define.h"
@ -110,7 +112,7 @@ static void rna_GPencilLayer_info_set(PointerRNA *ptr, const char *value)
/* copy the new name into the name slot */ /* copy the new name into the name slot */
BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info)); BLI_strncpy_utf8(gpl->info, value, sizeof(gpl->info));
BLI_uniquename(&gpd->layers, gpl, "GP_Layer", '.', offsetof(bGPDlayer, info), sizeof(gpl->info)); BLI_uniquename(&gpd->layers, gpl, DATA_("GP_Layer"), '.', offsetof(bGPDlayer, info), sizeof(gpl->info));
} }
static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count) static void rna_GPencil_stroke_point_add(bGPDstroke *stroke, int count)

@ -35,6 +35,8 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "RNA_access.h" #include "RNA_access.h"
#include "RNA_define.h" #include "RNA_define.h"
@ -81,7 +83,8 @@ static void rna_ShapeKey_name_set(PointerRNA *ptr, const char *value)
/* make sure the name is truly unique */ /* make sure the name is truly unique */
if (ptr->id.data) { if (ptr->id.data) {
Key *key = rna_ShapeKey_find_key(ptr->id.data); Key *key = rna_ShapeKey_find_key(ptr->id.data);
BLI_uniquename(&key->block, kb, "Key", '.', offsetof(KeyBlock, name), sizeof(kb->name)); BLI_uniquename(&key->block, kb, CTX_DATA_(BLF_I18NCONTEXT_ID_SHAPEKEY, "Key"), '.',
offsetof(KeyBlock, name), sizeof(kb->name));
} }
/* fix all the animation data which may link to this */ /* fix all the animation data which may link to this */

@ -1287,7 +1287,7 @@ static PointerRNA rna_Mesh_vertex_color_new(struct Mesh *me, const char *name)
static void rna_Mesh_vertex_color_remove(struct Mesh *me, ReportList *reports, CustomDataLayer *layer) static void rna_Mesh_vertex_color_remove(struct Mesh *me, ReportList *reports, CustomDataLayer *layer)
{ {
if (ED_mesh_color_remove_named(me, layer->name) == false) { if (ED_mesh_color_remove_named(me, layer->name) == false) {
BKE_reportf(reports, RPT_ERROR, "vertex color '%s' not found", layer->name); BKE_reportf(reports, RPT_ERROR, "Vertex color '%s' not found", layer->name);
} }
} }
@ -1383,7 +1383,7 @@ static PointerRNA rna_Mesh_uv_texture_new(struct Mesh *me, const char *name)
static void rna_Mesh_uv_texture_layers_remove(struct Mesh *me, ReportList *reports, CustomDataLayer *layer) static void rna_Mesh_uv_texture_layers_remove(struct Mesh *me, ReportList *reports, CustomDataLayer *layer)
{ {
if (ED_mesh_uv_texture_remove_named(me, layer->name) == false) { if (ED_mesh_uv_texture_remove_named(me, layer->name) == false) {
BKE_reportf(reports, RPT_ERROR, "texture layer '%s' not found", layer->name); BKE_reportf(reports, RPT_ERROR, "Texture layer '%s' not found", layer->name);
} }
} }

@ -45,6 +45,8 @@
#include "RNA_define.h" #include "RNA_define.h"
#include "RNA_enum_types.h" #include "RNA_enum_types.h"
#include "BLF_translation.h"
#include "rna_internal.h" #include "rna_internal.h"
#include "WM_types.h" #include "WM_types.h"
@ -871,7 +873,7 @@ static void rna_ParticleSystem_name_set(PointerRNA *ptr, const char *value)
/* copy the new name into the name slot */ /* copy the new name into the name slot */
BLI_strncpy_utf8(part->name, value, sizeof(part->name)); BLI_strncpy_utf8(part->name, value, sizeof(part->name));
BLI_uniquename(&ob->particlesystem, part, "ParticleSystem", '.', offsetof(ParticleSystem, name), BLI_uniquename(&ob->particlesystem, part, DATA_("ParticleSystem"), '.', offsetof(ParticleSystem, name),
sizeof(part->name)); sizeof(part->name));
} }

@ -41,6 +41,8 @@
#include "BLI_math.h" #include "BLI_math.h"
#include "BLF_translation.h"
#include "WM_types.h" #include "WM_types.h"
@ -156,7 +158,8 @@ static void rna_BoneGroup_name_set(PointerRNA *ptr, const char *value)
/* copy the new name into the name slot */ /* copy the new name into the name slot */
BLI_strncpy_utf8(agrp->name, value, sizeof(agrp->name)); BLI_strncpy_utf8(agrp->name, value, sizeof(agrp->name));
BLI_uniquename(&ob->pose->agroups, agrp, "Group", '.', offsetof(bActionGroup, name), sizeof(agrp->name)); BLI_uniquename(&ob->pose->agroups, agrp, CTX_DATA_(BLF_I18NCONTEXT_ID_ARMATURE, "Group"), '.',
offsetof(bActionGroup, name), sizeof(agrp->name));
} }
static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, bool create) static IDProperty *rna_PoseBone_idprops(PointerRNA *ptr, bool create)

@ -1113,7 +1113,7 @@ static void rna_SceneRenderLayer_name_set(PointerRNA *ptr, const char *value)
Scene *scene = (Scene *)ptr->id.data; Scene *scene = (Scene *)ptr->id.data;
SceneRenderLayer *rl = (SceneRenderLayer *)ptr->data; SceneRenderLayer *rl = (SceneRenderLayer *)ptr->data;
BLI_strncpy_utf8(rl->name, value, sizeof(rl->name)); BLI_strncpy_utf8(rl->name, value, sizeof(rl->name));
BLI_uniquename(&scene->r.layers, rl, "RenderLayer", '.', offsetof(SceneRenderLayer, name), sizeof(rl->name)); BLI_uniquename(&scene->r.layers, rl, DATA_("RenderLayer"), '.', offsetof(SceneRenderLayer, name), sizeof(rl->name));
if (scene->nodetree) { if (scene->nodetree) {
bNode *node; bNode *node;

@ -32,6 +32,8 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "RNA_define.h" #include "RNA_define.h"
#include "RNA_enum_types.h" #include "RNA_enum_types.h"
#include "RNA_access.h" #include "RNA_access.h"
@ -113,7 +115,7 @@ static void rna_Sensor_name_set(PointerRNA *ptr, const char *value)
if (ptr->id.data) { if (ptr->id.data) {
Object *ob = (Object *)ptr->id.data; Object *ob = (Object *)ptr->id.data;
BLI_uniquename(&ob->sensors, sens, "Sensor", '.', offsetof(bSensor, name), sizeof(sens->name)); BLI_uniquename(&ob->sensors, sens, DATA_("Sensor"), '.', offsetof(bSensor, name), sizeof(sens->name));
} }
} }