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:
authorAntonio Vazquez <blendergit@gmail.com>2020-05-11 13:57:22 +0300
committerAntonio Vazquez <blendergit@gmail.com>2020-05-11 13:57:22 +0300
commita1593fa05baf72653b3f086e795b47c79b2af7fd (patch)
tree2996fc722feae8b26e1938235cf6cd6d189a0f30 /source/blender/gpencil_modifiers/intern
parente82d8c60f03a5e41aa48d99d5012f56c68968b32 (diff)
GPencil: New Percentage parameter in Build modifier
Add a factor to determine the percentage affected. This parameter is used to hide part of the stroke and to have a full control of how the points are displayed and not linked to current scene frame. {F8526502} {F8526511} Reviewed By: mendio, pepeland Differential Revision: https://developer.blender.org/D7682
Diffstat (limited to 'source/blender/gpencil_modifiers/intern')
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
index c31f73df25d..71a051629d8 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilbuild.c
@@ -406,6 +406,7 @@ static void generate_geometry(GpencilModifierData *md,
{
BuildGpencilModifierData *mmd = (BuildGpencilModifierData *)md;
const bool reverse = (mmd->transition != GP_BUILD_TRANSITION_GROW);
+ const bool is_percentage = (mmd->flag & GP_BUILD_PERCENTAGE);
const float ctime = DEG_get_ctime(depsgraph);
@@ -500,7 +501,8 @@ static void generate_geometry(GpencilModifierData *md,
}
/* Determine how far along we are between the keyframes */
- float fac = (ctime - start_frame) / (end_frame - start_frame);
+ float fac = is_percentage ? mmd->percentage_fac :
+ (ctime - start_frame) / (end_frame - start_frame);
/* Time management mode */
switch (mmd->mode) {