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:
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
index 01bb0ae2b93..e3ad5a64ac3 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c
@@ -71,8 +71,14 @@ static int remapTime(struct GpencilModifierData *md,
const bool invpass = mmd->flag & GP_TIME_INVERT_LAYERPASS;
int sfra = custom ? mmd->sfra : scene->r.sfra;
int efra = custom ? mmd->efra : scene->r.efra;
- CLAMP_MIN(sfra, 1);
- CLAMP_MIN(efra, 1);
+ CLAMP_MIN(sfra, 0);
+ CLAMP_MIN(efra, 0);
+
+ /* Avoid inverse ranges. */
+ if (efra < sfra) {
+ return cfra;
+ }
+
const int time_range = efra - sfra + 1;
int offset = mmd->offset;
int segments = 0;