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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSybren A. Stüvel <sybren@stuvel.eu>2018-04-08 15:07:34 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2018-04-08 15:07:34 +0300
commita981206fd183355bdcc8331b3a74ce3d382e1f67 (patch)
treeefa5534ed691645530707a80cf4a2039909f79b7 /source/blender
parent0b5ebb3265b155658d441135e152f32ba11c001d (diff)
parent245e01c30ac296c509e04f702c6b5d76086265b5 (diff)
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/blenkernel/intern/armature_update.c2
-rw-r--r--source/blender/blenkernel/intern/image.c121
-rw-r--r--source/blender/blenkernel/intern/undo_system.c4
-rw-r--r--source/blender/blenlib/BLI_string_utf8.h10
-rw-r--r--source/blender/collada/AnimationImporter.cpp48
-rw-r--r--source/blender/collada/AnimationImporter.h3
-rw-r--r--source/blender/collada/DocumentImporter.cpp2
-rw-r--r--source/blender/editors/io/io_collada.c5
-rw-r--r--source/blender/editors/lattice/lattice_intern.h2
-rw-r--r--source/blender/editors/lattice/lattice_ops.c2
-rw-r--r--source/blender/editors/render/render_internal.c2
-rw-r--r--source/blender/editors/undo/ed_undo.c2
-rw-r--r--source/blender/editors/undo/memfile_undo.c2
-rw-r--r--source/blender/editors/undo/undo_system_types.c2
-rw-r--r--source/blender/imbuf/IMB_metadata.h2
-rw-r--r--source/blender/imbuf/intern/writeimage.c8
-rw-r--r--source/blender/makesrna/intern/rna_scene.c10
-rw-r--r--source/blender/makesrna/intern/rna_smoke.c2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_volume_principled.c2
-rw-r--r--source/blender/windowmanager/WM_undo.h0
-rw-r--r--source/blender/windowmanager/intern/wm_window.c2
21 files changed, 131 insertions, 102 deletions
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index 5b51cd9502f..29baaff32ba 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -587,7 +587,7 @@ void BKE_pose_eval_init(const struct EvaluationContext *UNUSED(eval_ctx),
const int num_channels = BLI_listbase_count(&pose->chanbase);
pose->chan_array = MEM_malloc_arrayN(
- num_channels, sizeof(bPoseChannel*), "pose->chan_array");
+ num_channels, sizeof(bPoseChannel *), "pose->chan_array");
/* clear flags */
int pchan_index = 0;
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index ef48b3c1a45..28245f9a4d8 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -153,7 +153,7 @@ static void imagecache_put(Image *image, int index, ImBuf *ibuf)
if (image->cache == NULL) {
// char cache_name[64];
- // BLI_snprintf(cache_name, sizeof(cache_name), "Image Datablock %s", image->id.name);
+ // SNPRINTF(cache_name, "Image Datablock %s", image->id.name);
image->cache = IMB_moviecache_create("Image Datablock Cache", sizeof(ImageCacheKey),
imagecache_hashhash, imagecache_hashcmp);
@@ -438,7 +438,7 @@ static void copy_image_packedfiles(ListBase *lb_dst, const ListBase *lb_src)
BLI_listbase_clear(lb_dst);
for (imapf_src = lb_src->first; imapf_src; imapf_src = imapf_src->next) {
ImagePackedFile *imapf_dst = MEM_mallocN(sizeof(ImagePackedFile), "Image Packed Files (copy)");
- BLI_strncpy(imapf_dst->filepath, imapf_src->filepath, sizeof(imapf_dst->filepath));
+ STRNCPY(imapf_dst->filepath, imapf_src->filepath);
if (imapf_src->packedfile)
imapf_dst->packedfile = dupPackedFile(imapf_src->packedfile);
@@ -594,7 +594,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath)
int file;
char str[FILE_MAX];
- BLI_strncpy(str, filepath, sizeof(str));
+ STRNCPY(str, filepath);
BLI_path_abs(str, bmain->name);
/* exists? */
@@ -604,7 +604,7 @@ Image *BKE_image_load(Main *bmain, const char *filepath)
close(file);
ima = image_alloc(bmain, BLI_path_basename(filepath), IMA_SRC_FILE, IMA_TYPE_IMAGE);
- BLI_strncpy(ima->name, filepath, sizeof(ima->name));
+ STRNCPY(ima->name, filepath);
if (BLI_testextensie_array(filepath, imb_ext_movie))
ima->source = IMA_SRC_MOVIE;
@@ -623,13 +623,13 @@ Image *BKE_image_load_exists_ex(const char *filepath, bool *r_exists)
Image *ima;
char str[FILE_MAX], strtest[FILE_MAX];
- BLI_strncpy(str, filepath, sizeof(str));
+ STRNCPY(str, filepath);
BLI_path_abs(str, G.main->name);
/* first search an identical filepath */
for (ima = G.main->image.first; ima; ima = ima->id.next) {
if (ima->source != IMA_SRC_VIEWER && ima->source != IMA_SRC_GENERATED) {
- BLI_strncpy(strtest, ima->name, sizeof(ima->name));
+ STRNCPY(strtest, ima->name);
BLI_path_abs(strtest, ID_BLEND_PATH(G.main, &ima->id));
if (BLI_path_cmp(strtest, str) == 0) {
@@ -670,7 +670,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
if (colorspace_settings->name[0] == '\0') {
const char *colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_FLOAT);
- BLI_strncpy(colorspace_settings->name, colorspace, sizeof(colorspace_settings->name));
+ STRNCPY(colorspace_settings->name, colorspace);
}
if (ibuf != NULL) {
@@ -684,7 +684,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
if (colorspace_settings->name[0] == '\0') {
const char *colorspace = IMB_colormanagement_role_colorspace_name_get(COLOR_ROLE_DEFAULT_BYTE);
- BLI_strncpy(colorspace_settings->name, colorspace, sizeof(colorspace_settings->name));
+ STRNCPY(colorspace_settings->name, colorspace);
}
if (ibuf != NULL) {
@@ -697,7 +697,7 @@ static ImBuf *add_ibuf_size(unsigned int width, unsigned int height, const char
return NULL;
}
- BLI_strncpy(ibuf->name, name, sizeof(ibuf->name));
+ STRNCPY(ibuf->name, name);
ibuf->userflags |= IB_BITMAPDIRTY;
switch (gen_type) {
@@ -727,7 +727,7 @@ Image *BKE_image_add_generated(
int view_id;
const char *names[2] = {STEREO_LEFT_NAME, STEREO_RIGHT_NAME};
- /* BLI_strncpy(ima->name, name, FILE_MAX); */ /* don't do this, this writes in ain invalid filepath! */
+ /* STRNCPY(ima->name, name); */ /* don't do this, this writes in ain invalid filepath! */
ima->gen_x = width;
ima->gen_y = height;
ima->gen_type = gen_type;
@@ -768,7 +768,7 @@ Image *BKE_image_add_from_imbuf(ImBuf *ibuf, const char *name)
ima = image_alloc(G.main, name, IMA_SRC_FILE, IMA_TYPE_IMAGE);
if (ima) {
- BLI_strncpy(ima->name, ibuf->name, FILE_MAX);
+ STRNCPY(ima->name, ibuf->name);
image_assign_ibuf(ima, ibuf, IMA_NO_INDEX, 0);
ima->ok = IMA_OK_LOADED;
}
@@ -814,7 +814,7 @@ static void image_memorypack_multiview(Image *ima)
pf->size = ibuf->encodedsize;
imapf = MEM_mallocN(sizeof(ImagePackedFile), "Image PackedFile");
- BLI_strncpy(imapf->filepath, iv->filepath, sizeof(imapf->filepath));
+ STRNCPY(imapf->filepath, iv->filepath);
imapf->packedfile = pf;
BLI_addtail(&ima->packedfiles, imapf);
@@ -864,7 +864,7 @@ void BKE_image_memorypack(Image *ima)
pf->size = ibuf->encodedsize;
imapf = MEM_mallocN(sizeof(ImagePackedFile), "Image PackedFile");
- BLI_strncpy(imapf->filepath, ima->name, sizeof(imapf->filepath));
+ STRNCPY(imapf->filepath, ima->name);
imapf->packedfile = pf;
BLI_addtail(&ima->packedfiles, imapf);
@@ -890,7 +890,7 @@ void BKE_image_packfiles(ReportList *reports, Image *ima, const char *basepath)
BLI_addtail(&ima->packedfiles, imapf);
imapf->packedfile = newPackedFile(reports, ima->name, basepath);
if (imapf->packedfile) {
- BLI_strncpy(imapf->filepath, ima->name, sizeof(imapf->filepath));
+ STRNCPY(imapf->filepath, ima->name);
}
else {
BLI_freelinkN(&ima->packedfiles, imapf);
@@ -904,7 +904,7 @@ void BKE_image_packfiles(ReportList *reports, Image *ima, const char *basepath)
imapf->packedfile = newPackedFile(reports, iv->filepath, basepath);
if (imapf->packedfile) {
- BLI_strncpy(imapf->filepath, iv->filepath, sizeof(imapf->filepath));
+ STRNCPY(imapf->filepath, iv->filepath);
}
else {
BLI_freelinkN(&ima->packedfiles, imapf);
@@ -924,7 +924,7 @@ void BKE_image_packfiles_from_mem(ReportList *reports, Image *ima, char *data, c
ImagePackedFile *imapf = MEM_mallocN(sizeof(ImagePackedFile), __func__);
BLI_addtail(&ima->packedfiles, imapf);
imapf->packedfile = newPackedFileMemory(data, data_len);
- BLI_strncpy(imapf->filepath, ima->name, sizeof(imapf->filepath));
+ STRNCPY(imapf->filepath, ima->name);
}
}
@@ -1653,7 +1653,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
time_t t;
if (scene->r.stamp & R_STAMP_FILENAME) {
- BLI_snprintf(stamp_data->file, sizeof(stamp_data->file), do_prefix ? "File %s" : "%s", G.relbase_valid ? G.main->name : "<untitled>");
+ SNPRINTF(stamp_data->file, do_prefix ? "File %s" : "%s", G.relbase_valid ? G.main->name : "<untitled>");
}
else {
stamp_data->file[0] = '\0';
@@ -1661,7 +1661,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_NOTE) {
/* Never do prefix for Note */
- BLI_snprintf(stamp_data->note, sizeof(stamp_data->note), "%s", scene->r.stamp_udata);
+ SNPRINTF(stamp_data->note, "%s", scene->r.stamp_udata);
}
else {
stamp_data->note[0] = '\0';
@@ -1670,8 +1670,9 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.stamp & R_STAMP_DATE) {
t = time(NULL);
tl = localtime(&t);
- BLI_snprintf(text, sizeof(text), "%04d/%02d/%02d %02d:%02d:%02d", tl->tm_year + 1900, tl->tm_mon + 1, tl->tm_mday, tl->tm_hour, tl->tm_min, tl->tm_sec);
- BLI_snprintf(stamp_data->date, sizeof(stamp_data->date), do_prefix ? "Date %s" : "%s", text);
+ SNPRINTF(text, "%04d/%02d/%02d %02d:%02d:%02d",
+ tl->tm_year + 1900, tl->tm_mon + 1, tl->tm_mday, tl->tm_hour, tl->tm_min, tl->tm_sec);
+ SNPRINTF(stamp_data->date, do_prefix ? "Date %s" : "%s", text);
}
else {
stamp_data->date[0] = '\0';
@@ -1680,10 +1681,10 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (use_dynamic && scene->r.stamp & R_STAMP_MARKER) {
const char *name = BKE_scene_find_last_marker_name(scene, CFRA);
- if (name) BLI_strncpy(text, name, sizeof(text));
- else BLI_strncpy(text, "<none>", sizeof(text));
+ if (name) STRNCPY(text, name);
+ else STRNCPY(text, "<none>");
- BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), do_prefix ? "Marker %s" : "%s", text);
+ SNPRINTF(stamp_data->marker, do_prefix ? "Marker %s" : "%s", text);
}
else {
stamp_data->marker[0] = '\0';
@@ -1692,7 +1693,7 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (use_dynamic && scene->r.stamp & R_STAMP_TIME) {
const short timecode_style = USER_TIMECODE_SMPTE_FULL;
BLI_timecode_string_from_time(text, sizeof(text), 0, FRA2TIME(scene->r.cfra), FPS, timecode_style);
- BLI_snprintf(stamp_data->time, sizeof(stamp_data->time), do_prefix ? "Timecode %s" : "%s", text);
+ SNPRINTF(stamp_data->time, do_prefix ? "Timecode %s" : "%s", text);
}
else {
stamp_data->time[0] = '\0';
@@ -1705,24 +1706,24 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (scene->r.efra > 9)
digits = integer_digits_i(scene->r.efra);
- BLI_snprintf(fmtstr, sizeof(fmtstr), do_prefix ? "Frame %%0%di" : "%%0%di", digits);
- BLI_snprintf(stamp_data->frame, sizeof(stamp_data->frame), fmtstr, scene->r.cfra);
+ SNPRINTF(fmtstr, do_prefix ? "Frame %%0%di" : "%%0%di", digits);
+ SNPRINTF(stamp_data->frame, fmtstr, scene->r.cfra);
}
else {
stamp_data->frame[0] = '\0';
}
if (scene->r.stamp & R_STAMP_FRAME_RANGE) {
- BLI_snprintf(stamp_data->frame_range, sizeof(stamp_data->frame),
- do_prefix ? "Frame Range %d:%d" : "%d:%d",
- scene->r.sfra, scene->r.efra);
+ SNPRINTF(stamp_data->frame_range,
+ do_prefix ? "Frame Range %d:%d" : "%d:%d",
+ scene->r.sfra, scene->r.efra);
}
else {
stamp_data->frame_range[0] = '\0';
}
if (use_dynamic && scene->r.stamp & R_STAMP_CAMERA) {
- BLI_snprintf(stamp_data->camera, sizeof(stamp_data->camera), do_prefix ? "Camera %s" : "%s", camera ? camera->id.name + 2 : "<none>");
+ SNPRINTF(stamp_data->camera, do_prefix ? "Camera %s" : "%s", camera ? camera->id.name + 2 : "<none>");
}
else {
stamp_data->camera[0] = '\0';
@@ -1730,20 +1731,20 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (use_dynamic && scene->r.stamp & R_STAMP_CAMERALENS) {
if (camera && camera->type == OB_CAMERA) {
- BLI_snprintf(text, sizeof(text), "%.2f", ((Camera *)camera->data)->lens);
+ SNPRINTF(text, "%.2f", ((Camera *)camera->data)->lens);
}
else {
- BLI_strncpy(text, "<none>", sizeof(text));
+ STRNCPY(text, "<none>");
}
- BLI_snprintf(stamp_data->cameralens, sizeof(stamp_data->cameralens), do_prefix ? "Lens %s" : "%s", text);
+ SNPRINTF(stamp_data->cameralens, do_prefix ? "Lens %s" : "%s", text);
}
else {
stamp_data->cameralens[0] = '\0';
}
if (scene->r.stamp & R_STAMP_SCENE) {
- BLI_snprintf(stamp_data->scene, sizeof(stamp_data->scene), do_prefix ? "Scene %s" : "%s", scene->id.name + 2);
+ SNPRINTF(stamp_data->scene, do_prefix ? "Scene %s" : "%s", scene->id.name + 2);
}
else {
stamp_data->scene[0] = '\0';
@@ -1752,10 +1753,10 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (use_dynamic && scene->r.stamp & R_STAMP_SEQSTRIP) {
Sequence *seq = BKE_sequencer_foreground_frame_get(scene, scene->r.cfra);
- if (seq) BLI_strncpy(text, seq->name + 2, sizeof(text));
- else BLI_strncpy(text, "<none>", sizeof(text));
+ if (seq) STRNCPY(text, seq->name + 2);
+ else STRNCPY(text, "<none>");
- BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), do_prefix ? "Strip %s" : "%s", text);
+ SNPRINTF(stamp_data->strip, do_prefix ? "Strip %s" : "%s", text);
}
else {
stamp_data->strip[0] = '\0';
@@ -1768,21 +1769,21 @@ static void stampdata(Scene *scene, Object *camera, StampData *stamp_data, int d
if (use_dynamic && stats && (scene->r.stamp & R_STAMP_RENDERTIME)) {
BLI_timecode_string_from_time_simple(text, sizeof(text), stats->lastframetime);
- BLI_snprintf(stamp_data->rendertime, sizeof(stamp_data->rendertime), do_prefix ? "RenderTime %s" : "%s", text);
+ SNPRINTF(stamp_data->rendertime, do_prefix ? "RenderTime %s" : "%s", text);
}
else {
stamp_data->rendertime[0] = '\0';
}
if (use_dynamic && stats && (scene->r.stamp & R_STAMP_MEMORY)) {
- BLI_snprintf(stamp_data->memory, sizeof(stamp_data->memory), do_prefix ? "Peak Memory %.2fM" : "%.2fM", stats->mem_peak);
+ SNPRINTF(stamp_data->memory, do_prefix ? "Peak Memory %.2fM" : "%.2fM", stats->mem_peak);
}
else {
stamp_data->memory[0] = '\0';
}
}
if (scene->r.stamp & R_STAMP_FRAME_RANGE) {
- BLI_snprintf(stamp_data->frame_range, sizeof(stamp_data->frame_range),
+ SNPRINTF(stamp_data->frame_range,
do_prefix ? "Frame Range %d:%d" : "%d:%d", scene->r.sfra, scene->r.efra);
}
else {
@@ -1796,73 +1797,73 @@ static void stampdata_from_template(StampData *stamp_data,
const StampData *stamp_data_template)
{
if (scene->r.stamp & R_STAMP_FILENAME) {
- BLI_snprintf(stamp_data->file, sizeof(stamp_data->file), "File %s", stamp_data_template->file);
+ SNPRINTF(stamp_data->file, "File %s", stamp_data_template->file);
}
else {
stamp_data->file[0] = '\0';
}
if (scene->r.stamp & R_STAMP_NOTE) {
- BLI_snprintf(stamp_data->note, sizeof(stamp_data->note), "%s", stamp_data_template->note);
+ SNPRINTF(stamp_data->note, "%s", stamp_data_template->note);
}
else {
stamp_data->note[0] = '\0';
}
if (scene->r.stamp & R_STAMP_DATE) {
- BLI_snprintf(stamp_data->date, sizeof(stamp_data->date), "Date %s", stamp_data_template->date);
+ SNPRINTF(stamp_data->date, "Date %s", stamp_data_template->date);
}
else {
stamp_data->date[0] = '\0';
}
if (scene->r.stamp & R_STAMP_MARKER) {
- BLI_snprintf(stamp_data->marker, sizeof(stamp_data->marker), "Marker %s", stamp_data_template->marker);
+ SNPRINTF(stamp_data->marker, "Marker %s", stamp_data_template->marker);
}
else {
stamp_data->marker[0] = '\0';
}
if (scene->r.stamp & R_STAMP_TIME) {
- BLI_snprintf(stamp_data->time, sizeof(stamp_data->time), "Timecode %s", stamp_data_template->time);
+ SNPRINTF(stamp_data->time, "Timecode %s", stamp_data_template->time);
}
else {
stamp_data->time[0] = '\0';
}
if (scene->r.stamp & R_STAMP_FRAME) {
- BLI_snprintf(stamp_data->frame, sizeof(stamp_data->frame), "Frame %s", stamp_data_template->frame);
+ SNPRINTF(stamp_data->frame, "Frame %s", stamp_data_template->frame);
}
else {
stamp_data->frame[0] = '\0';
}
if (scene->r.stamp & R_STAMP_CAMERA) {
- BLI_snprintf(stamp_data->camera, sizeof(stamp_data->camera), "Camera %s", stamp_data_template->camera);
+ SNPRINTF(stamp_data->camera, "Camera %s", stamp_data_template->camera);
}
else {
stamp_data->camera[0] = '\0';
}
if (scene->r.stamp & R_STAMP_CAMERALENS) {
- BLI_snprintf(stamp_data->cameralens, sizeof(stamp_data->cameralens), "Lens %s", stamp_data_template->cameralens);
+ SNPRINTF(stamp_data->cameralens, "Lens %s", stamp_data_template->cameralens);
}
else {
stamp_data->cameralens[0] = '\0';
}
if (scene->r.stamp & R_STAMP_SCENE) {
- BLI_snprintf(stamp_data->scene, sizeof(stamp_data->scene), "Scene %s", stamp_data_template->scene);
+ SNPRINTF(stamp_data->scene, "Scene %s", stamp_data_template->scene);
}
else {
stamp_data->scene[0] = '\0';
}
if (scene->r.stamp & R_STAMP_SEQSTRIP) {
- BLI_snprintf(stamp_data->strip, sizeof(stamp_data->strip), "Strip %s", stamp_data_template->strip);
+ SNPRINTF(stamp_data->strip, "Strip %s", stamp_data_template->strip);
}
else {
stamp_data->strip[0] = '\0';
}
if (scene->r.stamp & R_STAMP_RENDERTIME) {
- BLI_snprintf(stamp_data->rendertime, sizeof(stamp_data->rendertime), "RenderTime %s", stamp_data_template->rendertime);
+ SNPRINTF(stamp_data->rendertime, "RenderTime %s", stamp_data_template->rendertime);
}
else {
stamp_data->rendertime[0] = '\0';
}
if (scene->r.stamp & R_STAMP_MEMORY) {
- BLI_snprintf(stamp_data->memory, sizeof(stamp_data->memory), "Peak Memory %s", stamp_data_template->memory);
+ SNPRINTF(stamp_data->memory, "Peak Memory %s", stamp_data_template->memory);
}
else {
stamp_data->memory[0] = '\0';
@@ -2197,8 +2198,8 @@ void BKE_render_result_stamp_data(RenderResult *rr, const char *key, const char
stamp_data = rr->stamp_data;
StampDataCustomField *field = MEM_mallocN(sizeof(StampDataCustomField),
"StampData Custom Field");
- BLI_strncpy(field->key, key, sizeof(field->key));
- BLI_strncpy(field->value, value, sizeof(field->value));
+ STRNCPY(field->key, key);
+ STRNCPY(field->value, value);
BLI_addtail(&stamp_data->custom_fields, field);
}
@@ -3001,7 +3002,7 @@ static void image_init_multilayer_multiview(Image *ima, RenderResult *rr)
if (rr) {
for (RenderView *rv = rr->views.first; rv; rv = rv->next) {
ImageView *iv = MEM_callocN(sizeof(ImageView), "Viewer Image View");
- BLI_strncpy(iv->name, rv->name, sizeof(iv->name));
+ STRNCPY(iv->name, rv->name);
BLI_addtail(&ima->views, iv);
}
}
@@ -3082,8 +3083,8 @@ static void image_add_view(Image *ima, const char *viewname, const char *filepat
ImageView *iv;
iv = MEM_mallocN(sizeof(ImageView), "Viewer Image View");
- BLI_strncpy(iv->name, viewname, sizeof(iv->name));
- BLI_strncpy(iv->filepath, filepath, sizeof(iv->filepath));
+ STRNCPY(iv->name, viewname);
+ STRNCPY(iv->filepath, filepath);
/* For stereo drawing we need to ensure:
* STEREO_LEFT_NAME == STEREO_LEFT_ID and
@@ -3533,7 +3534,7 @@ static ImBuf *load_image_single(
ImagePackedFile *imapf = MEM_mallocN(sizeof(ImagePackedFile), "Image Packefile");
BLI_addtail(&ima->packedfiles, imapf);
- BLI_strncpy(imapf->filepath, filepath, sizeof(imapf->filepath));
+ STRNCPY(imapf->filepath, filepath);
imapf->packedfile = newPackedFile(NULL, filepath, ID_BLEND_PATH(G.main, &ima->id));
}
}
@@ -4688,7 +4689,7 @@ static void image_update_views_format(Image *ima, ImageUser *iuser)
for (srv = scene->r.views.first; srv; srv = srv->next) {
if (BKE_scene_multiview_is_render_view_active(&scene->r, srv)) {
char filepath[FILE_MAX];
- BLI_snprintf(filepath, sizeof(filepath), "%s%s%s", prefix, srv->suffix, ext);
+ SNPRINTF(filepath, "%s%s%s", prefix, srv->suffix, ext);
image_add_view(ima, srv->name, filepath);
}
}
@@ -4699,7 +4700,7 @@ static void image_update_views_format(Image *ima, ImageUser *iuser)
int file;
char str[FILE_MAX];
- BLI_strncpy(str, iv->filepath, sizeof(str));
+ STRNCPY(str, iv->filepath);
BLI_path_abs(str, G.main->name);
/* exists? */
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c
index 09f4b2fdc01..760c6a60976 100644
--- a/source/blender/blenkernel/intern/undo_system.c
+++ b/source/blender/blenkernel/intern/undo_system.c
@@ -18,8 +18,8 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/util/undo_system.c
- * \ingroup edutil
+/** \file blender/blenkernel/intern/undo_system.c
+ * \ingroup bke
*
* Used by ED_undo.h, internal implementation.
*/
diff --git a/source/blender/blenlib/BLI_string_utf8.h b/source/blender/blenlib/BLI_string_utf8.h
index 32504a88b48..21542d0d6e1 100644
--- a/source/blender/blenlib/BLI_string_utf8.h
+++ b/source/blender/blenlib/BLI_string_utf8.h
@@ -77,6 +77,16 @@ size_t BLI_str_partition_ex_utf8(
#define BLI_UTF8_WIDTH_MAX 2 /* columns */
#define BLI_UTF8_ERR ((unsigned int)-1)
+/** \name String Copy/Format Macros
+ * Avoid repeating destination with `sizeof(..)`.
+ * \note `ARRAY_SIZE` allows pointers on some platforms.
+ * \{ */
+#define STRNCPY_UTF8(dst, src) \
+ BLI_strncpy_utf8(dst, src, ARRAY_SIZE(dst))
+#define STRNCPY_UTF8_RLEN(dst, src) \
+ BLI_strncpy_utf8_rlen(dst, src, ARRAY_SIZE(dst))
+/** \} */
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/collada/AnimationImporter.cpp b/source/blender/collada/AnimationImporter.cpp
index 31dd7d5de46..b12ecb50e32 100644
--- a/source/blender/collada/AnimationImporter.cpp
+++ b/source/blender/collada/AnimationImporter.cpp
@@ -592,6 +592,12 @@ void AnimationImporter:: Assign_color_animations(const COLLADAFW::UniqueId& list
BLI_strncpy(rna_path, anim_type, sizeof(rna_path));
const COLLADAFW::AnimationList *animlist = animlist_map[listid];
+ if (animlist == NULL)
+ {
+ fprintf(stderr, "Collada: No animlist found for ID: %s of type %s\n", listid.toAscii().c_str(), anim_type);
+ return;
+ }
+
const COLLADAFW::AnimationList::AnimationBindings& bindings = animlist->getAnimationBindings();
//all the curves belonging to the current binding
std::vector<FCurve *> animcurves;
@@ -889,11 +895,22 @@ static const double get_aspect_ratio(const COLLADAFW::Camera *camera)
return aspect;
}
+static ListBase &get_animation_curves(Material *ma)
+{
+ bAction *act;
+ if (!ma->adt || !ma->adt->action)
+ act = verify_adt_action((ID *)&ma->id, 1);
+ else
+ act = ma->adt->action;
+
+ return act->curves;
+}
void AnimationImporter::translate_Animations(COLLADAFW::Node *node,
std::map<COLLADAFW::UniqueId, COLLADAFW::Node *>& root_map,
std::multimap<COLLADAFW::UniqueId, Object *>& object_map,
- std::map<COLLADAFW::UniqueId, const COLLADAFW::Object *> FW_object_map)
+ std::map<COLLADAFW::UniqueId, const COLLADAFW::Object *> FW_object_map,
+ std::map<COLLADAFW::UniqueId, Material*> uid_material_map)
{
bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
COLLADAFW::UniqueId uid = node->getUniqueId();
@@ -1071,11 +1088,6 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node,
}
}
if (animType->material != 0) {
- Material *ma = give_current_material(ob, 1);
- if (!ma->adt || !ma->adt->action) act = verify_adt_action((ID *)&ma->id, 1);
- else act = ma->adt->action;
-
- ListBase *AnimCurves = &(act->curves);
const COLLADAFW::InstanceGeometryPointerArray& nodeGeoms = node->getInstanceGeometries();
for (unsigned int i = 0; i < nodeGeoms.getCount(); i++) {
@@ -1084,30 +1096,36 @@ void AnimationImporter::translate_Animations(COLLADAFW::Node *node,
const COLLADAFW::UniqueId & matuid = matBinds[j].getReferencedMaterial();
const COLLADAFW::Effect *ef = (COLLADAFW::Effect *) (FW_object_map[matuid]);
if (ef != NULL) { /* can be NULL [#28909] */
- const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
+ Material *ma = uid_material_map[matuid];
+ if (!ma) {
+ fprintf(stderr, "Collada: Node %s refers to undefined material\n", node->getName().c_str());
+ continue;
+ }
+ ListBase &AnimCurves = get_animation_curves(ma);
+ const COLLADAFW::CommonEffectPointerArray& commonEffects = ef->getCommonEffects();
COLLADAFW::EffectCommon *efc = commonEffects[0];
if ((animType->material & MATERIAL_SHININESS) != 0) {
const COLLADAFW::FloatOrParam *shin = &(efc->getShininess());
- const COLLADAFW::UniqueId& listid = shin->getAnimationList();
- Assign_float_animations(listid, AnimCurves, "specular_hardness");
+ const COLLADAFW::UniqueId& listid = shin->getAnimationList();
+ Assign_float_animations(listid, &AnimCurves, "specular_hardness");
}
if ((animType->material & MATERIAL_IOR) != 0) {
const COLLADAFW::FloatOrParam *ior = &(efc->getIndexOfRefraction());
- const COLLADAFW::UniqueId& listid = ior->getAnimationList();
- Assign_float_animations(listid, AnimCurves, "raytrace_transparency.ior");
+ const COLLADAFW::UniqueId& listid = ior->getAnimationList();
+ Assign_float_animations(listid, &AnimCurves, "raytrace_transparency.ior");
}
if ((animType->material & MATERIAL_SPEC_COLOR) != 0) {
const COLLADAFW::ColorOrTexture *cot = &(efc->getSpecular());
- const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
- Assign_color_animations(listid, AnimCurves, "specular_color");
+ const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
+ Assign_color_animations(listid, &AnimCurves, "specular_color");
}
if ((animType->material & MATERIAL_DIFF_COLOR) != 0) {
const COLLADAFW::ColorOrTexture *cot = &(efc->getDiffuse());
- const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
- Assign_color_animations(listid, AnimCurves, "diffuse_color");
+ const COLLADAFW::UniqueId& listid = cot->getColor().getAnimationList();
+ Assign_color_animations(listid, &AnimCurves, "diffuse_color");
}
}
}
diff --git a/source/blender/collada/AnimationImporter.h b/source/blender/collada/AnimationImporter.h
index 1f2de2f3162..e25116cac9f 100644
--- a/source/blender/collada/AnimationImporter.h
+++ b/source/blender/collada/AnimationImporter.h
@@ -156,7 +156,8 @@ public:
void translate_Animations(COLLADAFW::Node * Node,
std::map<COLLADAFW::UniqueId, COLLADAFW::Node*>& root_map,
std::multimap<COLLADAFW::UniqueId, Object*>& object_map,
- std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map);
+ std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map,
+ std::map<COLLADAFW::UniqueId, Material*> uid_material_map);
AnimMix* get_animation_type( const COLLADAFW::Node * node, std::map<COLLADAFW::UniqueId, const COLLADAFW::Object*> FW_object_map );
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index 7999b3c4727..97b11f72509 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -317,7 +317,7 @@ void DocumentImporter::translate_anim_recursive(COLLADAFW::Node *node, COLLADAFW
translate_anim_recursive(node, node, parob);
}
else {
- anim_importer.translate_Animations(node, root_map, object_map, FW_object_map);
+ anim_importer.translate_Animations(node, root_map, object_map, FW_object_map, uid_material_map);
COLLADAFW::NodePointerArray &children = node->getChildNodes();
for (i = 0; i < children.getCount(); i++) {
translate_anim_recursive(children[i], node, NULL);
diff --git a/source/blender/editors/io/io_collada.c b/source/blender/editors/io/io_collada.c
index a42aeee912b..4d0d59ae42c 100644
--- a/source/blender/editors/io/io_collada.c
+++ b/source/blender/editors/io/io_collada.c
@@ -151,7 +151,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op)
include_animations = RNA_boolean_get(op->ptr, "include_animations");
sample_animations = RNA_boolean_get(op->ptr, "sample_animations");
- sampling_rate = (sample_animations)? RNA_int_get(op->ptr, "sampling_rate") : 0;
+ sampling_rate = (sample_animations) ? RNA_int_get(op->ptr, "sampling_rate") : 0;
deform_bones_only = RNA_boolean_get(op->ptr, "deform_bones_only");
@@ -490,8 +490,7 @@ static int wm_collada_import_exec(bContext *C, wmOperator *op)
import_settings.min_chain_length = min_chain_length;
import_settings.keep_bind_info = keep_bind_info != 0;
- if (collada_import(C, &import_settings) )
- {
+ if (collada_import(C, &import_settings)) {
DEG_id_tag_update(&CTX_data_scene(C)->id, DEG_TAG_BASE_FLAGS_UPDATE);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/editors/lattice/lattice_intern.h b/source/blender/editors/lattice/lattice_intern.h
index 94f528a0457..7902b992270 100644
--- a/source/blender/editors/lattice/lattice_intern.h
+++ b/source/blender/editors/lattice/lattice_intern.h
@@ -21,7 +21,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/metaball/lattice_intern.h
+/** \file blender/editors/lattice/lattice_intern.h
* \ingroup edlattice
*/
diff --git a/source/blender/editors/lattice/lattice_ops.c b/source/blender/editors/lattice/lattice_ops.c
index 37a10cbe12a..d3d57a0b510 100644
--- a/source/blender/editors/lattice/lattice_ops.c
+++ b/source/blender/editors/lattice/lattice_ops.c
@@ -24,7 +24,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/metaball/lattice_ops.c
+/** \file blender/editors/lattice/lattice_ops.c
* \ingroup edlattice
*/
diff --git a/source/blender/editors/render/render_internal.c b/source/blender/editors/render/render_internal.c
index e1e5c788b02..f8b1861b204 100644
--- a/source/blender/editors/render/render_internal.c
+++ b/source/blender/editors/render/render_internal.c
@@ -643,7 +643,7 @@ static void render_image_restore_layer(RenderJob *rj)
/* For single layer renders keep the active layer
* visible, or show the compositing result. */
RenderResult *rr = RE_AcquireResultRead(rj->re);
- if(RE_HasCombinedLayer(rr)) {
+ if (RE_HasCombinedLayer(rr)) {
sima->iuser.layer = 0;
}
RE_ReleaseResult(rj->re);
diff --git a/source/blender/editors/undo/ed_undo.c b/source/blender/editors/undo/ed_undo.c
index 09abc1f3878..d8b194e3336 100644
--- a/source/blender/editors/undo/ed_undo.c
+++ b/source/blender/editors/undo/ed_undo.c
@@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/util/undo.c
+/** \file blender/editors/undo/ed_undo.c
* \ingroup edundo
*/
diff --git a/source/blender/editors/undo/memfile_undo.c b/source/blender/editors/undo/memfile_undo.c
index b588aa8fb13..f4ed96f98f3 100644
--- a/source/blender/editors/undo/memfile_undo.c
+++ b/source/blender/editors/undo/memfile_undo.c
@@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/util/memfile_undo.c
+/** \file blender/editors/undo/memfile_undo.c
* \ingroup edundo
*
* Wrapper between 'ED_undo.h' and 'BKE_undo_system.h' API's.
diff --git a/source/blender/editors/undo/undo_system_types.c b/source/blender/editors/undo/undo_system_types.c
index 4dbd22d6d22..75c3d2cc1b7 100644
--- a/source/blender/editors/undo/undo_system_types.c
+++ b/source/blender/editors/undo/undo_system_types.c
@@ -18,7 +18,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/editors/util/undo_system_types.c
+/** \file blender/editors/undo/undo_system_types.c
* \ingroup edundo
*/
diff --git a/source/blender/imbuf/IMB_metadata.h b/source/blender/imbuf/IMB_metadata.h
index 0a0d2c1faf6..6a29fa01594 100644
--- a/source/blender/imbuf/IMB_metadata.h
+++ b/source/blender/imbuf/IMB_metadata.h
@@ -25,7 +25,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
-/** \file blender/imbuf/intern/IMB_metadata.h
+/** \file blender/imbuf/IMB_metadata.h
* \ingroup imbuf
*/
diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c
index c019b0b1363..e340d082895 100644
--- a/source/blender/imbuf/intern/writeimage.c
+++ b/source/blender/imbuf/intern/writeimage.c
@@ -81,7 +81,7 @@ short IMB_saveiff(struct ImBuf *ibuf, const char *name, int flags)
bool IMB_prepare_write_ImBuf(const bool isfloat, ImBuf *ibuf)
{
- bool changed = false;
+ bool changed = false;
if (isfloat) {
/* pass */
@@ -90,9 +90,9 @@ bool IMB_prepare_write_ImBuf(const bool isfloat, ImBuf *ibuf)
if (ibuf->rect == NULL && ibuf->rect_float) {
ibuf->rect_colorspace = colormanage_colorspace_get_roled(COLOR_ROLE_DEFAULT_BYTE);
IMB_rect_from_float(ibuf);
- if (ibuf->rect != NULL) {
- changed = true;
- }
+ if (ibuf->rect != NULL) {
+ changed = true;
+ }
}
}
diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c
index de3476264a7..2594eb654e8 100644
--- a/source/blender/makesrna/intern/rna_scene.c
+++ b/source/blender/makesrna/intern/rna_scene.c
@@ -5230,7 +5230,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
};
static const EnumPropertyItem ffmpeg_codec_items[] = {
- {AV_CODEC_ID_NONE, "NONE", 0, "None", ""},
+ {AV_CODEC_ID_NONE, "NONE", 0, "No Video", "Disables video output, for audio-only renders"},
{AV_CODEC_ID_MPEG1VIDEO, "MPEG1", 0, "MPEG-1", ""},
{AV_CODEC_ID_MPEG2VIDEO, "MPEG2", 0, "MPEG-2", ""},
{AV_CODEC_ID_MPEG4, "MPEG4", 0, "MPEG-4(divx)", ""},
@@ -5260,8 +5260,8 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
};
static const EnumPropertyItem ffmpeg_crf_items[] = {
- {FFM_CRF_NONE, "NONE", 0, "None; use custom bitrate",
- "Use constant bit rate, rather than constant output quality"},
+ {FFM_CRF_NONE, "NONE", 0, "Constant Bitrate",
+ "Configure constant bit rate, rather than constant output quality"},
{FFM_CRF_LOSSLESS, "LOSSLESS", 0, "Lossless", ""},
{FFM_CRF_PERC_LOSSLESS, "PERC_LOSSLESS", 0, "Perceptually lossless", ""},
{FFM_CRF_HIGH, "HIGH", 0, "High quality", ""},
@@ -5273,7 +5273,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
};
static const EnumPropertyItem ffmpeg_audio_codec_items[] = {
- {AV_CODEC_ID_NONE, "NONE", 0, "None", ""},
+ {AV_CODEC_ID_NONE, "NONE", 0, "No Audio", "Disables audio output, for video-only renders"},
{AV_CODEC_ID_MP2, "MP2", 0, "MP2", ""},
{AV_CODEC_ID_MP3, "MP3", 0, "MP3", ""},
{AV_CODEC_ID_AC3, "AC3", 0, "AC3", ""},
@@ -5312,7 +5312,7 @@ static void rna_def_scene_ffmpeg_settings(BlenderRNA *brna)
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_enum_items(prop, ffmpeg_codec_items);
RNA_def_property_enum_default(prop, AV_CODEC_ID_H264);
- RNA_def_property_ui_text(prop, "Codec", "FFmpeg codec to use");
+ RNA_def_property_ui_text(prop, "Video Codec", "FFmpeg codec to use for video output");
RNA_def_property_update(prop, NC_SCENE | ND_RENDER_OPTIONS, "rna_FFmpegSettings_codec_settings_update");
prop = RNA_def_property(srna, "video_bitrate", PROP_INT, PROP_NONE);
diff --git a/source/blender/makesrna/intern/rna_smoke.c b/source/blender/makesrna/intern/rna_smoke.c
index 8fe97885f49..d5580ae35ad 100644
--- a/source/blender/makesrna/intern/rna_smoke.c
+++ b/source/blender/makesrna/intern/rna_smoke.c
@@ -907,7 +907,7 @@ static void rna_def_smoke_domain_settings(BlenderRNA *brna)
RNA_def_property_range(prop, 0.0, 1.0);
RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 3);
RNA_def_property_ui_text(prop, "Clipping",
- "Value under which voxels are considered empty space to optimize caching or rendering");
+ "Value under which voxels are considered empty space to optimize caching or rendering");
RNA_def_property_update(prop, NC_OBJECT | ND_MODIFIER, NULL);
}
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c
index e51833e4474..4fbd9af1b58 100644
--- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.c
+++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.c
@@ -41,7 +41,7 @@ static bNodeSocketTemplate sh_node_volume_principled_in[] = {
{ SOCK_FLOAT, 1, N_("Blackbody Intensity"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f, PROP_FACTOR},
{ SOCK_RGBA, 1, N_("Blackbody Tint"), 1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f},
{ SOCK_FLOAT, 1, N_("Temperature"), 1000.0f, 0.0f, 0.0f, 0.0f, 0.0f, 6500.0f},
- { SOCK_STRING, 1, N_("Temperature Attribute"),0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
+ { SOCK_STRING, 1, N_("Temperature Attribute"), 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
{ -1, 0, "" }
};
diff --git a/source/blender/windowmanager/WM_undo.h b/source/blender/windowmanager/WM_undo.h
deleted file mode 100644
index e69de29bb2d..00000000000
--- a/source/blender/windowmanager/WM_undo.h
+++ /dev/null
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 51b25d3e7de..094275920d3 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -381,7 +381,7 @@ static uiBlock *block_create_confirm_quit(struct bContext *C, struct ARegion *ar
uiStyle *style = UI_style_get();
uiBlock *block = UI_block_begin(C, ar, "confirm_quit_popup", UI_EMBOSS);
- UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_LOOP | UI_BLOCK_NO_WIN_CLIP );
+ UI_block_flag_enable(block, UI_BLOCK_KEEP_OPEN | UI_BLOCK_LOOP | UI_BLOCK_NO_WIN_CLIP | UI_BLOCK_NUMSELECT);
UI_block_emboss_set(block, UI_EMBOSS);
uiLayout *layout = UI_block_layout(