Merge branch 'blender-v4.5-release'
This commit is contained in:
@@ -110,7 +110,8 @@ static bool is_disabled(const Scene * /*scene*/, ModifierData *md, bool /*use_re
|
||||
static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd,
|
||||
const ModifierEvalContext *ctx,
|
||||
const Mesh *mesh,
|
||||
const float time,
|
||||
const double frame_offset,
|
||||
const double time_offset,
|
||||
const char **r_err_str)
|
||||
{
|
||||
if ((ctx->flag & MOD_APPLY_ORCO) == 0) {
|
||||
@@ -122,7 +123,7 @@ static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd,
|
||||
switch (cache_file->type) {
|
||||
case CACHEFILE_TYPE_ALEMBIC:
|
||||
# ifdef WITH_ALEMBIC
|
||||
if (!ABC_mesh_topology_changed(mcmd->reader, ctx->object, mesh, time, r_err_str)) {
|
||||
if (!ABC_mesh_topology_changed(mcmd->reader, ctx->object, mesh, time_offset, r_err_str)) {
|
||||
return true;
|
||||
}
|
||||
# endif
|
||||
@@ -130,7 +131,7 @@ static bool can_use_mesh_for_orco_evaluation(MeshSeqCacheModifierData *mcmd,
|
||||
case CACHEFILE_TYPE_USD:
|
||||
# ifdef WITH_USD
|
||||
if (!blender::io::usd::USD_mesh_topology_changed(
|
||||
mcmd->reader, ctx->object, mesh, time, r_err_str))
|
||||
mcmd->reader, ctx->object, mesh, frame_offset, r_err_str))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
@@ -173,9 +174,9 @@ static void modify_geometry_set(ModifierData *md,
|
||||
|
||||
Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
|
||||
CacheFile *cache_file = mcmd->cache_file;
|
||||
const float frame = DEG_get_ctime(ctx->depsgraph);
|
||||
const double frame_offset = BKE_cachefile_frame_offset(cache_file, double(frame));
|
||||
const double time = BKE_cachefile_time_offset(cache_file, frame, FPS);
|
||||
const double frame = double(DEG_get_ctime(ctx->depsgraph));
|
||||
const double frame_offset = BKE_cachefile_frame_offset(cache_file, frame);
|
||||
const double time_offset = BKE_cachefile_time_offset(cache_file, frame, FPS);
|
||||
const char *err_str = nullptr;
|
||||
|
||||
if (!mcmd->reader || !STREQ(mcmd->reader_object_path, mcmd->object_path)) {
|
||||
@@ -190,7 +191,7 @@ static void modify_geometry_set(ModifierData *md,
|
||||
|
||||
if (geometry_set->has_mesh()) {
|
||||
const Mesh *mesh = geometry_set->get_mesh();
|
||||
if (can_use_mesh_for_orco_evaluation(mcmd, ctx, mesh, time, &err_str)) {
|
||||
if (can_use_mesh_for_orco_evaluation(mcmd, ctx, mesh, frame_offset, time_offset, &err_str)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -226,7 +227,7 @@ static void modify_geometry_set(ModifierData *md,
|
||||
case CACHEFILE_TYPE_ALEMBIC: {
|
||||
# ifdef WITH_ALEMBIC
|
||||
ABCReadParams params;
|
||||
params.time = time;
|
||||
params.time = time_offset;
|
||||
params.read_flags = mcmd->read_flag;
|
||||
params.velocity_name = mcmd->cache_file->velocity_name;
|
||||
params.velocity_scale = velocity_scale;
|
||||
@@ -269,8 +270,9 @@ static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh
|
||||
|
||||
Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph);
|
||||
CacheFile *cache_file = mcmd->cache_file;
|
||||
const float frame = DEG_get_ctime(ctx->depsgraph);
|
||||
const double time = BKE_cachefile_time_offset(cache_file, double(frame), FPS);
|
||||
const double frame = double(DEG_get_ctime(ctx->depsgraph));
|
||||
const double frame_offset = BKE_cachefile_frame_offset(cache_file, frame);
|
||||
const double time_offset = BKE_cachefile_time_offset(cache_file, frame, FPS);
|
||||
const char *err_str = nullptr;
|
||||
|
||||
if (!mcmd->reader || !STREQ(mcmd->reader_object_path, mcmd->object_path)) {
|
||||
@@ -291,7 +293,7 @@ static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh
|
||||
|
||||
/* If this invocation is for the ORCO mesh, and the mesh hasn't changed topology, we
|
||||
* must return the mesh as-is instead of deforming it. */
|
||||
if (can_use_mesh_for_orco_evaluation(mcmd, ctx, mesh, time, &err_str)) {
|
||||
if (can_use_mesh_for_orco_evaluation(mcmd, ctx, mesh, frame_offset, time_offset, &err_str)) {
|
||||
return mesh;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user