diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/io/alembic/ABC_alembic.h | 14 | ||||
-rw-r--r-- | source/blender/io/alembic/intern/alembic_capi.cc | 17 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_meshsequencecache.cc | 15 |
3 files changed, 25 insertions, 21 deletions
diff --git a/source/blender/io/alembic/ABC_alembic.h b/source/blender/io/alembic/ABC_alembic.h index d7d3adefc33..ded3258ff18 100644 --- a/source/blender/io/alembic/ABC_alembic.h +++ b/source/blender/io/alembic/ABC_alembic.h @@ -99,15 +99,19 @@ void ABC_get_transform(struct CacheReader *reader, double time, float scale); +typedef struct ABCReadParams { + double time; + int read_flags; + const char *velocity_name; + float velocity_scale; +} ABCReadParams; + /* Either modifies existing_mesh in-place or constructs a new mesh. */ struct Mesh *ABC_read_mesh(struct CacheReader *reader, struct Object *ob, struct Mesh *existing_mesh, - double time, - const char **err_str, - int read_flags, - const char *velocity_name, - float velocity_scale); + const ABCReadParams *params, + const char **err_str); bool ABC_mesh_topology_changed(struct CacheReader *reader, struct Object *ob, diff --git a/source/blender/io/alembic/intern/alembic_capi.cc b/source/blender/io/alembic/intern/alembic_capi.cc index fe459ce4370..0d4e1d04db0 100644 --- a/source/blender/io/alembic/intern/alembic_capi.cc +++ b/source/blender/io/alembic/intern/alembic_capi.cc @@ -785,20 +785,21 @@ static ISampleSelector sample_selector_for_time(chrono_t time) Mesh *ABC_read_mesh(CacheReader *reader, Object *ob, Mesh *existing_mesh, - const double time, - const char **err_str, - const int read_flag, - const char *velocity_name, - const float velocity_scale) + const ABCReadParams *params, + const char **err_str) { AbcObjectReader *abc_reader = get_abc_reader(reader, ob, err_str); if (abc_reader == nullptr) { return nullptr; } - ISampleSelector sample_sel = sample_selector_for_time(time); - return abc_reader->read_mesh( - existing_mesh, sample_sel, read_flag, velocity_name, velocity_scale, err_str); + ISampleSelector sample_sel = sample_selector_for_time(params->time); + return abc_reader->read_mesh(existing_mesh, + sample_sel, + params->read_flags, + params->velocity_name, + params->velocity_scale, + err_str); } bool ABC_mesh_topology_changed(CacheReader *reader, diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.cc b/source/blender/modifiers/intern/MOD_meshsequencecache.cc index 7dbd4c5b260..998fb0a94a3 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.cc +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.cc @@ -226,14 +226,13 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * velocity_scale *= FPS; } - result = ABC_read_mesh(mcmd->reader, - ctx->object, - mesh, - time, - &err_str, - mcmd->read_flag, - mcmd->cache_file->velocity_name, - velocity_scale); + ABCReadParams params = {}; + params.time = time; + params.read_flags = mcmd->read_flag; + params.velocity_name = mcmd->cache_file->velocity_name; + params.velocity_scale = velocity_scale; + + result = ABC_read_mesh(mcmd->reader, ctx->object, mesh, ¶ms, &err_str); # endif break; } |