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:
authorKévin Dietrich <kevin.dietrich@mailoo.org>2022-04-08 18:57:35 +0300
committerKévin Dietrich <kevin.dietrich@mailoo.org>2022-04-08 18:57:35 +0300
commitf3a475a76721a8333396ce1801124a15278b4d1f (patch)
tree94e78d60f2bc631ada663c3afc2fef0e01280733 /source/blender/io/usd/intern
parent8b7cd1ed2a17e40661101eea4adae99e8e3d02e9 (diff)
Cleanup: CacheFile, use double precision for time
Both the Alembic and USD libraries use double precision floating point numbers internally to store time. However the Alembic I/O code defaulted to floats even though Blender's Scene FPS, which is generally used for look ups, is stored using a double type. Such downcasts could lead to imprecise lookups, and would cause compilation warnings (at least on MSVC). This modifies the Alembic exporter and importer to make use of doubles for the current scene time, and only downcasting to float at the very last steps (e.g. for vertex interpolation). For the importer, doubles are also used for computing interpolation weights, as it is based on a time offset. Although the USD code already used doubles internally, floats were used at the C API level. Those were replaced as well. Differential Revision: https://developer.blender.org/D13855
Diffstat (limited to 'source/blender/io/usd/intern')
-rw-r--r--source/blender/io/usd/intern/usd_capi_import.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/io/usd/intern/usd_capi_import.cc b/source/blender/io/usd/intern/usd_capi_import.cc
index e5083700d7d..58cd7d5014e 100644
--- a/source/blender/io/usd/intern/usd_capi_import.cc
+++ b/source/blender/io/usd/intern/usd_capi_import.cc
@@ -423,7 +423,7 @@ static USDPrimReader *get_usd_reader(CacheReader *reader, Object * /* ob */, con
struct Mesh *USD_read_mesh(struct CacheReader *reader,
struct Object *ob,
struct Mesh *existing_mesh,
- const float time,
+ const double time,
const char **err_str,
const int read_flag)
{
@@ -437,7 +437,7 @@ struct Mesh *USD_read_mesh(struct CacheReader *reader,
}
bool USD_mesh_topology_changed(
- CacheReader *reader, Object *ob, Mesh *existing_mesh, const float time, const char **err_str)
+ CacheReader *reader, Object *ob, Mesh *existing_mesh, const double time, const char **err_str)
{
USDGeomReader *usd_reader = dynamic_cast<USDGeomReader *>(get_usd_reader(reader, ob, err_str));