[Bf-blender-cvs] [c4e5a7d59a0] blender-v3.2-release: Fix T98258: Duplicated last vertex after GPencil sample.
YimingWu
noreply at git.blender.org
Mon May 23 10:19:19 CEST 2022
Commit: c4e5a7d59a06e833d9e4de45d4eb3cf632a1e9e4
Author: YimingWu
Date: Mon May 23 16:15:15 2022 +0800
Branches: blender-v3.2-release
https://developer.blender.org/rBc4e5a7d59a06e833d9e4de45d4eb3cf632a1e9e4
Fix T98258: Duplicated last vertex after GPencil sample.
Also fixed an unreported issue of incorrect interpolation of thickness.
Reviewed By: Aleš Jelovčan (frogstomp), Antonio Vazquez (antoniov)
Differential Revision: https://developer.blender.org/D15005
===================================================================
M release/datafiles/locale
M release/scripts/addons
M source/blender/blenkernel/intern/gpencil_geom.cc
M source/tools
===================================================================
diff --git a/release/datafiles/locale b/release/datafiles/locale
index fb1eac2ec80..647c85462d8 160000
--- a/release/datafiles/locale
+++ b/release/datafiles/locale
@@ -1 +1 @@
-Subproject commit fb1eac2ec80c0adee69990a5386b74a5bd4ca00c
+Subproject commit 647c85462d87c3a9d3a189d28d72d1bd93f4d4a8
diff --git a/release/scripts/addons b/release/scripts/addons
index 7025cd28ede..d936e4c01fa 160000
--- a/release/scripts/addons
+++ b/release/scripts/addons
@@ -1 +1 @@
-Subproject commit 7025cd28ede25eb44208722f842e35b10325c6cc
+Subproject commit d936e4c01fa263a71a7d0665628ae621283b15ee
diff --git a/source/blender/blenkernel/intern/gpencil_geom.cc b/source/blender/blenkernel/intern/gpencil_geom.cc
index 041696fa8d3..dd22d64aee1 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.cc
+++ b/source/blender/blenkernel/intern/gpencil_geom.cc
@@ -236,6 +236,7 @@ static int stroke_march_next_point(const bGPDstroke *gps,
}
else {
next_point_index = gps->totpoints - 1;
+ remaining_till_next = 0;
break;
}
}
@@ -263,15 +264,18 @@ static int stroke_march_next_point(const bGPDstroke *gps,
float ratio = remaining_march / remaining_till_next;
interp_v3_v3v3(result, step_start, point, ratio);
*ratio_result = ratio;
+ float d1 = len_v3v3(result, &gps->points[*index_from].x);
+ float d2 = len_v3v3(result, &gps->points[next_point_index].x);
+ float vratio = d1 / (d1 + d2);
*pressure = interpf(
- gps->points[next_point_index].pressure, gps->points[*index_from].pressure, ratio);
+ gps->points[next_point_index].pressure, gps->points[*index_from].pressure, vratio);
*strength = interpf(
- gps->points[next_point_index].strength, gps->points[*index_from].strength, ratio);
+ gps->points[next_point_index].strength, gps->points[*index_from].strength, vratio);
interp_v4_v4v4(vert_color,
gps->points[*index_from].vert_color,
gps->points[next_point_index].vert_color,
- ratio);
+ vratio);
return next_point_index == 0 ? gps->totpoints : next_point_index;
}
@@ -320,6 +324,7 @@ static int stroke_march_next_point_no_interp(const bGPDstroke *gps,
}
else {
next_point_index = gps->totpoints - 1;
+ remaining_till_next = 0;
break;
}
}
diff --git a/source/tools b/source/tools
index 53b7c02a062..ccc8fceb6bd 160000
--- a/source/tools
+++ b/source/tools
@@ -1 +1 @@
-Subproject commit 53b7c02a062c3d6ec6b38ce670836321b4e78fab
+Subproject commit ccc8fceb6bd83ffbf6e5207247fb8f76fc47a5b6
More information about the Bf-blender-cvs
mailing list