Alembic import: fixed off-by-one error in start/end frame
authorSybren A. Stüvel <sybren@stuvel.eu>
Thu, 13 Apr 2017 12:50:02 +0000 (14:50 +0200)
committerSybren A. Stüvel <sybren@stuvel.eu>
Thu, 13 Apr 2017 12:50:02 +0000 (14:50 +0200)
static_cast<int> truncates, so a computed end frame of 99.999999999998
would result in 99, instead of the correct 100.

source/blender/alembic/intern/alembic_capi.cc

index 9529b370928097453677903d50a98b9e736b3ef7..0de0d1a1ab68b0e0ca28c6b7d5bede9255d832eb 100644 (file)
@@ -717,8 +717,8 @@ static void import_startjob(void *user_data, short *stop, short *do_update, floa
                        CFRA = SFRA;
                }
                else if (min_time < max_time) {
-                       SFRA = static_cast<int>(min_time * FPS);
-                       EFRA = static_cast<int>(max_time * FPS);
+                       SFRA = static_cast<int>(round(min_time * FPS));
+                       EFRA = static_cast<int>(round(max_time * FPS));
                        CFRA = SFRA;
                }
        }