Skip to content
Snippets Groups Projects
  • Kévin Dietrich's avatar
    f3a475a7
    Cleanup: CacheFile, use double precision for time · f3a475a7
    Kévin Dietrich authored
    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
    f3a475a7
    History
    Cleanup: CacheFile, use double precision for time
    Kévin Dietrich authored
    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