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/makesrna/intern/rna_gpencil_modifier.c
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/makesrna/intern/rna_gpencil_modifier.c')
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 1906c663c54..e6cc14da667 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -1671,6 +1671,20 @@ static void rna_def_modifier_gpencilbuild(BlenderRNA *brna)
prop, "Restrict Frame Range", "Only modify strokes during the specified frame range");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+ /* Use percentage */
+ prop = RNA_def_property(srna, "use_percentage", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BUILD_PERCENTAGE);
+ RNA_def_property_ui_text(
+ prop, "Restrict Visible Points", "Use a percentage factor to determine the visible points");
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
+ /* Percentage factor. */
+ prop = RNA_def_property(srna, "percentage_factor", PROP_FLOAT, PROP_FACTOR);
+ RNA_def_property_float_sdna(prop, NULL, "percentage_fac");
+ RNA_def_property_ui_text(prop, "Factor", "Defines how much of the stroke is visible");
+ RNA_def_property_range(prop, 0.0f, 1.0f);
+ RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
+
prop = RNA_def_property(srna, "frame_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "start_frame");
RNA_def_property_ui_text(