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>2021-09-24 17:08:46 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-09-24 17:16:40 +0300
commitede14b3856c5b8938e57d3db217d68a9399385f2 (patch)
tree701d0e545359c8c57f38a92d1c319d9853a64757
parent95ec6e4dd373f58eebf3119e470ead4156c724b4 (diff)
GPencil: Invert weight in Weight Proximity modifier
In meshes modifer the Lowest is 0 and Highest is 1.0 and this was working inverted for grease pencil. Now, it works equals to meshes modifier. Also changed the tooltip to keep consistency with meshes modifier.
-rw-r--r--source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c6
-rw-r--r--source/blender/makesrna/intern/rna_gpencil_modifier.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c
index 0885828a3a0..4079485de8d 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilweight_proximity.c
@@ -83,13 +83,13 @@ static float calc_point_weight_by_distance(Object *ob,
float dist = len_v3v3(mmd->object->obmat[3], gvert);
if (dist > dist_max) {
- weight = 0.0f;
+ weight = 1.0f;
}
else if (dist <= dist_max && dist > dist_min) {
- weight = (dist_max - dist) / max_ff((dist_max - dist_min), 0.0001f);
+ weight = 1.0f - ((dist_max - dist) / max_ff((dist_max - dist_min), 0.0001f));
}
else {
- weight = 1.0f;
+ weight = 0.0f;
}
return weight;
diff --git a/source/blender/makesrna/intern/rna_gpencil_modifier.c b/source/blender/makesrna/intern/rna_gpencil_modifier.c
index 6480d16ccd2..ae6c7dcd76f 100644
--- a/source/blender/makesrna/intern/rna_gpencil_modifier.c
+++ b/source/blender/makesrna/intern/rna_gpencil_modifier.c
@@ -2867,7 +2867,7 @@ static void rna_def_modifier_gpencilweight_proximity(BlenderRNA *brna)
prop = RNA_def_property(srna, "distance_start", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist_start");
RNA_def_property_ui_range(prop, 0, 1000.0, 1.0, 2);
- RNA_def_property_ui_text(prop, "Lowest", "Start value for distance calculation");
+ RNA_def_property_ui_text(prop, "Lowest", "Distance mapping to 0.0 weight");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "minimum_weight", PROP_FLOAT, PROP_FACTOR);
@@ -2878,7 +2878,7 @@ static void rna_def_modifier_gpencilweight_proximity(BlenderRNA *brna)
prop = RNA_def_property(srna, "distance_end", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "dist_end");
RNA_def_property_ui_range(prop, 0, 1000.0, 1.0, 2);
- RNA_def_property_ui_text(prop, "Highest", "Max value for distance calculation");
+ RNA_def_property_ui_text(prop, "Highest", "Distance mapping to 1.0 weight");
RNA_def_property_update(prop, 0, "rna_GpencilModifier_update");
prop = RNA_def_property(srna, "pass_index", PROP_INT, PROP_NONE);