diff options
author | Alexander Romanov <a.romanov@blend4web.com> | 2017-07-03 19:49:35 +0300 |
---|---|---|
committer | Alexander Romanov <a.romanov@blend4web.com> | 2017-07-03 19:53:00 +0300 |
commit | e1482841dd5dd55cb453d37d115ec80f44c02316 (patch) | |
tree | 63cee90e2ab7b4316b4e36ffeb181700e99d6aab /source/blender/editors | |
parent | 1ad0cc6bde4746949eee7a9babb97178a05816c3 (diff) | |
parent | 1fb30758034c2f83862bb7fc5f30a1a4d7b4510b (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/io/io_alembic.c | 18 | ||||
-rw-r--r-- | source/blender/editors/object/object_add.c | 3 | ||||
-rw-r--r-- | source/blender/editors/render/render_preview.c | 2 |
3 files changed, 19 insertions, 4 deletions
diff --git a/source/blender/editors/io/io_alembic.c b/source/blender/editors/io/io_alembic.c index fb20d9f3caa..ca4ab30a08d 100644 --- a/source/blender/editors/io/io_alembic.c +++ b/source/blender/editors/io/io_alembic.c @@ -31,6 +31,9 @@ # include "BLI_winstuff.h" #endif +#include <string.h> +#include <errno.h> + #include "MEM_guardedalloc.h" #include "DNA_mesh_types.h" @@ -417,9 +420,20 @@ static int get_sequence_len(char *filename, int *ofs) } char path[FILE_MAX]; + BLI_path_abs(filename, G.main->name); BLI_split_dir_part(filename, path, FILE_MAX); + if (path[0] == '\0') { + /* The filename had no path, so just use the blend file path. */ + BLI_split_dir_part(G.main->name, path, FILE_MAX); + } + DIR *dir = opendir(path); + if (dir == NULL) { + fprintf(stderr, "Error opening directory '%s': %s\n", + path, errno ? strerror(errno) : "unknown error"); + return -1; + } const char *ext = ".abc"; const char *basename = BLI_path_basename(filename); @@ -523,6 +537,10 @@ static int wm_alembic_import_exec(bContext *C, wmOperator *op) if (is_sequence) { sequence_len = get_sequence_len(filename, &offset); + if (sequence_len < 0) { + BKE_report(op->reports, RPT_ERROR, "Unable to determine ABC sequence length"); + return OPERATOR_CANCELLED; + } } bool ok = ABC_import(C, filename, scale, is_sequence, set_frame_range, diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 6b80de7c41a..491dddb066a 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1541,8 +1541,6 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, } if (ob_dst->parent) { - invert_m4_m4(ob_dst->parentinv, dob->mat); - /* note, this may be the parent of other objects, but it should * still work out ok */ BKE_object_apply_mat4(ob_dst, dob->mat, false, true); @@ -1563,7 +1561,6 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base, ob_dst->partype = PAROBJECT; /* similer to the code above, see comments */ - invert_m4_m4(ob_dst->parentinv, dob->mat); BKE_object_apply_mat4(ob_dst, dob->mat, false, true); DEG_id_tag_update(&ob_dst->id, OB_RECALC_OB); } diff --git a/source/blender/editors/render/render_preview.c b/source/blender/editors/render/render_preview.c index ae938c3fa30..7292856567f 100644 --- a/source/blender/editors/render/render_preview.c +++ b/source/blender/editors/render/render_preview.c @@ -1252,7 +1252,7 @@ void ED_preview_icon_render(Main *bmain, Scene *scene, ID *id, unsigned int *rec ip.bmain = bmain; ip.scene = scene; - ip.owner = id; + ip.owner = BKE_previewimg_id_ensure(id); ip.id = id; icon_preview_add_size(&ip, rect, sizex, sizey); |