[Bf-blender-cvs] [6f7e632a6ff] master: Cleanup, LineArt: Sample -> Resample

YimingWu noreply at git.blender.org
Thu Mar 18 13:22:22 CET 2021


Commit: 6f7e632a6ff432c2b248588ae12263957ea43239
Author: YimingWu
Date:   Thu Mar 18 19:29:17 2021 +0800
Branches: master
https://developer.blender.org/rB6f7e632a6ff432c2b248588ae12263957ea43239

Cleanup, LineArt: Sample -> Resample

Clear up what sample length does by renaming the option and variables.

===================================================================

M	source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
M	source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
M	source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
M	source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
M	source/blender/makesdna/DNA_gpencil_modifier_types.h
M	source/blender/makesrna/intern/rna_gpencil_modifier.c

===================================================================

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
index d21fc8b8fdd..b66e970b107 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -107,7 +107,7 @@ static void generate_strokes_actual(
       lmd->transparency_mask,
       lmd->thickness,
       lmd->opacity,
-      lmd->pre_sample_length,
+      lmd->resample_length,
       lmd->source_vertex_group,
       lmd->vgname,
       lmd->flags);
@@ -391,7 +391,7 @@ static void chaining_panel_draw(const bContext *UNUSED(C), Panel *panel)
   uiItemR(col, ptr, "chaining_geometry_threshold", 0, NULL, ICON_NONE);
   uiItemR(col, ptr, "chaining_image_threshold", 0, NULL, ICON_NONE);
 
-  uiItemR(layout, ptr, "pre_sample_length", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+  uiItemR(layout, ptr, "resample_length", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 
   uiItemR(layout, ptr, "angle_splitting_threshold", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
 }
diff --git a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
index 97f4459072f..c01b1a4c86b 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
+++ b/source/blender/gpencil_modifiers/intern/lineart/MOD_lineart.h
@@ -549,7 +549,7 @@ void MOD_lineart_gpencil_generate(LineartRenderBuffer *rb,
                                   unsigned char transparency_mask,
                                   short thickness,
                                   float opacity,
-                                  float pre_sample_length,
+                                  float resample_length,
                                   const char *source_vgname,
                                   const char *vgname,
                                   int modifier_flags);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
index 41b269c836d..77de09a5526 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_cpu.c
@@ -3742,7 +3742,7 @@ static void lineart_gpencil_generate(LineartRenderBuffer *rb,
                                      unsigned char transparency_mask,
                                      short thickness,
                                      float opacity,
-                                     float pre_sample_length,
+                                     float resample_length,
                                      const char *source_vgname,
                                      const char *vgname,
                                      int modifier_flags)
@@ -3882,8 +3882,8 @@ static void lineart_gpencil_generate(LineartRenderBuffer *rb,
       }
     }
 
-    if (pre_sample_length > 0.0001) {
-      BKE_gpencil_stroke_sample(gpencil_object->data, gps, pre_sample_length, false);
+    if (resample_length > 0.0001) {
+      BKE_gpencil_stroke_sample(gpencil_object->data, gps, resample_length, false);
     }
     if (G.debug_value == 4000) {
       BKE_gpencil_stroke_set_random_color(gps);
@@ -3913,7 +3913,7 @@ void MOD_lineart_gpencil_generate(LineartRenderBuffer *rb,
                                   unsigned char transparency_mask,
                                   short thickness,
                                   float opacity,
-                                  float pre_sample_length,
+                                  float resample_length,
                                   const char *source_vgname,
                                   const char *vgname,
                                   int modifier_flags)
@@ -3963,7 +3963,7 @@ void MOD_lineart_gpencil_generate(LineartRenderBuffer *rb,
                            transparency_mask,
                            thickness,
                            opacity,
-                           pre_sample_length,
+                           resample_length,
                            source_vgname,
                            vgname,
                            modifier_flags);
diff --git a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
index f49a074e58b..1745551d6af 100644
--- a/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
+++ b/source/blender/gpencil_modifiers/intern/lineart/lineart_ops.c
@@ -110,7 +110,7 @@ static bool bake_strokes(Object *ob, Depsgraph *dg, GpencilModifierData *md, int
       lmd->transparency_mask,
       lmd->thickness,
       lmd->opacity,
-      lmd->pre_sample_length,
+      lmd->resample_length,
       lmd->source_vertex_group,
       lmd->vgname,
       lmd->flags);
diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h
index 7dded1a6546..31f8c64d486 100644
--- a/source/blender/makesdna/DNA_gpencil_modifier_types.h
+++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h
@@ -867,7 +867,7 @@ typedef struct LineartGpencilModifierData {
   float chaining_geometry_threshold;
   float chaining_image_threshold;
 
-  float pre_sample_length;
+  float resample_length;
 
   /* Ported from SceneLineArt flags. */
   int calculation_flags;
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 4efc8c4cca3..f6b52f80128 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -2531,9 +2531,11 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
   RNA_def_property_range(prop, 0.0f, 1.0f);
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
 
-  prop = RNA_def_property(srna, "pre_sample_length", PROP_FLOAT, PROP_NONE);
-  RNA_def_property_ui_text(
-      prop, "Sample Length", "Resolution to sample the generated strokes with");
+  prop = RNA_def_property(srna, "resample_length", PROP_FLOAT, PROP_DISTANCE);
+  RNA_def_property_ui_text(prop,
+                           "Resample Length",
+                           "Resample the strokes so that the stroke points have the specified "
+                           "length between them. Zero length disables the resampling");
   RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01f, 2);
   RNA_def_property_range(prop, 0.0f, 1.0f);
   RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");



More information about the Bf-blender-cvs mailing list