diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-02-26 02:15:59 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2017-02-26 02:15:59 +0300 |
commit | 3cf2821f2f09d3c55dd88c2b6fb3b26e1ff69a7e (patch) | |
tree | 66ffef104bffcd2490d929c9789fc2cbc11e73ad /source/blender/alembic | |
parent | bda0456933e87c2f623a8e4f980bf7cfc6b3982a (diff) | |
parent | 5c3216e2334863137019b55a44d5b9cfea842c10 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/alembic')
-rw-r--r-- | source/blender/alembic/intern/abc_customdata.cc | 5 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_mesh.cc | 2 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_util.cc | 14 | ||||
-rw-r--r-- | source/blender/alembic/intern/abc_util.h | 19 | ||||
-rw-r--r-- | source/blender/alembic/intern/alembic_capi.cc | 4 |
5 files changed, 43 insertions, 1 deletions
diff --git a/source/blender/alembic/intern/abc_customdata.cc b/source/blender/alembic/intern/abc_customdata.cc index ebf1b2ba96e..0d11ab79ddd 100644 --- a/source/blender/alembic/intern/abc_customdata.cc +++ b/source/blender/alembic/intern/abc_customdata.cc @@ -327,6 +327,11 @@ static void read_custom_data_ex(const ICompoundProperty &prop, } else if (data_type == CD_MLOOPUV) { IV2fGeomParam uv_param(prop, prop_header.getName()); + + if (!uv_param.isIndexed()) { + return; + } + IV2fGeomParam::Sample sample; uv_param.getIndexed(sample, iss); diff --git a/source/blender/alembic/intern/abc_mesh.cc b/source/blender/alembic/intern/abc_mesh.cc index 8bc9c335054..5a57e43326a 100644 --- a/source/blender/alembic/intern/abc_mesh.cc +++ b/source/blender/alembic/intern/abc_mesh.cc @@ -691,7 +691,7 @@ static void assign_materials(Main *bmain, Object *ob, const std::map<std::string assigned_name = mat_iter->second; } - assign_material(ob, assigned_name, it->second, BKE_MAT_ASSIGN_OBJECT); + assign_material(ob, assigned_name, it->second, BKE_MAT_ASSIGN_OBDATA); } } } diff --git a/source/blender/alembic/intern/abc_util.cc b/source/blender/alembic/intern/abc_util.cc index bb375eb9561..5b45dff4b7f 100644 --- a/source/blender/alembic/intern/abc_util.cc +++ b/source/blender/alembic/intern/abc_util.cc @@ -38,6 +38,8 @@ extern "C" { #include "DNA_layer_types.h" #include "BLI_math.h" + +#include "PIL_time.h" } std::string get_id_name(Object *ob) @@ -512,3 +514,15 @@ AbcObjectReader *create_reader(const Alembic::AbcGeom::IObject &object, ImportSe return reader; } + +/* ********************** */ + +ScopeTimer::ScopeTimer(const char *message) + : m_message(message) + , m_start(PIL_check_seconds_timer()) +{} + +ScopeTimer::~ScopeTimer() +{ + fprintf(stderr, "%s: %fs\n", m_message, PIL_check_seconds_timer() - m_start); +} diff --git a/source/blender/alembic/intern/abc_util.h b/source/blender/alembic/intern/abc_util.h index 328f2c41a87..a878029928c 100644 --- a/source/blender/alembic/intern/abc_util.h +++ b/source/blender/alembic/intern/abc_util.h @@ -146,4 +146,23 @@ ABC_INLINE void copy_yup_from_zup(short yup[3], const short zup[3]) yup[2] = -zup[1]; } +/* *************************** */ + +#undef ABC_DEBUG_TIME + +class ScopeTimer { + const char *m_message; + double m_start; + +public: + ScopeTimer(const char *message); + ~ScopeTimer(); +}; + +#ifdef ABC_DEBUG_TIME +# define SCOPE_TIMER(message) ScopeTimer prof(message) +#else +# define SCOPE_TIMER(message) +#endif + #endif /* __ABC_UTIL_H__ */ diff --git a/source/blender/alembic/intern/alembic_capi.cc b/source/blender/alembic/intern/alembic_capi.cc index fcfe634924f..ee8ec0fa68c 100644 --- a/source/blender/alembic/intern/alembic_capi.cc +++ b/source/blender/alembic/intern/alembic_capi.cc @@ -558,6 +558,8 @@ ABC_INLINE bool is_mesh_and_strands(const IObject &object) static void import_startjob(void *user_data, short *stop, short *do_update, float *progress) { + SCOPE_TIMER("Alembic import, objects reading and creation"); + ImportJobData *data = static_cast<ImportJobData *>(user_data); data->stop = stop; @@ -693,6 +695,8 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa static void import_endjob(void *user_data) { + SCOPE_TIMER("Alembic import, cleanup"); + ImportJobData *data = static_cast<ImportJobData *>(user_data); std::vector<AbcObjectReader *>::iterator iter; |