Cleanup, LineArt: Sample -> Resample

Clear up what sample length does by renaming the option and variables.
This commit is contained in:
YimingWu 2021-03-18 19:29:17 +08:00 committed by Sebastian Parborg
parent 3f0cd3fcc1
commit 6f7e632a6f
Notes: blender-bot 2023-02-14 04:39:18 +01:00
Referenced by issue #86702, Applying Line Art modifier does not work with Object Line Art primitive.
6 changed files with 15 additions and 13 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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;

View File

@ -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");