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:
authorAntonioya <blendergit@gmail.com>2019-02-01 19:14:28 +0300
committerAntonioya <blendergit@gmail.com>2019-02-01 19:14:28 +0300
commitb8e409ba98a996553afcdcb6272f6d68241c47cb (patch)
tree1d1c07a0ba4548349c6bc7ddbb7bcc566ab730f6
parentfdc12395c353dbb84cedebce3f0471798f20554a (diff)
GP: Cleanup retiming to do in same loop
-rw-r--r--source/blender/editors/gpencil/gpencil_edit.c20
1 files changed, 6 insertions, 14 deletions
diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index e68c636e2ce..81ba907b2f6 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -1828,6 +1828,8 @@ static void gp_stroke_join_islands(bGPDframe *gpf, bGPDstroke *gps_first, bGPDst
/* copy points (last before) */
int e1 = 0;
int e2 = 0;
+ float delta = 0.0f;
+
for (int i = 0; i < totpoints; i++) {
pt_final = &join_stroke->points[i];
if (i < gps_last->totpoints) {
@@ -1843,8 +1845,11 @@ static void gp_stroke_join_islands(bGPDframe *gpf, bGPDstroke *gps_first, bGPDst
copy_v3_v3(&pt_final->x, &pt->x);
pt_final->pressure = pt->pressure;
pt_final->strength = pt->strength;
- pt_final->time = pt->time;
+ pt_final->time = delta;
pt_final->flag = pt->flag;
+
+ /* retiming with fixed time interval (we cannot determine real time) */
+ delta += 0.01f;
}
/* Copy over vertex weight data (if available) */
@@ -1878,19 +1883,6 @@ static void gp_stroke_join_islands(bGPDframe *gpf, bGPDstroke *gps_first, bGPDst
}
}
- /* retiming with fixed time interval */
- {
- float delta = 0.0f;
- int j;
-
- join_stroke->inittime = (double)delta;
- pt = join_stroke->points;
- for (j = 0; j < join_stroke->totpoints; j++, pt++) {
- pt->time = delta;
- delta += 0.01f;
- }
- }
-
/* add new stroke at head */
BLI_addhead(&gpf->strokes, join_stroke);