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:
authorAntonioya <blendergit@gmail.com>2018-10-23 17:44:31 +0300
committerAntonioya <blendergit@gmail.com>2018-10-23 17:47:09 +0300
commit3e9405e26dfb02f1aa05c530cce3ca6f9d1c84c7 (patch)
tree7834aa8576e998d4eeeac93d9ef235e90a7f86d4 /source/blender/gpencil_modifiers
parentca003d0f5cfc1f2cd511f33e045eac122c8aa4da (diff)
GP: Add new frame scale parameter to Time modifier
This new parameter allows to increase or decrease the animation speed to break animation patterns when reuse data blocks.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
index 521a398ee29..c72a20cc0e9 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
@@ -55,6 +55,7 @@ static void initData(GpencilModifierData *md)
TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)md;
gpmd->layername[0] = '\0';
gpmd->offset = 1;
+ gpmd->frame_scale = 1.0f;
gpmd->flag |= GP_TIME_KEEP_LOOP;
}
@@ -88,6 +89,12 @@ static int remapTime(
}
}
+ /* apply frame scale */
+ cfra *= mmd->frame_scale;
+ if (cfra > efra) {
+ cfra = sfra + (cfra - ((cfra / efra) * efra));
+ }
+
if (mmd->flag & GP_TIME_KEEP_LOOP) {
/* if the sum of the cfra is out scene frame range, recalc */
if (cfra + mmd->offset < sfra) {