[Bf-blender-cvs] [b8e409ba98a] master: GP: Cleanup retiming to do in same loop
Antonioya
noreply at git.blender.org
Fri Feb 1 17:14:46 CET 2019
Commit: b8e409ba98a996553afcdcb6272f6d68241c47cb
Author: Antonioya
Date: Fri Feb 1 17:14:28 2019 +0100
Branches: master
https://developer.blender.org/rBb8e409ba98a996553afcdcb6272f6d68241c47cb
GP: Cleanup retiming to do in same loop
===================================================================
M source/blender/editors/gpencil/gpencil_edit.c
===================================================================
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);
More information about the Bf-blender-cvs
mailing list