[Bf-blender-cvs] [47e83e0b8ec] temp-lineart-contained: LineArt: UI range optimizations.
YimingWu
noreply at git.blender.org
Wed Aug 4 10:51:04 CEST 2021
Commit: 47e83e0b8ec9f035b8cd22af61d9bb0f855ae605
Author: YimingWu
Date: Tue Aug 3 20:27:42 2021 +0800
Branches: temp-lineart-contained
https://developer.blender.org/rB47e83e0b8ec9f035b8cd22af61d9bb0f855ae605
LineArt: UI range optimizations.
===================================================================
M source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
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 414ff7b8cae..148b0eeda20 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencillineart.c
@@ -433,7 +433,7 @@ static void style_panel_draw(const bContext *UNUSED(C), Panel *panel)
uiLayoutSetPropSep(layout, true);
uiLayoutSetEnabled(layout, !is_baked);
- uiItemR(layout, ptr, "thickness", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
+ uiItemR(layout, ptr, "thickness", 0, NULL, ICON_NONE);
uiItemR(layout, ptr, "opacity", UI_ITEM_R_SLIDER, NULL, ICON_NONE);
}
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 63f29ec8da6..a880420f6d1 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -2968,7 +2968,7 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
RNA_def_property_float_sdna(prop, NULL, "chain_smooth_tolerance");
RNA_def_property_ui_text(
prop, "Smooth Tolerance", "Strength of smoothing applied on jagged chains");
- RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.05f, 4);
+ RNA_def_property_ui_range(prop, 0.0f, 0.1f, 0.05f, 4);
RNA_def_property_range(prop, 0.0f, 30.0f);
RNA_def_property_update(prop, NC_SCENE, "rna_GpencilModifier_update");
@@ -3021,8 +3021,10 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
prop,
"Image Threshold",
"Segments with an image distance smaller than this will be chained together");
- RNA_def_property_ui_range(prop, 0.0f, 0.3f, 0.001f, 4);
- RNA_def_property_range(prop, 0.0f, 0.3f);
+ RNA_def_property_ui_range(prop, 0.0f, 0.1f, 0.001f, 4);
+ /* A threshold of 1.0 means half of the image frame width already, it does not make any sense to
+ * go anything beyond that. */
+ RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_update(prop, NC_SCENE, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "use_loose_edge_chain", PROP_BOOLEAN, PROP_NONE);
@@ -3195,7 +3197,7 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
"Certain settings will be unavailable");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
- prop = RNA_def_property(srna, "overscan", PROP_FLOAT, PROP_NONE);
+ prop = RNA_def_property(srna, "overscan", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_ui_text(
prop,
"Overscan",
@@ -3207,7 +3209,8 @@ static void rna_def_modifier_gpencillineart(BlenderRNA *brna)
prop = RNA_def_property(srna, "thickness", PROP_INT, PROP_NONE);
RNA_def_property_ui_text(prop, "Thickness", "The thickness for the generated strokes");
RNA_def_property_ui_range(prop, 1, 100, 1, 1);
- RNA_def_property_range(prop, 1, 200);
+ /* GPencil internal limit, use hard coded value for now until we have a marco. */
+ RNA_def_property_range(prop, 1, 5000);
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "opacity", PROP_FLOAT, PROP_FACTOR);
More information about the Bf-blender-cvs
mailing list