Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()...

This commit is contained in:
Bastien Montagne 2012-10-26 17:32:50 +00:00
parent 6abd7fda52
commit c9dade4fe0
73 changed files with 281 additions and 206 deletions

View File

@ -156,12 +156,14 @@ PYGETTEXT_KEYWORDS = (() +
for it in ("IFACE_", "TIP_", "N_")) + for it in ("IFACE_", "TIP_", "N_")) +
tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it) tuple((r"{}\(\s*" + _ctxt_re + r"\s*,\s*" + _msg_re + r"\s*\)").format(it)
for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) + for it in ("CTX_IFACE_", "CTX_TIP_", "CTX_N_")) +
tuple(("{}\\([^\"',]+,(?:[^\"',]+,)?\\s*" + _msg_re + r"\s*(?:\)|,)").format(it) tuple(("{}\\((?:[^\"',]+,){{1,2}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf")) for it in ("BKE_report", "BKE_reportf", "BKE_reports_prepend", "BKE_reports_prependf")) +
tuple(("{}\\((?:[^\"',]+,){{3}}\\s*" + _msg_re + r"\s*(?:\)|,)").format(it)
for it in ("BMO_error_raise",))
) )
ESCAPE_RE = ( ESCAPE_RE = (
('((?<!\\\\)"|(?<!\\\\)\\\\(?!\\\\|"))', r"\\\1"), (r'((?<!\\)"|(?<!\\)\\(?!\\|"))', r"\\\1"),
('\t', r"\\t"), ('\t', r"\\t"),
) )

View File

@ -91,6 +91,7 @@ dict_uimsgs = {
"fullscreen", "fullscreen",
"gridline", "gridline",
"hemi", "hemi",
"inbetween",
"inscatter", "inscattering", "inscatter", "inscattering",
"libdata", "libdata",
"lightless", "lightless",
@ -147,6 +148,7 @@ dict_uimsgs = {
"tilemode", "tilemode",
"timestamp", "timestamps", "timestamp", "timestamps",
"timestep", "timesteps", "timestep", "timesteps",
"todo",
"un", "un",
"unbake", "unbake",
"uncomment", "uncomment",
@ -235,6 +237,7 @@ dict_uimsgs = {
"quat", "quats", "quat", "quats",
"recalc", "recalcs", "recalc", "recalcs",
"refl", "refl",
"sel",
"spec", "spec",
"struct", "structs", "struct", "structs",
"tex", "tex",

View File

@ -32,6 +32,8 @@
#include "BLI_threads.h" #include "BLI_threads.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_armature_types.h" #include "DNA_armature_types.h"
#include "DNA_constraint_types.h" #include "DNA_constraint_types.h"
@ -848,7 +850,7 @@ static void surfaceGenerateGrid(struct DynamicPaintSurface *surface)
grid->s_num = MEM_reallocN(grid->s_num, sizeof(int) * grid_cells); grid->s_num = MEM_reallocN(grid->s_num, sizeof(int) * grid_cells);
if (error || !grid->s_num) { if (error || !grid->s_num) {
setError(surface->canvas, "Not enough free memory."); setError(surface->canvas, N_("Not enough free memory"));
freeGrid(sData); freeGrid(sData);
} }
} }
@ -1235,7 +1237,7 @@ static void dynamicPaint_allocateSurfaceType(DynamicPaintSurface *surface)
break; break;
} }
if (sData->type_data == NULL) setError(surface->canvas, "Not enough free memory!"); if (sData->type_data == NULL) setError(surface->canvas, N_("Not enough free memory"));
} }
static int surface_usesAdjDistance(DynamicPaintSurface *surface) static int surface_usesAdjDistance(DynamicPaintSurface *surface)
@ -1292,7 +1294,7 @@ static void dynamicPaint_initAdjacencyData(DynamicPaintSurface *surface, int for
if (!ad->n_index || !ad->n_num || !ad->n_target || !temp_data) { if (!ad->n_index || !ad->n_num || !ad->n_target || !temp_data) {
dynamicPaint_freeAdjData(sData); dynamicPaint_freeAdjData(sData);
if (temp_data) MEM_freeN(temp_data); if (temp_data) MEM_freeN(temp_data);
setError(surface->canvas, "Not enough free memory."); setError(surface->canvas, N_("Not enough free memory"));
return; return;
} }
@ -2165,8 +2167,10 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
int *final_index; int *final_index;
int aa_samples; int aa_samples;
if (!dm) return setError(canvas, "Canvas mesh not updated."); if (!dm)
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ) return setError(canvas, "Can't bake non-\"image sequence\" formats."); return setError(canvas, N_("Canvas mesh not updated"));
if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ)
return setError(canvas, N_("Cannot bake non-'image sequence' formats"));
numOfFaces = dm->getNumTessFaces(dm); numOfFaces = dm->getNumTessFaces(dm);
mface = dm->getTessFaceArray(dm); mface = dm->getTessFaceArray(dm);
@ -2176,8 +2180,10 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
tface = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname); tface = CustomData_get_layer_named(&dm->faceData, CD_MTFACE, uvname);
/* Check for validity */ /* Check for validity */
if (!tface) return setError(canvas, "No UV data on canvas."); if (!tface)
if (surface->image_resolution < 16 || surface->image_resolution > 8192) return setError(canvas, "Invalid resolution."); return setError(canvas, N_("No UV data on canvas"));
if (surface->image_resolution < 16 || surface->image_resolution > 8192)
return setError(canvas, N_("Invalid resolution"));
w = h = surface->image_resolution; w = h = surface->image_resolution;
@ -2189,7 +2195,8 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
/* Init data struct */ /* Init data struct */
if (surface->data) dynamicPaint_freeSurfaceData(surface); if (surface->data) dynamicPaint_freeSurfaceData(surface);
sData = surface->data = MEM_callocN(sizeof(PaintSurfaceData), "PaintSurfaceData"); sData = surface->data = MEM_callocN(sizeof(PaintSurfaceData), "PaintSurfaceData");
if (!surface->data) return setError(canvas, "Not enough free memory."); if (!surface->data)
return setError(canvas, N_("Not enough free memory"));
aa_samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1; aa_samples = (surface->flags & MOD_DPAINT_ANTIALIAS) ? 5 : 1;
tempPoints = (struct PaintUVPoint *) MEM_callocN(w * h * sizeof(struct PaintUVPoint), "Temp PaintUVPoint"); tempPoints = (struct PaintUVPoint *) MEM_callocN(w * h * sizeof(struct PaintUVPoint), "Temp PaintUVPoint");
@ -2547,7 +2554,8 @@ int dynamicPaint_createUVSurface(DynamicPaintSurface *surface)
} }
} }
} }
if (error == 1) setError(canvas, "Not enough free memory."); if (error == 1)
setError(canvas, N_("Not enough free memory"));
if (faceBB) MEM_freeN(faceBB); if (faceBB) MEM_freeN(faceBB);
if (tempPoints) MEM_freeN(tempPoints); if (tempPoints) MEM_freeN(tempPoints);
@ -2598,7 +2606,10 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
int format = (surface->image_fileformat & MOD_DPAINT_IMGFORMAT_OPENEXR) ? R_IMF_IMTYPE_OPENEXR : R_IMF_IMTYPE_PNG; int format = (surface->image_fileformat & MOD_DPAINT_IMGFORMAT_OPENEXR) ? R_IMF_IMTYPE_OPENEXR : R_IMF_IMTYPE_PNG;
char output_file[FILE_MAX]; char output_file[FILE_MAX];
if (!sData->type_data) { setError(surface->canvas, "Image save failed: Invalid surface."); return; } if (!sData->type_data) {
setError(surface->canvas, N_("Image save failed: invalid surface"));
return;
}
/* if selected format is openexr, but current build doesnt support one */ /* if selected format is openexr, but current build doesnt support one */
#ifndef WITH_OPENEXR #ifndef WITH_OPENEXR
if (format == R_IMF_IMTYPE_OPENEXR) format = R_IMF_IMTYPE_PNG; if (format == R_IMF_IMTYPE_OPENEXR) format = R_IMF_IMTYPE_PNG;
@ -2612,7 +2623,10 @@ void dynamicPaint_outputSurfaceImage(DynamicPaintSurface *surface, char *filenam
/* Init image buffer */ /* Init image buffer */
ibuf = IMB_allocImBuf(surface->image_resolution, surface->image_resolution, 32, IB_rectfloat); ibuf = IMB_allocImBuf(surface->image_resolution, surface->image_resolution, 32, IB_rectfloat);
if (ibuf == NULL) { setError(surface->canvas, "Image save failed: Not enough free memory."); return; } if (ibuf == NULL) {
setError(surface->canvas, N_("Image save failed: not enough free memory"));
return;
}
#pragma omp parallel for schedule(static) #pragma omp parallel for schedule(static)
for (index = 0; index < sData->total_points; index++) { for (index = 0; index < sData->total_points; index++) {
@ -4649,7 +4663,7 @@ static int dynamicPaint_generateBakeData(DynamicPaintSurface *surface, Scene *sc
if (bData->realCoord) MEM_freeN(bData->realCoord); if (bData->realCoord) MEM_freeN(bData->realCoord);
if (canvas_verts) MEM_freeN(canvas_verts); if (canvas_verts) MEM_freeN(canvas_verts);
return setError(surface->canvas, "Not enough free memory."); return setError(surface->canvas, N_("Not enough free memory"));
} }
new_bdata = 1; new_bdata = 1;
@ -4934,7 +4948,7 @@ static int dynamicPaint_doStep(Scene *scene, Object *ob, DynamicPaintSurface *su
/* Allocate memory for surface previous points to read unchanged values from */ /* Allocate memory for surface previous points to read unchanged values from */
prevPoint = MEM_mallocN(sData->total_points * sizeof(struct PaintPoint), "PaintSurfaceDataCopy"); prevPoint = MEM_mallocN(sData->total_points * sizeof(struct PaintPoint), "PaintSurfaceDataCopy");
if (!prevPoint) if (!prevPoint)
return setError(canvas, "Not enough free memory."); return setError(canvas, N_("Not enough free memory"));
/* Prepare effects and get number of required steps */ /* Prepare effects and get number of required steps */
steps = dynamicPaint_prepareEffectStep(surface, scene, ob, &force, timescale); steps = dynamicPaint_prepareEffectStep(surface, scene, ob, &force, timescale);

View File

@ -53,6 +53,8 @@
#include "BLI_threads.h" #include "BLI_threads.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "BKE_animsys.h" #include "BKE_animsys.h"
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_image.h" #include "BKE_image.h"
@ -3676,26 +3678,26 @@ int BKE_sequence_swap(Sequence *seq_a, Sequence *seq_b, const char **error_str)
char name[sizeof(seq_a->name)]; char name[sizeof(seq_a->name)];
if (seq_a->len != seq_b->len) { if (seq_a->len != seq_b->len) {
*error_str = "Strips must be the same length"; *error_str = N_("Strips must be the same length");
return 0; return 0;
} }
/* type checking, could be more advanced but disalow sound vs non-sound copy */ /* type checking, could be more advanced but disallow sound vs non-sound copy */
if (seq_a->type != seq_b->type) { if (seq_a->type != seq_b->type) {
if (seq_a->type == SEQ_TYPE_SOUND_RAM || seq_b->type == SEQ_TYPE_SOUND_RAM) { if (seq_a->type == SEQ_TYPE_SOUND_RAM || seq_b->type == SEQ_TYPE_SOUND_RAM) {
*error_str = "Strips were not compatible"; *error_str = N_("Strips were not compatible");
return 0; return 0;
} }
/* disallow effects to swap with non-effects strips */ /* disallow effects to swap with non-effects strips */
if ((seq_a->type & SEQ_TYPE_EFFECT) != (seq_b->type & SEQ_TYPE_EFFECT)) { if ((seq_a->type & SEQ_TYPE_EFFECT) != (seq_b->type & SEQ_TYPE_EFFECT)) {
*error_str = "Strips were not compatible"; *error_str = N_("Strips were not compatible");
return 0; return 0;
} }
if ((seq_a->type & SEQ_TYPE_EFFECT) && (seq_b->type & SEQ_TYPE_EFFECT)) { if ((seq_a->type & SEQ_TYPE_EFFECT) && (seq_b->type & SEQ_TYPE_EFFECT)) {
if (BKE_sequence_effect_get_num_inputs(seq_a->type) != BKE_sequence_effect_get_num_inputs(seq_b->type)) { if (BKE_sequence_effect_get_num_inputs(seq_a->type) != BKE_sequence_effect_get_num_inputs(seq_b->type)) {
*error_str = "Strips must have the same number of inputs"; *error_str = N_("Strips must have the same number of inputs");
return 0; return 0;
} }
} }

View File

@ -51,6 +51,8 @@
#include "BLI_string.h" #include "BLI_string.h"
#include "BLI_threads.h" #include "BLI_threads.h"
#include "BLF_translation.h"
#include "BKE_global.h" #include "BKE_global.h"
#include "BKE_tracking.h" #include "BKE_tracking.h"
#include "BKE_movieclip.h" #include "BKE_movieclip.h"
@ -2787,7 +2789,7 @@ int BKE_tracking_reconstruction_check(MovieTracking *tracking, MovieTrackingObje
return TRUE; return TRUE;
} }
else if (reconstruct_count_tracks_on_both_keyframes(tracking, object) < 8) { else if (reconstruct_count_tracks_on_both_keyframes(tracking, object) < 8) {
BLI_strncpy(error_msg, "At least 8 common tracks on both of keyframes are needed for reconstruction", BLI_strncpy(error_msg, N_("At least 8 common tracks on both of keyframes are needed for reconstruction"),
error_size); error_size);
return FALSE; return FALSE;
@ -2795,7 +2797,7 @@ int BKE_tracking_reconstruction_check(MovieTracking *tracking, MovieTrackingObje
return TRUE; return TRUE;
#else #else
BLI_strncpy(error_msg, "Blender is compiled without motion tracking library", error_size); BLI_strncpy(error_msg, N_("Blender is compiled without motion tracking library"), error_size);
(void) tracking; (void) tracking;
(void) object; (void) object;

View File

@ -1002,7 +1002,7 @@ FileData *blo_openblenderfile(const char *filepath, ReportList *reports)
if (gzfile == (gzFile)Z_NULL) { if (gzfile == (gzFile)Z_NULL) {
BKE_reportf(reports, RPT_WARNING, "Unable to open '%s': %s", BKE_reportf(reports, RPT_WARNING, "Unable to open '%s': %s",
filepath, errno ? strerror(errno) : TIP_("Unknown error reading file")); filepath, errno ? strerror(errno) : TIP_("unknown error reading file"));
return NULL; return NULL;
} }
else { else {
@ -4797,7 +4797,7 @@ static void lib_link_scene(FileData *fd, Main *main)
base->object = newlibadr_us(fd, sce->id.lib, base->object); base->object = newlibadr_us(fd, sce->id.lib, base->object);
if (base->object == NULL) { if (base->object == NULL) {
BKE_reportf_wrap(fd->reports, RPT_WARNING, "LIB ERROR: object lost from scene: '%s'", BKE_reportf_wrap(fd->reports, RPT_WARNING, TIP_("LIB ERROR: object lost from scene: '%s'"),
sce->id.name + 2); sce->id.name + 2);
BLI_remlink(&sce->base, base); BLI_remlink(&sce->base, base);
if (base == sce->basact) sce->basact = NULL; if (base == sce->basact) sce->basact = NULL;
@ -6025,11 +6025,11 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
if (newmain->curlib) { if (newmain->curlib) {
if (BLI_path_cmp(newmain->curlib->filepath, lib->filepath) == 0) { if (BLI_path_cmp(newmain->curlib->filepath, lib->filepath) == 0) {
BKE_reportf_wrap(fd->reports, RPT_WARNING, BKE_reportf_wrap(fd->reports, RPT_WARNING,
"Library '%s', '%s' had multiple instances, save and reload!", TIP_("Library '%s', '%s' had multiple instances, save and reload!"),
lib->name, lib->filepath); lib->name, lib->filepath);
change_idid_adr(fd->mainlist, fd, lib, newmain->curlib); change_idid_adr(fd->mainlist, fd, lib, newmain->curlib);
// change_idid_adr_fd(fd, lib, newmain->curlib); /* change_idid_adr_fd(fd, lib, newmain->curlib); */
BLI_remlink(&main->library, lib); BLI_remlink(&main->library, lib);
MEM_freeN(lib); MEM_freeN(lib);
@ -6043,8 +6043,10 @@ static void direct_link_library(FileData *fd, Library *lib, Main *main)
BLI_strncpy(lib->filepath, lib->name, sizeof(lib->name)); BLI_strncpy(lib->filepath, lib->name, sizeof(lib->name));
cleanup_path(fd->relabase, lib->filepath); cleanup_path(fd->relabase, lib->filepath);
// printf("direct_link_library: name %s\n", lib->name); #if 0
// printf("direct_link_library: filename %s\n", lib->filename); printf("direct_link_library: name %s\n", lib->name);
printf("direct_link_library: filename %s\n", lib->filename);
#endif
/* new main */ /* new main */
newmain= MEM_callocN(sizeof(Main), "directlink"); newmain= MEM_callocN(sizeof(Main), "directlink");
@ -7438,8 +7440,8 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
prop = BKE_bproperty_object_get(ob, "Text"); prop = BKE_bproperty_object_get(ob, "Text");
if (prop) { if (prop) {
BKE_reportf_wrap(fd->reports, RPT_WARNING, BKE_reportf_wrap(fd->reports, RPT_WARNING,
"Game property name conflict in object '%s':\ntext objects reserve the " TIP_("Game property name conflict in object '%s':\ntext objects reserve the "
"['Text'] game property to change their content through logic bricks", "['Text'] game property to change their content through logic bricks"),
ob->id.name + 2); ob->id.name + 2);
} }
} }
@ -9735,8 +9737,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (fd == NULL) { if (fd == NULL) {
/* printf and reports for now... its important users know this */ /* printf and reports for now... its important users know this */
BKE_reportf_wrap(basefd->reports, RPT_INFO, BKE_reportf_wrap(basefd->reports, RPT_INFO, TIP_("Read library: '%s', '%s'"),
"Read library: '%s', '%s'",
mainptr->curlib->filepath, mainptr->curlib->name); mainptr->curlib->filepath, mainptr->curlib->name);
fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports); fd = blo_openblenderfile(mainptr->curlib->filepath, basefd->reports);
@ -9789,8 +9790,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
else mainptr->curlib->filedata = NULL; else mainptr->curlib->filedata = NULL;
if (fd == NULL) { if (fd == NULL) {
BKE_reportf_wrap(basefd->reports, RPT_WARNING, BKE_reportf_wrap(basefd->reports, RPT_WARNING, TIP_("Cannot find lib '%s'"),
"Cannot find lib '%s'",
mainptr->curlib->filepath); mainptr->curlib->filepath);
} }
} }
@ -9809,7 +9809,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
append_id_part(fd, mainptr, id, &realid); append_id_part(fd, mainptr, id, &realid);
if (!realid) { if (!realid) {
BKE_reportf_wrap(fd->reports, RPT_WARNING, BKE_reportf_wrap(fd->reports, RPT_WARNING,
"LIB ERROR: %s: '%s' missing from '%s'", TIP_("LIB ERROR: %s: '%s' missing from '%s'"),
BKE_idcode_to_name(GS(id->name)), BKE_idcode_to_name(GS(id->name)),
id->name+2, mainptr->curlib->filepath); id->name+2, mainptr->curlib->filepath);
} }
@ -9841,7 +9841,7 @@ static void read_libraries(FileData *basefd, ListBase *mainlist)
if (id->flag & LIB_READ) { if (id->flag & LIB_READ) {
BLI_remlink(lbarray[a], id); BLI_remlink(lbarray[a], id);
BKE_reportf_wrap(basefd->reports, RPT_WARNING, BKE_reportf_wrap(basefd->reports, RPT_WARNING,
"LIB ERROR: %s: '%s' unread libblock missing from '%s'", TIP_("LIB ERROR: %s: '%s' unread lib block missing from '%s'"),
BKE_idcode_to_name(GS(id->name)), id->name + 2, mainptr->curlib->filepath); BKE_idcode_to_name(GS(id->name)), id->name + 2, mainptr->curlib->filepath);
change_idid_adr(mainlist, basefd, id, NULL); change_idid_adr(mainlist, basefd, id, NULL);

View File

@ -25,6 +25,7 @@
set(INC set(INC
. .
../blenfont
../blenkernel ../blenkernel
../blenlib ../blenlib
../makesdna ../makesdna
@ -118,4 +119,8 @@ if(WITH_BULLET)
add_definitions(-DWITH_BULLET) add_definitions(-DWITH_BULLET)
endif() endif()
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
blender_add_lib(bf_bmesh "${SRC}" "${INC}" "${INC_SYS}") blender_add_lib(bf_bmesh "${SRC}" "${INC}" "${INC_SYS}")

View File

@ -9,6 +9,7 @@ sources += env.Glob('tools/*.c')
incs = [ incs = [
'./', './',
'../blenfont',
'../blenlib', '../blenlib',
'../makesdna', '../makesdna',
'../blenkernel', '../blenkernel',
@ -21,4 +22,7 @@ defs = []
if env['WITH_BF_BULLET']: if env['WITH_BF_BULLET']:
defs.append('WITH_BULLET') defs.append('WITH_BULLET')
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( libname = 'bf_bmesh', sources = sources, includes = Split(incs), libtype = ['core','player'], defines=defs, priority=[100, 100], compileflags=cflags ) env.BlenderLib ( libname = 'bf_bmesh', sources = sources, includes = Split(incs), libtype = ['core','player'], defines=defs, priority=[100, 100], compileflags=cflags )

View File

@ -36,6 +36,8 @@
#include "BLI_listbase.h" #include "BLI_listbase.h"
#include "BLI_array.h" #include "BLI_array.h"
#include "BLF_translation.h"
#include "bmesh.h" #include "bmesh.h"
#include "intern/bmesh_private.h" #include "intern/bmesh_private.h"
@ -49,16 +51,16 @@ static int bmo_opname_to_opcode(const char *opname);
static const char *bmo_error_messages[] = { static const char *bmo_error_messages[] = {
NULL, NULL,
"Self intersection error", N_("Self intersection error"),
"Could not dissolve vert", N_("Could not dissolve vert"),
"Could not connect vertices", N_("Could not connect vertices"),
"Could not traverse mesh", N_("Could not traverse mesh"),
"Could not dissolve faces", N_("Could not dissolve faces"),
"Could not dissolve vertices", N_("Could not dissolve vertices"),
"Tessellation error", N_("Tessellation error"),
"Can not deal with non-manifold geometry", N_("Cannot deal with non-manifold geometry"),
"Invalid selection", N_("Invalid selection"),
"Internal mesh error", N_("Internal mesh error"),
}; };
@ -1241,7 +1243,9 @@ void BMO_error_raise(BMesh *bm, BMOperator *owner, int errcode, const char *msg)
BMOpError *err = MEM_callocN(sizeof(BMOpError), "bmop_error"); BMOpError *err = MEM_callocN(sizeof(BMOpError), "bmop_error");
err->errorcode = errcode; err->errorcode = errcode;
if (!msg) msg = bmo_error_messages[errcode]; if (!msg) {
msg = bmo_error_messages[errcode];
}
err->msg = msg; err->msg = msg;
err->op = owner; err->op = owner;

View File

@ -88,7 +88,7 @@ void bmo_extrude_discrete_faces_exec(BMesh *bm, BMOperator *op)
f2 = BM_face_create_ngon(bm, firstv, BM_edge_other_vert(edges[0], firstv), edges, f->len, FALSE); f2 = BM_face_create_ngon(bm, firstv, BM_edge_other_vert(edges[0], firstv), edges, f->len, FALSE);
if (UNLIKELY(f2 == NULL)) { if (UNLIKELY(f2 == NULL)) {
BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Extrude failed; could not create face"); BMO_error_raise(bm, op, BMERR_MESH_ERROR, "Extrude failed: could not create face");
BLI_array_free(edges); BLI_array_free(edges);
return; return;
} }

View File

@ -63,7 +63,7 @@ void bmo_slide_vert_exec(BMesh *bm, BMOperator *op)
if (G.debug & G_DEBUG) { if (G.debug & G_DEBUG) {
fprintf(stderr, "slide_vert: No vertex selected..."); fprintf(stderr, "slide_vert: No vertex selected...");
} }
BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide Error: Invalid selection."); BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide error: invalid selection");
return; return;
} }
@ -83,7 +83,7 @@ void bmo_slide_vert_exec(BMesh *bm, BMOperator *op)
if (G.debug & G_DEBUG) { if (G.debug & G_DEBUG) {
fprintf(stderr, "slide_vert: select a single edge\n"); fprintf(stderr, "slide_vert: select a single edge\n");
} }
BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide Error: Invalid selection."); BMO_error_raise(bm, op, BMERR_INVALID_SELECTION, "Vertex Slide error: invalid selection");
return; return;
} }

View File

@ -522,7 +522,7 @@ static int ed_markers_opwrap_invoke_custom(bContext *C, wmOperator *op, wmEvent
else if (op->type->exec) else if (op->type->exec)
retval = op->type->exec(C, op); retval = op->type->exec(C, op);
else else
BKE_report(op->reports, RPT_ERROR, "Programming error: operator doesn't actually have code to do anything!"); BKE_report(op->reports, RPT_ERROR, "Programming error: operator does not actually have code to do anything!");
/* return status modifications - for now, make this spacetype dependent as above */ /* return status modifications - for now, make this spacetype dependent as above */
if (sa->spacetype != SPACE_TIME) { if (sa->spacetype != SPACE_TIME) {
@ -1377,7 +1377,7 @@ static int ed_marker_make_links_scene_exec(bContext *C, wmOperator *op)
} }
if (scene_to == CTX_data_scene(C)) { if (scene_to == CTX_data_scene(C)) {
BKE_report(op->reports, RPT_ERROR, "Can't re-link markers into the same scene"); BKE_report(op->reports, RPT_ERROR, "Cannot re-link markers into the same scene");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -789,7 +789,7 @@ short insert_keyframe_direct(ReportList *reports, PointerRNA ptr, PropertyRNA *p
/* F-Curve not editable? */ /* F-Curve not editable? */
if (fcurve_is_keyframable(fcu) == 0) { if (fcurve_is_keyframable(fcu) == 0) {
BKE_reportf(reports, RPT_ERROR, BKE_reportf(reports, RPT_ERROR,
"F-Curve with path = '%s' [%d] cannot be keyframed, ensure that it is not locked or sampled, " "F-Curve with path '%s[%d]' cannot be keyframed, ensure that it is not locked or sampled, "
"and try removing F-Modifiers", "and try removing F-Modifiers",
fcu->rna_path, fcu->array_index); fcu->rna_path, fcu->array_index);
return 0; return 0;
@ -1028,7 +1028,7 @@ short delete_keyframe(ReportList *reports, ID *id, bAction *act, const char grou
cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP); cfra = BKE_nla_tweakedit_remap(adt, cfra, NLATIME_CONVERT_UNMAP);
} }
else { else {
BKE_reportf(reports, RPT_ERROR, "No action to delete keyframes from for ID = %s\n", id->name); BKE_reportf(reports, RPT_ERROR, "No action to delete keyframes from for ID = %s", id->name);
return 0; return 0;
} }
} }
@ -1126,7 +1126,7 @@ static short clear_keyframe(ReportList *reports, ID *id, bAction *act, const cha
act = adt->action; act = adt->action;
} }
else { else {
BKE_reportf(reports, RPT_ERROR, "No action to delete keyframes from for ID = %s\n", id->name); BKE_reportf(reports, RPT_ERROR, "No action to delete keyframes from for ID = %s", id->name);
return 0; return 0;
} }
} }
@ -1236,7 +1236,7 @@ static int insert_key_exec(bContext *C, wmOperator *op)
/* try to insert keyframes for the channels specified by KeyingSet */ /* try to insert keyframes for the channels specified by KeyingSet */
success = ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, cfra); success = ANIM_apply_keyingset(C, NULL, NULL, ks, MODIFYKEY_MODE_INSERT, cfra);
if (G.debug & G_DEBUG) if (G.debug & G_DEBUG)
BKE_reportf(op->reports, RPT_INFO, "Keying set '%s' - successfully added %d keyframes\n", ks->name, success); BKE_reportf(op->reports, RPT_INFO, "Keying set '%s' - successfully added %d keyframes", ks->name, success);
/* report failure or do updates? */ /* report failure or do updates? */
if (success == MODIFYKEY_INVALID_CONTEXT) { if (success == MODIFYKEY_INVALID_CONTEXT) {

View File

@ -947,7 +947,7 @@ int ANIM_apply_keyingset(bContext *C, ListBase *dsources, bAction *act, KeyingSe
/* skip path if no ID pointer is specified */ /* skip path if no ID pointer is specified */
if (ksp->id == NULL) { if (ksp->id == NULL) {
BKE_reportf(reports, RPT_WARNING, BKE_reportf(reports, RPT_WARNING,
"Skipping path in keying set, as it has no ID (KS = '%s', path = '%s'[%d])", "Skipping path in keying set, as it has no ID (KS = '%s', path = '%s[%d]')",
ks->name, ksp->rna_path, ksp->array_index); ks->name, ksp->rna_path, ksp->array_index);
continue; continue;
} }

View File

@ -2970,7 +2970,7 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op)
} }
else { else {
/* FIXME.. figure out a method for multiple bones */ /* FIXME.. figure out a method for multiple bones */
BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d\n", count); BKE_reportf(op->reports, RPT_ERROR, "Too many points selected: %d", count);
BLI_freelistN(&points); BLI_freelistN(&points);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -53,7 +53,6 @@
#include "BKE_modifier.h" #include "BKE_modifier.h"
#include "BKE_mesh.h" #include "BKE_mesh.h"
#ifdef RIGID_DEFORM #ifdef RIGID_DEFORM
#include "BLI_polardecomp.h" #include "BLI_polardecomp.h"
#endif #endif
@ -794,7 +793,7 @@ void heat_bone_weighting(Object *ob, Mesh *me, float (*verts)[3], int numsource,
} }
} }
else if (*err_str == NULL) { else if (*err_str == NULL) {
*err_str = "Bone Heat Weighting: failed to find solution for one or more bones"; *err_str = N_("Bone Heat Weighting: failed to find solution for one or more bones");
break; break;
} }

View File

@ -1361,7 +1361,7 @@ static int separate_exec(bContext *C, wmOperator *op)
oldedit = oldcu->editnurb; oldedit = oldcu->editnurb;
if (oldcu->key) { if (oldcu->key) {
BKE_report(op->reports, RPT_ERROR, "Can't separate a curve with vertex keys"); BKE_report(op->reports, RPT_ERROR, "Cannot separate a curve with vertex keys");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -3501,7 +3501,7 @@ static int set_spline_type_exec(bContext *C, wmOperator *op)
int changed = 0, type = RNA_enum_get(op->ptr, "type"); int changed = 0, type = RNA_enum_get(op->ptr, "type");
if (type == CU_CARDINAL || type == CU_BSPLINE) { if (type == CU_CARDINAL || type == CU_BSPLINE) {
BKE_report(op->reports, RPT_ERROR, "Not implemented yet"); BKE_report(op->reports, RPT_ERROR, "Not yet implemented");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -3833,7 +3833,7 @@ static void merge_2_nurb(wmOperator *op, ListBase *editnurb, Nurb *nu1, Nurb *nu
} }
if (nu1->pntsv != nu2->pntsv) { if (nu1->pntsv != nu2->pntsv) {
BKE_report(op->reports, RPT_ERROR, "Resolution doesn't match"); BKE_report(op->reports, RPT_ERROR, "Resolution does not match");
return; return;
} }
@ -3943,7 +3943,7 @@ static int merge_nurb(bContext *C, wmOperator *op)
} }
if (ok == 0) { if (ok == 0) {
BKE_report(op->reports, RPT_ERROR, "Resolution doesn't match"); BKE_report(op->reports, RPT_ERROR, "Resolution does not match");
BLI_freelistN(&nsortbase); BLI_freelistN(&nsortbase);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -4123,7 +4123,7 @@ static int make_segment_exec(bContext *C, wmOperator *op)
} }
if (!ok) { if (!ok) {
BKE_report(op->reports, RPT_ERROR, "Can't make segment"); BKE_report(op->reports, RPT_ERROR, "Cannot make segment");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -4376,7 +4376,7 @@ static int spin_exec(bContext *C, wmOperator *op)
unit_m4(viewmat); unit_m4(viewmat);
if (!spin_nurb(viewmat, obedit, axis, cent)) { if (!spin_nurb(viewmat, obedit, axis, cent)) {
BKE_report(op->reports, RPT_ERROR, "Can't spin"); BKE_report(op->reports, RPT_ERROR, "Cannot spin");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -5624,10 +5624,10 @@ static int select_nth_exec(bContext *C, wmOperator *op)
if (!CU_select_nth(obedit, nth)) { if (!CU_select_nth(obedit, nth)) {
if (obedit->type == OB_SURF) { if (obedit->type == OB_SURF) {
BKE_report(op->reports, RPT_ERROR, "Surface hasn't got active point"); BKE_report(op->reports, RPT_ERROR, "Surface has not got active point");
} }
else { else {
BKE_report(op->reports, RPT_ERROR, "Curve hasn't got active point"); BKE_report(op->reports, RPT_ERROR, "Curve has not got active point");
} }
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;

View File

@ -212,7 +212,7 @@ static int gp_data_add_exec(bContext *C, wmOperator *op)
bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL);
if (gpd_ptr == NULL) { if (gpd_ptr == NULL) {
BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go"); BKE_report(op->reports, RPT_ERROR, "Nowhere for grease pencil data to go");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else { else {
@ -260,7 +260,7 @@ static int gp_data_unlink_exec(bContext *C, wmOperator *op)
bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL); bGPdata **gpd_ptr = gpencil_data_get_pointers(C, NULL);
if (gpd_ptr == NULL) { if (gpd_ptr == NULL) {
BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go"); BKE_report(op->reports, RPT_ERROR, "Nowhere for grease pencil data to go");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else { else {
@ -299,7 +299,7 @@ static int gp_layer_add_exec(bContext *C, wmOperator *op)
/* if there's no existing Grease-Pencil data there, add some */ /* if there's no existing Grease-Pencil data there, add some */
if (gpd_ptr == NULL) { if (gpd_ptr == NULL) {
BKE_report(op->reports, RPT_ERROR, "Nowhere for Grease Pencil data to go"); BKE_report(op->reports, RPT_ERROR, "Nowhere for grease pencil data to go");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if (*gpd_ptr == NULL) if (*gpd_ptr == NULL)
@ -348,7 +348,7 @@ static int gp_actframe_delete_exec(bContext *C, wmOperator *op)
/* if there's no existing Grease-Pencil data there, add some */ /* if there's no existing Grease-Pencil data there, add some */
if (gpd == NULL) { if (gpd == NULL) {
BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data"); BKE_report(op->reports, RPT_ERROR, "No grease pencil data");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if (ELEM(NULL, gpl, gpf)) { if (ELEM(NULL, gpl, gpf)) {
@ -634,7 +634,7 @@ static int gp_convert_layer_exec(bContext *C, wmOperator *op)
/* check if there's data to work with */ /* check if there's data to work with */
if (gpd == NULL) { if (gpd == NULL) {
BKE_report(op->reports, RPT_ERROR, "No Grease Pencil data to work on"); BKE_report(op->reports, RPT_ERROR, "No grease pencil data to work on");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -807,7 +807,7 @@ static int editsource_text_edit(bContext *C, wmOperator *op,
} }
if (text == NULL) { if (text == NULL) {
BKE_reportf(op->reports, RPT_WARNING, "File: '%s' can't be opened", filepath); BKE_reportf(op->reports, RPT_WARNING, "File '%s' cannot be opened", filepath);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else { else {
@ -870,12 +870,12 @@ static int editsource_exec(bContext *C, wmOperator *op)
but_store->py_dbg_ln); but_store->py_dbg_ln);
} }
else { else {
BKE_report(op->reports, RPT_ERROR, "Active button isn't from a script, cant edit source"); BKE_report(op->reports, RPT_ERROR, "Active button is not from a script, cannot edit source");
ret = OPERATOR_CANCELLED; ret = OPERATOR_CANCELLED;
} }
} }
else { else {
BKE_report(op->reports, RPT_ERROR, "Active button match can't be found"); BKE_report(op->reports, RPT_ERROR, "Active button match cannot be found");
ret = OPERATOR_CANCELLED; ret = OPERATOR_CANCELLED;
} }
@ -973,12 +973,12 @@ static int edittranslation_exec(bContext *C, wmOperator *op)
uiStringInfo rna_ctxt = {BUT_GET_RNA_LABEL_CONTEXT, NULL}; uiStringInfo rna_ctxt = {BUT_GET_RNA_LABEL_CONTEXT, NULL};
if (!BLI_is_dir(root)) { if (!BLI_is_dir(root)) {
BKE_report(op->reports, RPT_ERROR, "Please set your User Preferences' \"Translation Branches " BKE_report(op->reports, RPT_ERROR, "Please set your User Preferences' 'Translation Branches "
"Directory\" path to a valid directory"); "Directory' path to a valid directory");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if (!WM_operatortype_find(EDTSRC_I18N_OP_NAME, 0)) { if (!WM_operatortype_find(EDTSRC_I18N_OP_NAME, 0)) {
BKE_reportf(op->reports, RPT_ERROR, "Could not find operator \"%s\"! Please enable ui_translate addon " BKE_reportf(op->reports, RPT_ERROR, "Could not find operator '%s'! Please enable ui_translate addon "
"in the User Preferences", EDTSRC_I18N_OP_NAME); "in the User Preferences", EDTSRC_I18N_OP_NAME);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -419,7 +419,7 @@ static int ringcut_invoke(bContext *C, wmOperator *op, wmEvent *evt)
float dist = 75.0f; float dist = 75.0f;
if (modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit)) if (modifiers_isDeformedByLattice(obedit) || modifiers_isDeformedByArmature(obedit))
BKE_report(op->reports, RPT_WARNING, "Loop cut doesn't work well on deformed edit mesh display"); BKE_report(op->reports, RPT_WARNING, "Loop cut does not work well on deformed edit mesh display");
view3d_operator_needs_opengl(C); view3d_operator_needs_opengl(C);

View File

@ -1007,7 +1007,7 @@ static int edbm_rip_invoke(bContext *C, wmOperator *op, wmEvent *event)
* with modified selection */ * with modified selection */
// WM_operator_name_call(C, "MESH_OT_region_to_loop", WM_OP_INVOKE_DEFAULT, NULL); // WM_operator_name_call(C, "MESH_OT_region_to_loop", WM_OP_INVOKE_DEFAULT, NULL);
BKE_report(op->reports, RPT_ERROR, "Can't rip selected faces"); BKE_report(op->reports, RPT_ERROR, "Cannot rip selected faces");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -2472,7 +2472,7 @@ static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op)
*/ */
if (em->selectmode == SCE_SELECT_FACE) { if (em->selectmode == SCE_SELECT_FACE) {
BKE_report(op->reports, RPT_ERROR, "Doesn't work in face selection mode"); BKE_report(op->reports, RPT_ERROR, "Does not work in face selection mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -3559,9 +3559,9 @@ void MESH_OT_dissolve_limited(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO; ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
prop = RNA_def_float_rotation(ot->srna, "angle_limit", 0, NULL, 0.0f, DEG2RADF(180.0f), prop = RNA_def_float_rotation(ot->srna, "angle_limit", 0, NULL, 0.0f, DEG2RADF(180.0f),
"Max Angle", "Angle Limit in Degrees", 0.0f, DEG2RADF(180.0f)); "Max Angle", "Angle limit", 0.0f, DEG2RADF(180.0f));
RNA_def_property_float_default(prop, DEG2RADF(15.0f)); RNA_def_property_float_default(prop, DEG2RADF(15.0f));
RNA_def_boolean(ot->srna, "use_dissolve_boundaries", 0, "All Boundries", RNA_def_boolean(ot->srna, "use_dissolve_boundaries", 0, "All Boundaries",
"Dissolve all vertices inbetween face boundaries"); "Dissolve all vertices inbetween face boundaries");
} }

View File

@ -113,7 +113,7 @@ int join_mesh_exec(bContext *C, wmOperator *op)
CustomData vdata, edata, fdata, ldata, pdata; CustomData vdata, edata, fdata, ldata, pdata;
if (scene->obedit) { if (scene->obedit) {
BKE_report(op->reports, RPT_WARNING, "Cannot join while in editmode"); BKE_report(op->reports, RPT_WARNING, "Cannot join while in edit mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -2057,11 +2057,11 @@ static int join_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C); Object *ob = CTX_data_active_object(C);
if (scene->obedit) { if (scene->obedit) {
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode"); BKE_report(op->reports, RPT_ERROR, "This data does not support joining in edit mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else if (BKE_object_obdata_is_libdata(ob)) { else if (BKE_object_obdata_is_libdata(ob)) {
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); BKE_report(op->reports, RPT_ERROR, "Cannot edit external libdata");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -2111,11 +2111,11 @@ static int join_shapes_exec(bContext *C, wmOperator *op)
Object *ob = CTX_data_active_object(C); Object *ob = CTX_data_active_object(C);
if (scene->obedit) { if (scene->obedit) {
BKE_report(op->reports, RPT_ERROR, "This data does not support joining in editmode"); BKE_report(op->reports, RPT_ERROR, "This data does not support joining in edit mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else if (BKE_object_obdata_is_libdata(ob)) { else if (BKE_object_obdata_is_libdata(ob)) {
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); BKE_report(op->reports, RPT_ERROR, "Cannot edit external libdata");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -967,7 +967,7 @@ static int multiresbake_check(bContext *C, wmOperator *op)
} }
if (mmd->lvl == 0) { if (mmd->lvl == 0) {
BKE_report(op->reports, RPT_ERROR, "Multires data baking is not support for preview subdivision level 0"); BKE_report(op->reports, RPT_ERROR, "Multires data baking is not supported for preview subdivision level 0");
break; break;
} }

View File

@ -807,7 +807,7 @@ static int childof_set_inverse_exec(bContext *C, wmOperator *op)
/* despite 3 layers of checks, we may still not be able to find a constraint */ /* despite 3 layers of checks, we may still not be able to find a constraint */
if (data == NULL) { if (data == NULL) {
printf("DEBUG: Child-Of Set Inverse - object = '%s'\n", (ob) ? ob->id.name + 2 : "<None>"); printf("DEBUG: Child-Of Set Inverse - object = '%s'\n", (ob) ? ob->id.name + 2 : "<None>");
BKE_report(op->reports, RPT_ERROR, "Couldn't find constraint data for Child-Of Set Inverse"); BKE_report(op->reports, RPT_ERROR, "Could not find constraint data for Child-Of Set Inverse");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1028,7 +1028,7 @@ static int objectsolver_set_inverse_exec(bContext *C, wmOperator *op)
/* despite 3 layers of checks, we may still not be able to find a constraint */ /* despite 3 layers of checks, we may still not be able to find a constraint */
if (data == NULL) { if (data == NULL) {
printf("DEBUG: Child-Of Set Inverse - object = '%s'\n", (ob) ? ob->id.name + 2 : "<None>"); printf("DEBUG: Child-Of Set Inverse - object = '%s'\n", (ob) ? ob->id.name + 2 : "<None>");
BKE_report(op->reports, RPT_ERROR, "Couldn't find constraint data for Child-Of Set Inverse"); BKE_report(op->reports, RPT_ERROR, "Could not find constraint data for Child-Of Set Inverse");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1628,15 +1628,15 @@ static int constraint_add_exec(bContext *C, wmOperator *op, Object *ob, ListBase
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if ((type == CONSTRAINT_TYPE_RIGIDBODYJOINT) && (list != &ob->constraints)) { if ((type == CONSTRAINT_TYPE_RIGIDBODYJOINT) && (list != &ob->constraints)) {
BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint Constraint can only be added to Objects"); BKE_report(op->reports, RPT_ERROR, "Rigid Body Joint constraint can only be added to objects");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if ((type == CONSTRAINT_TYPE_KINEMATIC) && ((!pchan) || (list != &pchan->constraints))) { if ((type == CONSTRAINT_TYPE_KINEMATIC) && ((!pchan) || (list != &pchan->constraints))) {
BKE_report(op->reports, RPT_ERROR, "IK Constraint can only be added to Bones"); BKE_report(op->reports, RPT_ERROR, "IK constraint can only be added to bones");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if ((type == CONSTRAINT_TYPE_SPLINEIK) && ((!pchan) || (list != &pchan->constraints))) { if ((type == CONSTRAINT_TYPE_SPLINEIK) && ((!pchan) || (list != &pchan->constraints))) {
BKE_report(op->reports, RPT_ERROR, "Spline IK Constraint can only be added to Bones"); BKE_report(op->reports, RPT_ERROR, "Spline IK constraint can only be added to bones");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1856,7 +1856,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
/* must have active bone */ /* must have active bone */
if (ELEM(NULL, ob, pchan)) { if (ELEM(NULL, ob, pchan)) {
BKE_report(op->reports, RPT_ERROR, "Must have active bone to add IK Constraint to"); BKE_report(op->reports, RPT_ERROR, "Must have an active bone to add IK constraint to");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1865,7 +1865,7 @@ static int pose_ik_add_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(evt))
if (con->type == CONSTRAINT_TYPE_KINEMATIC) break; if (con->type == CONSTRAINT_TYPE_KINEMATIC) break;
} }
if (con) { if (con) {
BKE_report(op->reports, RPT_ERROR, "Bone already has IK Constraint"); BKE_report(op->reports, RPT_ERROR, "Bone already has an IK constraint");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -195,7 +195,7 @@ static int objects_remove_active_exec(bContext *C, wmOperator *op)
} }
} }
if (!ok) BKE_report(op->reports, RPT_ERROR, "Active Object contains no groups"); if (!ok) BKE_report(op->reports, RPT_ERROR, "Active object contains no groups");
DAG_scene_sort(bmain, scene); DAG_scene_sort(bmain, scene);
WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL); WM_event_add_notifier(C, NC_GROUP | NA_EDITED, NULL);

View File

@ -515,12 +515,12 @@ static int object_add_hook_selob_exec(bContext *C, wmOperator *op)
CTX_DATA_END; CTX_DATA_END;
if (!obsel) { if (!obsel) {
BKE_report(op->reports, RPT_ERROR, "Can't add hook with no other selected objects"); BKE_report(op->reports, RPT_ERROR, "Cannot add hook with no other selected objects");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if (use_bone && obsel->type != OB_ARMATURE) { if (use_bone && obsel->type != OB_ARMATURE) {
BKE_report(op->reports, RPT_ERROR, "Can't add hook bone for a non armature object"); BKE_report(op->reports, RPT_ERROR, "Cannot add hook bone for a non armature object");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -590,7 +590,7 @@ static int object_hook_remove_exec(bContext *C, wmOperator *op)
hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num); hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
if (!hmd) { if (!hmd) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find hook modifier"); BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -673,7 +673,7 @@ static int object_hook_reset_exec(bContext *C, wmOperator *op)
hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num); hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
} }
if (!ob || !hmd) { if (!ob || !hmd) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find hook modifier"); BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -741,7 +741,7 @@ static int object_hook_recenter_exec(bContext *C, wmOperator *op)
hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num); hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
} }
if (!ob || !hmd) { if (!ob || !hmd) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find hook modifier"); BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -799,7 +799,7 @@ static int object_hook_assign_exec(bContext *C, wmOperator *op)
hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num); hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
} }
if (!ob || !hmd) { if (!ob || !hmd) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find hook modifier"); BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -861,7 +861,7 @@ static int object_hook_select_exec(bContext *C, wmOperator *op)
hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num); hmd = (HookModifierData *)BLI_findlink(&ob->modifiers, num);
} }
if (!ob || !hmd) { if (!ob || !hmd) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find hook modifier"); BKE_report(op->reports, RPT_ERROR, "Could not find hook modifier");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -99,13 +99,13 @@ ModifierData *ED_object_modifier_add(ReportList *reports, Main *bmain, Scene *sc
/* only geometry objects should be able to get modifiers [#25291] */ /* only geometry objects should be able to get modifiers [#25291] */
if (!ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) { if (!ELEM5(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_FONT, OB_LATTICE)) {
BKE_reportf(reports, RPT_WARNING, "Modifiers cannot be added to Object '%s'", ob->id.name + 2); BKE_reportf(reports, RPT_WARNING, "Modifiers cannot be added to object '%s'", ob->id.name + 2);
return NULL; return NULL;
} }
if (mti->flags & eModifierTypeFlag_Single) { if (mti->flags & eModifierTypeFlag_Single) {
if (modifiers_findByType(ob, type)) { if (modifiers_findByType(ob, type)) {
BKE_report(reports, RPT_WARNING, "Only one modifier of this type allowed"); BKE_report(reports, RPT_WARNING, "Only one modifier of this type is allowed");
return NULL; return NULL;
} }
} }
@ -556,7 +556,7 @@ static int modifier_apply_shape(ReportList *reports, Scene *scene, Object *ob, M
KeyBlock *kb; KeyBlock *kb;
if (!modifier_sameTopology(md) || mti->type == eModifierTypeType_NonGeometrical) { if (!modifier_sameTopology(md) || mti->type == eModifierTypeType_NonGeometrical) {
BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to Shapes"); BKE_report(reports, RPT_ERROR, "Only deforming modifiers can be applied to shapes");
return 0; return 0;
} }
@ -604,7 +604,7 @@ static int modifier_apply_obdata(ReportList *reports, Scene *scene, Object *ob,
MultiresModifierData *mmd = find_multires_modifier_before(scene, md); MultiresModifierData *mmd = find_multires_modifier_before(scene, md);
if (me->key && mti->type != eModifierTypeType_NonGeometrical) { if (me->key && mti->type != eModifierTypeType_NonGeometrical) {
BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to Mesh with Shape Keys"); BKE_report(reports, RPT_ERROR, "Modifier cannot be applied to a mesh with shape keys");
return 0; return 0;
} }
@ -681,7 +681,7 @@ int ED_object_modifier_apply(ReportList *reports, Scene *scene, Object *ob, Modi
int prev_mode; int prev_mode;
if (scene->obedit) { if (scene->obedit) {
BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in editmode"); BKE_report(reports, RPT_ERROR, "Modifiers cannot be applied in edit mode");
return 0; return 0;
} }
else if (((ID *) ob->data)->us > 1) { else if (((ID *) ob->data)->us > 1) {

View File

@ -628,7 +628,7 @@ int ED_object_parent_set(ReportList *reports, Main *bmain, Scene *scene, Object
pchan = BKE_pose_channel_active(par); pchan = BKE_pose_channel_active(par);
if (pchan == NULL) { if (pchan == NULL) {
BKE_report(reports, RPT_ERROR, "No active Bone"); BKE_report(reports, RPT_ERROR, "No active bone");
return 0; return 0;
} }
} }
@ -1036,7 +1036,7 @@ static int object_track_clear_exec(bContext *C, wmOperator *op)
int type = RNA_enum_get(op->ptr, "type"); int type = RNA_enum_get(op->ptr, "type");
if (CTX_data_edit_object(C)) { if (CTX_data_edit_object(C)) {
BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode"); BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in edit mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects) CTX_DATA_BEGIN (C, Object *, ob, selected_editable_objects)
@ -1350,17 +1350,17 @@ static int make_links_scene_exec(bContext *C, wmOperator *op)
Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene")); Scene *scene_to = BLI_findlink(&CTX_data_main(C)->scene, RNA_enum_get(op->ptr, "scene"));
if (scene_to == NULL) { if (scene_to == NULL) {
BKE_report(op->reports, RPT_ERROR, "Couldn't find scene"); BKE_report(op->reports, RPT_ERROR, "Could not find scene");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if (scene_to == CTX_data_scene(C)) { if (scene_to == CTX_data_scene(C)) {
BKE_report(op->reports, RPT_ERROR, "Can't link objects into the same scene"); BKE_report(op->reports, RPT_ERROR, "Cannot link objects into the same scene");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
if (scene_to->id.lib) { if (scene_to->id.lib) {
BKE_report(op->reports, RPT_ERROR, "Can't link objects into a linked scene"); BKE_report(op->reports, RPT_ERROR, "Cannot link objects into a linked scene");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -425,7 +425,7 @@ static int object_select_linked_exec(bContext *C, wmOperator *op)
ob = OBACT; ob = OBACT;
if (ob == NULL) { if (ob == NULL) {
BKE_report(op->reports, RPT_ERROR, "No Active Object"); BKE_report(op->reports, RPT_ERROR, "No active object");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -800,7 +800,7 @@ static int object_select_grouped_exec(bContext *C, wmOperator *op)
ob = OBACT; ob = OBACT;
if (ob == NULL) { if (ob == NULL) {
BKE_report(op->reports, RPT_ERROR, "No Active Object"); BKE_report(op->reports, RPT_ERROR, "No active object");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -217,7 +217,7 @@ static int object_clear_transform_generic_exec(bContext *C, wmOperator *op,
/* sanity checks */ /* sanity checks */
if (ELEM(NULL, clear_func, default_ksName)) { if (ELEM(NULL, clear_func, default_ksName)) {
BKE_report(op->reports, RPT_ERROR, "Programming error: missing clear transform function or Keying Set Name"); BKE_report(op->reports, RPT_ERROR, "Programming error: missing clear transform function or keying set name");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -390,19 +390,19 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
if (ob->type == OB_MESH) { if (ob->type == OB_MESH) {
if (ID_REAL_USERS(ob->data) > 1) { if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user mesh, doing nothing"); BKE_report(reports, RPT_ERROR, "Cannot apply to a multi user mesh, doing nothing");
change = 0; change = 0;
} }
} }
else if (ob->type == OB_ARMATURE) { else if (ob->type == OB_ARMATURE) {
if (ID_REAL_USERS(ob->data) > 1) { if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user armature, doing nothing"); BKE_report(reports, RPT_ERROR, "Cannot apply to a multi user armature, doing nothing");
change = 0; change = 0;
} }
} }
else if (ob->type == OB_LATTICE) { else if (ob->type == OB_LATTICE) {
if (ID_REAL_USERS(ob->data) > 1) { if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user lattice, doing nothing"); BKE_report(reports, RPT_ERROR, "Cannot apply to a multi user lattice, doing nothing");
change = 0; change = 0;
} }
} }
@ -410,7 +410,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
Curve *cu; Curve *cu;
if (ID_REAL_USERS(ob->data) > 1) { if (ID_REAL_USERS(ob->data) > 1) {
BKE_report(reports, RPT_ERROR, "Can't apply to a multi user curve, doing nothing"); BKE_report(reports, RPT_ERROR, "Cannot apply to a multi user curve, doing nothing");
change = 0; change = 0;
} }
@ -422,7 +422,7 @@ static int apply_objects_internal(bContext *C, ReportList *reports, int apply_lo
change = 0; change = 0;
} }
if (cu->key) { if (cu->key) {
BKE_report(reports, RPT_ERROR, "Can't apply to a curve with vertex keys, doing nothing"); BKE_report(reports, RPT_ERROR, "Cannot apply to a curve with vertex keys, doing nothing");
change = 0; change = 0;
} }
} }
@ -672,7 +672,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
int tot_change = 0, tot_lib_error = 0, tot_multiuser_arm_error = 0; int tot_change = 0, tot_lib_error = 0, tot_multiuser_arm_error = 0;
if (obedit && centermode != GEOMETRY_TO_ORIGIN) { if (obedit && centermode != GEOMETRY_TO_ORIGIN) {
BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in EditMode"); BKE_report(op->reports, RPT_ERROR, "Operation cannot be performed in edit mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else { else {
@ -854,7 +854,7 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
if (ID_REAL_USERS(arm) > 1) { if (ID_REAL_USERS(arm) > 1) {
#if 0 #if 0
BKE_report(op->reports, RPT_ERROR, "Can't apply to a multi user armature"); BKE_report(op->reports, RPT_ERROR, "Cannot apply to a multi user armature");
return; return;
#endif #endif
tot_multiuser_arm_error++; tot_multiuser_arm_error++;

View File

@ -3470,7 +3470,7 @@ static int vgroup_do_remap(Object *ob, char *name_array, wmOperator *op)
} }
} }
else { else {
BKE_report(op->reports, RPT_ERROR, "Editmode lattice isn't supported yet"); BKE_report(op->reports, RPT_ERROR, "Editmode lattice is not supported yet");
MEM_freeN(sort_map_update); MEM_freeN(sort_map_update);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -20,6 +20,7 @@
set(INC set(INC
../include ../include
../../blenfont
../../blenkernel ../../blenkernel
../../blenlib ../../blenlib
../../blenloader ../../blenloader
@ -54,4 +55,8 @@ if(WITH_OPENMP)
add_definitions(-DPARALLEL=1) add_definitions(-DPARALLEL=1)
endif() endif()
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
blender_add_lib(bf_editor_physics "${SRC}" "${INC}" "${INC_SYS}") blender_add_lib(bf_editor_physics "${SRC}" "${INC}" "${INC_SYS}")

View File

@ -3,12 +3,12 @@ Import ('env')
sources = env.Glob('*.c') sources = env.Glob('*.c')
incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf' incs = '../include ../../blenfont ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include' incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../gpu ../../blenloader ../../bmesh' incs += ' ../../gpu ../../blenloader ../../bmesh'
incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern' incs += ' ../../makesrna ../../render/extern/include #/intern/elbeem/extern'
defs = '' defs = []
if env['OURPLATFORM'] == 'linux': if env['OURPLATFORM'] == 'linux':
cflags='-pthread' cflags='-pthread'
@ -17,9 +17,11 @@ if env['OURPLATFORM'] == 'linux':
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC'] incs += ' ' + env['BF_PTHREADS_INC']
if env['OURPLATFORM'] == 'darwin': if env['OURPLATFORM'] == 'darwin':
if env['WITH_BF_OPENMP']: if env['WITH_BF_OPENMP']:
defs += ' PARALLEL=1' defs.append('PARALLEL=1')
env.BlenderLib ( 'bf_editors_physics', sources, Split(incs), Split(defs), libtype=['core'], priority=[45] ) if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( 'bf_editors_physics', sources, Split(incs), defs, libtype=['core'], priority=[45] )

View File

@ -26,6 +26,8 @@
#include "BLI_string.h" #include "BLI_string.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "DNA_dynamicpaint_types.h" #include "DNA_dynamicpaint_types.h"
#include "DNA_modifier_types.h" #include "DNA_modifier_types.h"
#include "DNA_object_types.h" #include "DNA_object_types.h"
@ -280,7 +282,10 @@ static int dynamicPaint_bakeImageSequence(bContext *C, DynamicPaintSurface *surf
int frames; int frames;
frames = surface->end_frame - surface->start_frame + 1; frames = surface->end_frame - surface->start_frame + 1;
if (frames <= 0) {BLI_strncpy(canvas->error, "No frames to bake.", sizeof(canvas->error)); return 0;} if (frames <= 0) {
BLI_strncpy(canvas->error, N_("No frames to bake"), sizeof(canvas->error));
return 0;
}
/* Set frame to start point (also inits modifier data) */ /* Set frame to start point (also inits modifier data) */
frame = surface->start_frame; frame = surface->start_frame;

View File

@ -902,7 +902,7 @@ static int fluidsimBake(bContext *C, ReportList *reports, Object *fsDomain, shor
/* make sure it corresponds to startFrame setting (old: noFrames = scene->r.efra - scene->r.sfra +1) */; /* make sure it corresponds to startFrame setting (old: noFrames = scene->r.efra - scene->r.sfra +1) */;
noFrames = scene->r.efra - 0; noFrames = scene->r.efra - 0;
if (noFrames<=0) { if (noFrames<=0) {
BKE_report(reports, RPT_ERROR, "No frames to export - check your animation range settings"); BKE_report(reports, RPT_ERROR, "No frames to export (check your animation range settings)");
fluidbake_free_data(channels, fobjects, fsset, fb); fluidbake_free_data(channels, fobjects, fsset, fb);
return 0; return 0;
} }

View File

@ -202,7 +202,7 @@ static int screen_render_exec(bContext *C, wmOperator *op)
screen_render_scene_layer_set(op, mainp, &scene, &srl); screen_render_scene_layer_set(op, mainp, &scene, &srl);
if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) { if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected"); BKE_report(op->reports, RPT_ERROR, "Cannot write a single file with an animation format selected");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -493,7 +493,7 @@ static int screen_render_invoke(bContext *C, wmOperator *op, wmEvent *event)
} }
if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) { if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected"); BKE_report(op->reports, RPT_ERROR, "Cannot write a single file with an animation format selected");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -308,7 +308,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
char err_out[256] = "unknown"; char err_out[256] = "unknown";
if (G.background) { if (G.background) {
BKE_report(op->reports, RPT_ERROR, "Can't use OpenGL render in background mode (no opengl context)"); BKE_report(op->reports, RPT_ERROR, "Cannot use OpenGL render in background mode (no opengl context)");
return 0; return 0;
} }
@ -329,7 +329,7 @@ static int screen_opengl_render_init(bContext *C, wmOperator *op)
} }
if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) { if (!is_animation && is_write_still && BKE_imtype_is_movie(scene->r.im_format.imtype)) {
BKE_report(op->reports, RPT_ERROR, "Can't write a single file with an animation format selected"); BKE_report(op->reports, RPT_ERROR, "Cannot write a single file with an animation format selected");
return 0; return 0;
} }

View File

@ -2905,7 +2905,7 @@ static void SCREEN_OT_header_toggle_menus(wmOperatorType *ot)
/* identifiers */ /* identifiers */
ot->name = "Show/Hide Header Menus"; ot->name = "Show/Hide Header Menus";
ot->idname = "SCREEN_OT_header_toggle_menus"; ot->idname = "SCREEN_OT_header_toggle_menus";
ot->description = "Show or Hide the header pulldown menus"; ot->description = "Show or hide the header pulldown menus";
/* api callbacks */ /* api callbacks */
ot->exec = header_toggle_menus_exec; ot->exec = header_toggle_menus_exec;

View File

@ -365,7 +365,7 @@ static void screenshot_startjob(void *sjv, short *stop, short *do_update, float
if (ok == 0) { if (ok == 0) {
printf("Write error: cannot save %s\n", name); printf("Write error: cannot save %s\n", name);
BKE_reportf(&sj->reports, RPT_INFO, "Write error: cannot save %s\n", name); BKE_reportf(&sj->reports, RPT_INFO, "Write error: cannot save %s", name);
break; break;
} }
else { else {

View File

@ -5654,7 +5654,7 @@ static int texture_paint_toggle_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if (BKE_object_obdata_is_libdata(ob)) { if (BKE_object_obdata_is_libdata(ob)) {
BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); BKE_report(op->reports, RPT_ERROR, "Cannot edit external libdata");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -493,7 +493,7 @@ static int actkeys_copy_exec(bContext *C, wmOperator *op)
/* copy keyframes */ /* copy keyframes */
if (ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) { if (ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
/* FIXME... */ /* FIXME... */
BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil mode"); BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for grease pencil mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else if (ac.datatype == ANIMCONT_MASK) { else if (ac.datatype == ANIMCONT_MASK) {
@ -543,7 +543,7 @@ static int actkeys_paste_exec(bContext *C, wmOperator *op)
/* paste keyframes */ /* paste keyframes */
if (ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) { if (ELEM(ac.datatype, ANIMCONT_GPENCIL, ANIMCONT_MASK)) {
/* FIXME... */ /* FIXME... */
BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for Grease Pencil or Mask mode"); BKE_report(op->reports, RPT_ERROR, "Keyframe pasting is not available for grease pencil or mask mode");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else { else {

View File

@ -162,7 +162,7 @@ static int file_browse_invoke(bContext *C, wmOperator *op, wmEvent *event)
char *str; char *str;
if (CTX_wm_space_file(C)) { if (CTX_wm_space_file(C)) {
BKE_report(op->reports, RPT_ERROR, "Can't activate a file selector, one already open"); BKE_report(op->reports, RPT_ERROR, "Cannot activate a file selector, one already open");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -197,8 +197,8 @@ static int open_exec(bContext *C, wmOperator *op)
if (op->customdata) if (op->customdata)
MEM_freeN(op->customdata); MEM_freeN(op->customdata);
BKE_reportf(op->reports, RPT_ERROR, "Can't read \"%s\": %s", str, BKE_reportf(op->reports, RPT_ERROR, "Cannot read '%s': %s", str,
errno ? strerror(errno) : TIP_("Unsupported movie clip format")); errno ? strerror(errno) : TIP_("unsupported movie clip format"));
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -1397,7 +1397,7 @@ static void solve_camera_freejob(void *scv)
solved = BKE_tracking_reconstruction_finish(scj->context, tracking); solved = BKE_tracking_reconstruction_finish(scj->context, tracking);
if (!solved) if (!solved)
BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct, see console for details"); BKE_report(scj->reports, RPT_WARNING, "Some data failed to reconstruct (see console for details)");
else else
BKE_reportf(scj->reports, RPT_INFO, "Average re-projection error: %.3f", tracking->reconstruction.error); BKE_reportf(scj->reports, RPT_INFO, "Average re-projection error: %.3f", tracking->reconstruction.error);
@ -3371,7 +3371,7 @@ static int tracking_object_remove_exec(bContext *C, wmOperator *op)
object = BKE_tracking_object_get_active(tracking); object = BKE_tracking_object_get_active(tracking);
if (object->flag & TRACKING_OBJECT_CAMERA) { if (object->flag & TRACKING_OBJECT_CAMERA) {
BKE_report(op->reports, RPT_WARNING, "Object used for camera tracking can't be deleted"); BKE_report(op->reports, RPT_WARNING, "Object used for camera tracking cannot be deleted");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -1105,7 +1105,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
if (generate_name) { if (generate_name) {
/* create a new, non-existing folder name */ /* create a new, non-existing folder name */
if (!new_folder_path(sfile->params->dir, path, name)) { if (!new_folder_path(sfile->params->dir, path, name)) {
BKE_report(op->reports, RPT_ERROR, "Couldn't create new folder name"); BKE_report(op->reports, RPT_ERROR, "Could not create new folder name");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
} }
@ -1114,7 +1114,7 @@ int file_directory_new_exec(bContext *C, wmOperator *op)
BLI_dir_create_recursive(path); BLI_dir_create_recursive(path);
if (!BLI_exists(path)) { if (!BLI_exists(path)) {
BKE_report(op->reports, RPT_ERROR, "Couldn't create new folder"); BKE_report(op->reports, RPT_ERROR, "Could not create new folder");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -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_object_types.h" #include "DNA_object_types.h"
#include "DNA_node_types.h" #include "DNA_node_types.h"
#include "DNA_packedFile_types.h" #include "DNA_packedFile_types.h"
@ -858,7 +860,8 @@ static int image_open_exec(bContext *C, wmOperator *op)
if (!ima) { if (!ima) {
if (op->customdata) MEM_freeN(op->customdata); if (op->customdata) MEM_freeN(op->customdata);
BKE_reportf(op->reports, RPT_ERROR, "Can't read: \"%s\", %s", str, errno ? strerror(errno) : "Unsupported image format"); BKE_reportf(op->reports, RPT_ERROR, "Cannot read '%s': %s",
str, errno ? strerror(errno) : TIP_("unsupported image format"));
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1313,7 +1316,7 @@ static void save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
} }
} }
else { else {
BKE_reportf(op->reports, RPT_ERROR, "Couldn't write image: %s", simopts->filepath); BKE_reportf(op->reports, RPT_ERROR, "Could not write image %s", simopts->filepath);
} }
@ -1495,7 +1498,7 @@ static int image_save_exec(bContext *C, wmOperator *op)
save_image_doit(C, sima, op, &simopts, FALSE); save_image_doit(C, sima, op, &simopts, FALSE);
} }
else { else {
BKE_reportf(op->reports, RPT_ERROR, "Can not save image, path '%s' is not writable", simopts.filepath); BKE_reportf(op->reports, RPT_ERROR, "Cannot save image, path '%s' is not writable", simopts.filepath);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1536,7 +1539,7 @@ static int image_save_sequence_exec(bContext *C, wmOperator *op)
} }
if (sima->image->type == IMA_TYPE_MULTILAYER) { if (sima->image->type == IMA_TYPE_MULTILAYER) {
BKE_report(op->reports, RPT_ERROR, "Can't save multilayer sequences"); BKE_report(op->reports, RPT_ERROR, "Cannot save multilayer sequences");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -1572,7 +1575,7 @@ static int image_save_sequence_exec(bContext *C, wmOperator *op)
break; break;
} }
BKE_reportf(op->reports, RPT_INFO, "Saved: %s\n", ibuf->name); BKE_reportf(op->reports, RPT_INFO, "Saved %s", ibuf->name);
ibuf->userflags &= ~IB_BITMAPDIRTY; ibuf->userflags &= ~IB_BITMAPDIRTY;
} }
} }
@ -1852,7 +1855,7 @@ static int image_pack_exec(bContext *C, wmOperator *op)
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) { if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
BKE_report(op->reports, RPT_ERROR, "Can't pack edited image from disk, only as internal PNG"); BKE_report(op->reports, RPT_ERROR, "Cannot pack edited image from disk, only as internal PNG");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -196,7 +196,7 @@ static int make_paths_relative_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
if (!G.relbase_valid) { if (!G.relbase_valid) {
BKE_report(op->reports, RPT_WARNING, "Can't set relative paths with an unsaved blend file"); BKE_report(op->reports, RPT_WARNING, "Cannot set relative paths with an unsaved blend file");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -229,7 +229,7 @@ static int make_paths_absolute_exec(bContext *C, wmOperator *op)
Main *bmain = CTX_data_main(C); Main *bmain = CTX_data_main(C);
if (!G.relbase_valid) { if (!G.relbase_valid) {
BKE_report(op->reports, RPT_WARNING, "Can't set absolute paths with an unsaved blend file"); BKE_report(op->reports, RPT_WARNING, "Cannot set absolute paths with an unsaved blend file");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -398,7 +398,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action")); act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action"));
if (act == NULL) { if (act == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid Action to add"); BKE_report(op->reports, RPT_ERROR, "No valid action to add");
//printf("Add strip - actname = '%s'\n", actname); //printf("Add strip - actname = '%s'\n", actname);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -407,7 +407,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_WARNING, BKE_reportf(op->reports, RPT_WARNING,
"Action '%s' does not specify what datablocks it can be used on " "Action '%s' does not specify what datablocks it can be used on "
"(try setting the 'ID Root Type' setting from the Datablocks Editor " "(try setting the 'ID Root Type' setting from the Datablocks Editor "
"for this Action to avoid future problems)", "for this action to avoid future problems)",
act->id.name + 2); act->id.name + 2);
} }
@ -433,7 +433,7 @@ static int nlaedit_add_actionclip_exec(bContext *C, wmOperator *op)
*/ */
if ((act->idroot) && (act->idroot != GS(ale->id->name))) { if ((act->idroot) && (act->idroot != GS(ale->id->name))) {
BKE_reportf(op->reports, RPT_ERROR, BKE_reportf(op->reports, RPT_ERROR,
"Couldn't add action '%s' as it cannot be used relative to ID-blocks of type '%s'", "Could not add action '%s' as it cannot be used relative to ID-blocks of type '%s'",
act->id.name + 2, ale->id->name); act->id.name + 2, ale->id->name);
continue; continue;
} }
@ -2023,7 +2023,7 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
set_active_fmodifier(&strip->modifiers, fcm); set_active_fmodifier(&strip->modifiers, fcm);
else { else {
BKE_reportf(op->reports, RPT_ERROR, BKE_reportf(op->reports, RPT_ERROR,
"Modifier couldn't be added to (%s : %s) (see console for details)", "Modifier could not be added to (%s : %s) (see console for details)",
nlt->name, strip->name); nlt->name, strip->name);
} }
} }

View File

@ -35,6 +35,8 @@
#include "BLI_math.h" #include "BLI_math.h"
#include "BLF_translation.h"
#include "BKE_context.h" #include "BKE_context.h"
#include "BKE_image.h" #include "BKE_image.h"
#include "BKE_library.h" #include "BKE_library.h"
@ -240,7 +242,8 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ima = BKE_image_load_exists(path); ima = BKE_image_load_exists(path);
if (!ima) { if (!ima) {
BKE_reportf(op->reports, RPT_ERROR, "Can't read image: \"%s\", %s", path, errno ? strerror(errno) : "Unsupported format"); BKE_reportf(op->reports, RPT_ERROR, "Cannot read image '%s': %s",
path, errno ? strerror(errno) : TIP_("unsupported format"));
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
} }
@ -250,7 +253,7 @@ static int node_add_file_exec(bContext *C, wmOperator *op)
ima = (Image *)BKE_libblock_find_name(ID_IM, name); ima = (Image *)BKE_libblock_find_name(ID_IM, name);
if (!ima) { if (!ima) {
BKE_reportf(op->reports, RPT_ERROR, "Image named \"%s\", not found", name); BKE_reportf(op->reports, RPT_ERROR, "Image '%s' not found", name);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
} }

View File

@ -786,7 +786,7 @@ static void outliner_find_panel(Scene *UNUSED(scene), ARegion *ar, SpaceOops *so
} }
else { else {
/* no tree-element found */ /* no tree-element found */
BKE_report(reports, RPT_WARNING, "Not found: %s", name); BKE_reportf(reports, RPT_WARNING, "Not found: %s", name);
} }
} }
#endif #endif

View File

@ -974,7 +974,7 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action")); act = BLI_findlink(&CTX_data_main(C)->action, RNA_enum_get(op->ptr, "action"));
if (act == NULL) { if (act == NULL) {
BKE_report(op->reports, RPT_ERROR, "No valid Action to add"); BKE_report(op->reports, RPT_ERROR, "No valid action to add");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else if (act->idroot == 0) { else if (act->idroot == 0) {
@ -982,7 +982,7 @@ static int outliner_action_set_exec(bContext *C, wmOperator *op)
BKE_reportf(op->reports, RPT_WARNING, BKE_reportf(op->reports, RPT_WARNING,
"Action '%s' does not specify what datablocks it can be used on " "Action '%s' does not specify what datablocks it can be used on "
"(try setting the 'ID Root Type' setting from the Datablocks Editor " "(try setting the 'ID Root Type' setting from the Datablocks Editor "
"for this Action to avoid future problems)", "for this action to avoid future problems)",
act->id.name + 2); act->id.name + 2);
} }

View File

@ -57,4 +57,8 @@ if(WITH_AUDASPACE)
add_definitions(-DWITH_AUDASPACE) add_definitions(-DWITH_AUDASPACE)
endif() endif()
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
blender_add_lib(bf_editor_space_sequencer "${SRC}" "${INC}" "${INC_SYS}") blender_add_lib(bf_editor_space_sequencer "${SRC}" "${INC}" "${INC_SYS}")

View File

@ -8,7 +8,12 @@ incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
incs += ' ../../makesrna ../../blenloader ../../blenfont' incs += ' ../../makesrna ../../blenloader ../../blenfont'
incs += ' #/intern/audaspace/intern' incs += ' #/intern/audaspace/intern'
defs = []
if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
incs += ' ' + env['BF_PTHREADS_INC'] incs += ' ' + env['BF_PTHREADS_INC']
env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), [], libtype=['core'], priority=[100] ) if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( 'bf_editors_space_sequencer', sources, Split(incs), defs, libtype=['core'], priority=[100] )

View File

@ -325,7 +325,7 @@ static int sequencer_add_movieclip_strip_exec(bContext *C, wmOperator *op)
clip = BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip")); clip = BLI_findlink(&CTX_data_main(C)->movieclip, RNA_enum_get(op->ptr, "clip"));
if (clip == NULL) { if (clip == NULL) {
BKE_report(op->reports, RPT_ERROR, "MovieClip not found"); BKE_report(op->reports, RPT_ERROR, "Movie clip not found");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -553,7 +553,7 @@ static int sequencer_add_generic_strip_exec(bContext *C, wmOperator *op, SeqLoad
} }
if (seq_load.tot_success == 0) { if (seq_load.tot_success == 0) {
BKE_reportf(op->reports, RPT_ERROR, "File \"%s\" could not be loaded", seq_load.path); BKE_reportf(op->reports, RPT_ERROR, "File '%s' could not be loaded", seq_load.path);
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -46,6 +46,8 @@
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLI_threads.h" #include "BLI_threads.h"
#include "BLF_translation.h"
#include "DNA_scene_types.h" #include "DNA_scene_types.h"
#include "DNA_userdef_types.h" #include "DNA_userdef_types.h"
@ -507,7 +509,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
for (seq = ed->seqbasep->first; seq; seq = seq->next) { for (seq = ed->seqbasep->first; seq; seq = seq->next) {
if (seq->flag & SELECT) { if (seq->flag & SELECT) {
if (seq->type == SEQ_TYPE_SOUND_RAM && BKE_sequence_effect_get_num_inputs(type) != 0) { if (seq->type == SEQ_TYPE_SOUND_RAM && BKE_sequence_effect_get_num_inputs(type) != 0) {
*error_str = "Can't apply effects to audio sequence strips"; *error_str = N_("Cannot apply effects to audio sequence strips");
return 0; return 0;
} }
if ((seq != activeseq) && (seq != seq2)) { if ((seq != activeseq) && (seq != seq2)) {
@ -515,7 +517,7 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
else if (seq1 == NULL) seq1 = seq; else if (seq1 == NULL) seq1 = seq;
else if (seq3 == NULL) seq3 = seq; else if (seq3 == NULL) seq3 = seq;
else { else {
*error_str = "Can't apply effect to more than 3 sequence strips"; *error_str = N_("Cannot apply effect to more than 3 sequence strips");
return 0; return 0;
} }
} }
@ -537,21 +539,21 @@ int seq_effect_find_selected(Scene *scene, Sequence *activeseq, int type, Sequen
return 1; /* succsess */ return 1; /* succsess */
case 1: case 1:
if (seq2 == NULL) { if (seq2 == NULL) {
*error_str = "Need at least one selected sequence strip"; *error_str = N_("At least one selected sequence strip is needed");
return 0; return 0;
} }
if (seq1 == NULL) seq1 = seq2; if (seq1 == NULL) seq1 = seq2;
if (seq3 == NULL) seq3 = seq2; if (seq3 == NULL) seq3 = seq2;
case 2: case 2:
if (seq1 == NULL || seq2 == NULL) { if (seq1 == NULL || seq2 == NULL) {
*error_str = "Need 2 selected sequence strips"; *error_str = N_("2 selected sequence strips are needed");
return 0; return 0;
} }
if (seq3 == NULL) seq3 = seq2; if (seq3 == NULL) seq3 = seq2;
} }
if (seq1 == NULL && seq2 == NULL && seq3 == NULL) { if (seq1 == NULL && seq2 == NULL && seq3 == NULL) {
*error_str = "TODO: in what cases does this happen?"; *error_str = N_("TODO: in what cases does this happen?");
return 0; return 0;
} }
@ -1384,7 +1386,7 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op)
seq_is_predecessor(seq2, last_seq) || seq_is_predecessor(seq2, last_seq) ||
seq_is_predecessor(seq3, last_seq)) seq_is_predecessor(seq3, last_seq))
{ {
BKE_report(op->reports, RPT_ERROR, "Can't reassign inputs: no cycles allowed"); BKE_report(op->reports, RPT_ERROR, "Cannot reassign inputs: no cycles allowed");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
@ -2905,7 +2907,7 @@ static int sequencer_change_effect_input_exec(bContext *C, wmOperator *op)
} }
if (*seq_1 == NULL || *seq_2 == NULL) { if (*seq_1 == NULL || *seq_2 == NULL) {
BKE_report(op->reports, RPT_ERROR, "One of the effect inputs is unset, can't swap"); BKE_report(op->reports, RPT_ERROR, "One of the effect inputs is unset, cannot swap");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }
else { else {

View File

@ -1167,7 +1167,7 @@ static int sequencer_select_grouped_exec(bContext *C, wmOperator *op)
extend = RNA_boolean_get(op->ptr, "extend"); extend = RNA_boolean_get(op->ptr, "extend");
if (actseq == NULL) { if (actseq == NULL) {
BKE_report(op->reports, RPT_ERROR, "No Active Sequence!"); BKE_report(op->reports, RPT_ERROR, "No active sequence!");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -54,4 +54,8 @@ if(WITH_PYTHON)
add_definitions(-DWITH_PYTHON) add_definitions(-DWITH_PYTHON)
endif() endif()
if(WITH_INTERNATIONAL)
add_definitions(-DWITH_INTERNATIONAL)
endif()
blender_add_lib(bf_editor_text "${SRC}" "${INC}" "${INC_SYS}") blender_add_lib(bf_editor_text "${SRC}" "${INC}" "${INC_SYS}")

View File

@ -10,4 +10,7 @@ incs += ' ../../python ../../makesrna ../../blenfont ../../blenloader'
if env['WITH_BF_PYTHON']: if env['WITH_BF_PYTHON']:
defs.append('WITH_PYTHON') defs.append('WITH_PYTHON')
if env['WITH_BF_INTERNATIONAL']:
defs.append('WITH_INTERNATIONAL')
env.BlenderLib ( 'bf_editors_space_text', sources, Split(incs), defs, libtype=['core'], priority=[95] ) env.BlenderLib ( 'bf_editors_space_text', sources, Split(incs), defs, libtype=['core'], priority=[95] )

View File

@ -44,6 +44,8 @@
#include "BLI_blenlib.h" #include "BLI_blenlib.h"
#include "BLI_utildefines.h" #include "BLI_utildefines.h"
#include "BLF_translation.h"
#include "PIL_time.h" #include "PIL_time.h"
#include "BKE_context.h" #include "BKE_context.h"
@ -93,7 +95,7 @@ static int text_edit_poll(bContext *C)
return 0; return 0;
if (text->id.lib) { if (text->id.lib) {
// BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); // BKE_report(op->reports, RPT_ERROR, "Cannot edit external libdata");
return 0; return 0;
} }
@ -109,7 +111,7 @@ static int text_space_edit_poll(bContext *C)
return 0; return 0;
if (text->id.lib) { if (text->id.lib) {
// BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); // BKE_report(op->reports, RPT_ERROR, "Cannot edit external libdata");
return 0; return 0;
} }
@ -129,7 +131,7 @@ static int text_region_edit_poll(bContext *C)
return 0; return 0;
if (text->id.lib) { if (text->id.lib) {
// BKE_report(op->reports, RPT_ERROR, "Can't edit external libdata"); // BKE_report(op->reports, RPT_ERROR, "Cannot edit external libdata");
return 0; return 0;
} }
@ -463,7 +465,8 @@ static void txt_write_file(Text *text, ReportList *reports)
fp = BLI_fopen(filepath, "w"); fp = BLI_fopen(filepath, "w");
if (fp == NULL) { if (fp == NULL) {
BKE_reportf(reports, RPT_ERROR, "Unable to save \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error writing file"); BKE_reportf(reports, RPT_ERROR, "Unable to save '%s': %s",
filepath, errno ? strerror(errno) : TIP_("unknown error writing file"));
return; return;
} }
@ -482,7 +485,8 @@ static void txt_write_file(Text *text, ReportList *reports)
} }
else { else {
text->mtime = 0; text->mtime = 0;
BKE_reportf(reports, RPT_WARNING, "Unable to stat \"%s\": %s", filepath, errno ? strerror(errno) : "Unknown error starrng file"); BKE_reportf(reports, RPT_WARNING, "Unable to stat '%s': %s",
filepath, errno ? strerror(errno) : TIP_("unknown error stating file"));
} }
if (text->flags & TXT_ISDIRTY) if (text->flags & TXT_ISDIRTY)

View File

@ -1038,7 +1038,7 @@ static int view3d_localview_init(Main *bmain, Scene *scene, ScrArea *sa, ReportL
locallay = free_localbit(bmain); locallay = free_localbit(bmain);
if (locallay == 0) { if (locallay == 0) {
BKE_reportf(reports, RPT_ERROR, "No more than 8 local views"); BKE_report(reports, RPT_ERROR, "No more than 8 local views");
ok = FALSE; ok = FALSE;
} }
else { else {

View File

@ -974,7 +974,7 @@ static void createTransPose(TransInfo *t, Object *ob)
if (arm->flag & ARM_RESTPOS) { if (arm->flag & ARM_RESTPOS) {
if (ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE) == 0) { if (ELEM(t->mode, TFM_DUMMY, TFM_BONESIZE) == 0) {
// XXX use transform operator reports // XXX use transform operator reports
// BKE_report(op->reports, RPT_ERROR, "Can't select linked when sync selection is enabled"); // BKE_report(op->reports, RPT_ERROR, "Cannot select linked when sync selection is enabled");
return; return;
} }
} }

View File

@ -284,7 +284,7 @@ static int create_orientation_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "name", name); RNA_string_get(op->ptr, "name", name);
if (use && !CTX_wm_view3d(C)) { if (use && !CTX_wm_view3d(C)) {
BKE_report(op->reports, RPT_ERROR, "Create Orientation \"use\" parameter only valid in a 3dView context"); BKE_report(op->reports, RPT_ERROR, "Create Orientation's 'use' parameter only valid in a 3DView context");
return OPERATOR_CANCELLED; return OPERATOR_CANCELLED;
} }

View File

@ -165,7 +165,7 @@ static bGPDstroke *rna_GPencil_stroke_new(bGPDframe *frame)
static void rna_GPencil_stroke_remove(bGPDframe *frame, ReportList *reports, bGPDstroke *stroke) static void rna_GPencil_stroke_remove(bGPDframe *frame, ReportList *reports, bGPDstroke *stroke)
{ {
if (BLI_findindex(&frame->strokes, stroke) == -1) { if (BLI_findindex(&frame->strokes, stroke) == -1) {
BKE_reportf(reports, RPT_ERROR, "Stroke not found in grease pencil frame"); BKE_report(reports, RPT_ERROR, "Stroke not found in grease pencil frame");
return; return;
} }
@ -179,7 +179,7 @@ static bGPDframe *rna_GPencil_frame_new(bGPDlayer *layer, ReportList *reports, i
bGPDframe *frame; bGPDframe *frame;
if (BKE_gpencil_layer_find_frame(layer, frame_number)) { if (BKE_gpencil_layer_find_frame(layer, frame_number)) {
BKE_reportf(reports, RPT_ERROR, "Frame already exists on this frame number"); BKE_reportf(reports, RPT_ERROR, "Frame already exists on this frame number %d", frame_number);
return NULL; return NULL;
} }
@ -193,7 +193,7 @@ static bGPDframe *rna_GPencil_frame_new(bGPDlayer *layer, ReportList *reports, i
static void rna_GPencil_frame_remove(bGPDlayer *layer, ReportList *reports, bGPDframe *frame) static void rna_GPencil_frame_remove(bGPDlayer *layer, ReportList *reports, bGPDframe *frame)
{ {
if (BLI_findindex(&layer->frames, frame) == -1) { if (BLI_findindex(&layer->frames, frame) == -1) {
BKE_reportf(reports, RPT_ERROR, "Frame not found in grease pencil layer"); BKE_report(reports, RPT_ERROR, "Frame not found in grease pencil layer");
return; return;
} }
@ -229,7 +229,7 @@ static bGPDlayer *rna_GPencil_layer_new(bGPdata *gpd, const char *name, int seta
static void rna_GPencil_layer_remove(bGPdata *gpd, ReportList *reports, bGPDlayer *layer) static void rna_GPencil_layer_remove(bGPdata *gpd, ReportList *reports, bGPDlayer *layer)
{ {
if (BLI_findindex(&gpd->layers, layer) == -1) { if (BLI_findindex(&gpd->layers, layer) == -1) {
BKE_reportf(reports, RPT_ERROR, "Layer not found in grease pencil data"); BKE_report(reports, RPT_ERROR, "Layer not found in grease pencil data");
return; return;
} }

View File

@ -143,7 +143,7 @@ static void rna_Image_pack(Image *image, ReportList *reports, int as_png)
ImBuf *ibuf = BKE_image_get_ibuf(image, NULL); ImBuf *ibuf = BKE_image_get_ibuf(image, NULL);
if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) { if (!as_png && (ibuf && (ibuf->userflags & IB_BITMAPDIRTY))) {
BKE_reportf(reports, RPT_ERROR, "Cannot pack edited image from disk, only as internal PNG"); BKE_report(reports, RPT_ERROR, "Cannot pack edited image from disk, only as internal PNG");
} }
else { else {
if (as_png) { if (as_png) {

View File

@ -572,7 +572,7 @@ static void rna_Main_grease_pencil_remove(Main *bmain, ReportList *reports, bGPd
BKE_libblock_free(&bmain->gpencil, gpd); BKE_libblock_free(&bmain->gpencil, gpd);
} }
else else
BKE_reportf(reports, RPT_ERROR, "Grease Pencil '%s' must have zero users to be removed, found %d", BKE_reportf(reports, RPT_ERROR, "Grease pencil '%s' must have zero users to be removed, found %d",
gpd->id.name + 2, ID_REAL_USERS(gpd)); gpd->id.name + 2, ID_REAL_USERS(gpd));
/* XXX python now has invalid pointer? */ /* XXX python now has invalid pointer? */

View File

@ -318,7 +318,7 @@ static MaskLayer *rna_Mask_layers_new(Mask *mask, const char *name)
static void rna_Mask_layers_remove(Mask *mask, ReportList *reports, MaskLayer *masklay) static void rna_Mask_layers_remove(Mask *mask, ReportList *reports, MaskLayer *masklay)
{ {
if (BLI_findindex(&mask->masklayers, masklay) == -1) { if (BLI_findindex(&mask->masklayers, masklay) == -1) {
BKE_reportf(reports, RPT_ERROR, "MaskLayer '%s' not found in mask '%s'", masklay->name, mask->id.name + 2); BKE_reportf(reports, RPT_ERROR, "Mask layer '%s' not found in mask '%s'", masklay->name, mask->id.name + 2);
return; return;
} }

View File

@ -1161,31 +1161,31 @@ static void rna_def_modifier_decimate(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "angle"); RNA_def_property_float_sdna(prop, NULL, "angle");
RNA_def_property_range(prop, 0, DEG2RAD(180)); RNA_def_property_range(prop, 0, DEG2RAD(180));
RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2); RNA_def_property_ui_range(prop, 0, DEG2RAD(180), 100, 2);
RNA_def_property_ui_text(prop, "Angle Limit", "Only dissolve angles below this(planar/dissolve only)"); RNA_def_property_ui_text(prop, "Angle Limit", "Only dissolve angles below this (planar only)");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* (mode == MOD_DECIM_MODE_COLLAPSE) */ /* (mode == MOD_DECIM_MODE_COLLAPSE) */
prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE); prop = RNA_def_property(srna, "vertex_group", PROP_STRING, PROP_NONE);
RNA_def_property_string_sdna(prop, NULL, "defgrp_name"); RNA_def_property_string_sdna(prop, NULL, "defgrp_name");
RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name"); RNA_def_property_ui_text(prop, "Vertex Group", "Vertex group name (collapse only)");
RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DecimateModifier_vgroup_set"); RNA_def_property_string_funcs(prop, NULL, NULL, "rna_DecimateModifier_vgroup_set");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "invert_vertex_group", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_INVERT_VGROUP); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_INVERT_VGROUP);
RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence"); RNA_def_property_ui_text(prop, "Invert", "Invert vertex group influence (collapse only)");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");
prop = RNA_def_property(srna, "use_collapse_triangulate", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_collapse_triangulate", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_TRIANGULATE); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_TRIANGULATE);
RNA_def_property_ui_text(prop, "Triangulate", "Keep triangulated faces resulting from decimation"); RNA_def_property_ui_text(prop, "Triangulate", "Keep triangulated faces resulting from decimation (collapse only)");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* end collapse-only option */ /* end collapse-only option */
/* (mode == MOD_DECIM_MODE_DISSOLVE) */ /* (mode == MOD_DECIM_MODE_DISSOLVE) */
prop = RNA_def_property(srna, "use_dissolve_boundaries", PROP_BOOLEAN, PROP_NONE); prop = RNA_def_property(srna, "use_dissolve_boundaries", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS); RNA_def_property_boolean_sdna(prop, NULL, "flag", MOD_DECIM_FLAG_ALL_BOUNDARY_VERTS);
RNA_def_property_ui_text(prop, "All Boundaries", "Dissolve all vertices inbetween face boundaries"); RNA_def_property_ui_text(prop, "All Boundaries", "Dissolve all vertices inbetween face boundaries (planar only)");
RNA_def_property_update(prop, 0, "rna_Modifier_update"); RNA_def_property_update(prop, 0, "rna_Modifier_update");
/* end dissolve-only option */ /* end dissolve-only option */

View File

@ -1038,7 +1038,7 @@ static void rna_RenderLayer_remove(ID *id, RenderData *UNUSED(rd), Main *bmain,
Scene *scene = (Scene *)id; Scene *scene = (Scene *)id;
if (!BKE_scene_remove_render_layer(bmain, scene, srl)) { if (!BKE_scene_remove_render_layer(bmain, scene, srl)) {
BKE_reportf(reports, RPT_ERROR, "RenderLayer '%s' could not be removed from scene '%s'", BKE_reportf(reports, RPT_ERROR, "Render layer '%s' could not be removed from scene '%s'",
srl->name, scene->id.name + 2); srl->name, scene->id.name + 2);
} }
else { else {

View File

@ -341,7 +341,7 @@ static void rna_SequenceElements_pop(ID *id, Sequence *seq, ReportList *reports,
StripElem *new_seq, *se; StripElem *new_seq, *se;
if (seq->len == 1) { if (seq->len == 1) {
BKE_report(reports, RPT_ERROR, "SequenceElements.pop: can not pop the last element"); BKE_report(reports, RPT_ERROR, "SequenceElements.pop: cannot pop the last element");
return; return;
} }

View File

@ -100,7 +100,7 @@ short BPy_errors_to_report(ReportList *reports)
pystring = PyC_ExceptionBuffer(); pystring = PyC_ExceptionBuffer();
if (pystring == NULL) { if (pystring == NULL) {
BKE_report(reports, RPT_ERROR, "Unknown py-exception, couldn't convert"); BKE_report(reports, RPT_ERROR, "Unknown py-exception, could not convert");
return 0; return 0;
} }
@ -111,15 +111,15 @@ short BPy_errors_to_report(ReportList *reports)
cstring = _PyUnicode_AsString(pystring); cstring = _PyUnicode_AsString(pystring);
#if 0 /* ARG!. workaround for a bug in blenders use of vsnprintf */ #if 0 /* ARG!. workaround for a bug in blenders use of vsnprintf */
BKE_reportf(reports, RPT_ERROR, "%s\nlocation:%s:%d\n", cstring, filename, lineno); BKE_reportf(reports, RPT_ERROR, "%s\nlocation: %s:%d\n", cstring, filename, lineno);
#else #else
pystring_format = PyUnicode_FromFormat(TIP_("%s\nlocation:%s:%d\n"), cstring, filename, lineno); pystring_format = PyUnicode_FromFormat(TIP_("%s\nlocation: %s:%d\n"), cstring, filename, lineno);
cstring = _PyUnicode_AsString(pystring_format); cstring = _PyUnicode_AsString(pystring_format);
BKE_report(reports, RPT_ERROR, cstring); BKE_report(reports, RPT_ERROR, cstring);
#endif #endif
/* not exactly needed. just for testing */ /* not exactly needed. just for testing */
fprintf(stderr, TIP_("%s\nlocation:%s:%d\n"), cstring, filename, lineno); fprintf(stderr, TIP_("%s\nlocation: %s:%d\n"), cstring, filename, lineno);
Py_DECREF(pystring); Py_DECREF(pystring);
Py_DECREF(pystring_format); /* workaround */ Py_DECREF(pystring_format); /* workaround */