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:
authorSybren A. Stüvel <sybren@stuvel.eu>2017-10-29 19:23:50 +0300
committerSybren A. Stüvel <sybren@stuvel.eu>2017-10-29 19:23:50 +0300
commit6099b2620d645f4129c42af2272cb6bd8538fc7a (patch)
tree942f71846fb8aa796c0a3d12faa27de167dcc344 /source/blender/blenkernel/intern/cachefile.c
parentbbc7eb8ae5386aae5aaa58df76f701bc7f0dddbf (diff)
Alembic: added frame offset property
The offset is subtracted, so that it's intuitive (dragging slider pushes the animation further that way on the timeline).
Diffstat (limited to 'source/blender/blenkernel/intern/cachefile.c')
-rw-r--r--source/blender/blenkernel/intern/cachefile.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c
index 1916531b066..e821a14da2e 100644
--- a/source/blender/blenkernel/intern/cachefile.c
+++ b/source/blender/blenkernel/intern/cachefile.c
@@ -211,8 +211,9 @@ bool BKE_cachefile_filepath_get(
float BKE_cachefile_time_offset(CacheFile *cache_file, const float time, const float fps)
{
+ const float time_offset = cache_file->frame_offset / fps;
const float frame = (cache_file->override_frame ? cache_file->frame : time);
- return cache_file->is_sequence ? frame : frame / fps;
+ return cache_file->is_sequence ? frame : frame / fps - time_offset;
}
/* TODO(kevin): replace this with some depsgraph mechanism, or something similar. */