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-11-03 19:11:38 +0300
committerAntonioya <blendergit@gmail.com>2018-11-03 19:11:38 +0300
commitd2b4eaa13711b346df98e432bfd806be91dbac05 (patch)
treebb23b7c6006e41b06a9c7dedc80244090104891c /source/blender/gpencil_modifiers
parentec017861b6fe9ce15b5eec88536aa457a5c99984 (diff)
GP: New Time Offset custom frame range parameters
These parameters allow to define a frame range for the animation loop and make possible to loop a section while the scene is playing.
Diffstat (limited to 'source/blender/gpencil_modifiers')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
index 0e66f639ce3..29f06a4017f 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
@@ -57,6 +57,8 @@ static void initData(GpencilModifierData *md)
gpmd->offset = 1;
gpmd->frame_scale = 1.0f;
gpmd->flag |= GP_TIME_KEEP_LOOP;
+ gpmd->sfra = 1;
+ gpmd->efra = 250;
}
static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
@@ -69,8 +71,9 @@ static int remapTime(
struct Scene *scene, struct Object *UNUSED(ob), struct bGPDlayer *gpl, int cfra)
{
TimeGpencilModifierData *mmd = (TimeGpencilModifierData *)md;
- const int sfra = scene->r.sfra;
- const int efra = scene->r.efra;
+ const bool custom = mmd->flag & GP_TIME_CUSTOM_RANGE;
+ const int sfra = custom ? mmd->sfra : scene->r.sfra;
+ const int efra = custom ? mmd->efra : scene->r.efra;
const bool invgpl = mmd->flag & GP_TIME_INVERT_LAYER;
const bool invpass = mmd->flag & GP_TIME_INVERT_LAYERPASS;