From e1a66201da2595b8d5afd7072a1f3730ca34d04a Mon Sep 17 00:00:00 2001 From: Antonioya Date: Wed, 24 Oct 2018 11:02:52 +0200 Subject: GP: Add layer pass index to time modifier --- .../blender/gpencil_modifiers/intern/MOD_gpenciltime.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/blender/gpencil_modifiers') diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c index 0096c6c00d5..cb7e508e3db 100644 --- a/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c +++ b/source/blender/gpencil_modifiers/intern/MOD_gpenciltime.c @@ -71,7 +71,8 @@ static int remapTime( TimeGpencilModifierData *mmd = (TimeGpencilModifierData *)md; const int sfra = scene->r.sfra; const int efra = scene->r.efra; - const bool invgpl = mmd->flag & GP_SIMPLIFY_INVERT_LAYER; + const bool invgpl = mmd->flag & GP_TIME_INVERT_LAYER; + const bool invpass = mmd->flag & GP_TIME_INVERT_PASS; /* omit if filter by layer */ if (mmd->layername[0] != '\0') { @@ -86,6 +87,19 @@ static int remapTime( } } } + /* verify pass */ + if (mmd->pass_index > 0) { + if (invpass == false) { + if (gpl->pass_index != mmd->pass_index) { + return cfra; + } + } + else { + if (gpl->pass_index == mmd->pass_index) { + return cfra; + } + } + } /* if fix mode, return predefined frame number */ if (mmd->mode == GP_TIME_MODE_FIX) { -- cgit v1.2.3