[Bf-blender-cvs] [3a5f46bd7f7] greasepencil-object: Fix error in UV rotation when subdivide

Antonio Vazquez noreply at git.blender.org
Tue Feb 20 17:02:20 CET 2018


Commit: 3a5f46bd7f7906c2ff9a7795d8ba22e54ab11a02
Author: Antonio Vazquez
Date:   Tue Feb 20 10:15:58 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB3a5f46bd7f7906c2ff9a7795d8ba22e54ab11a02

Fix error in UV rotation when subdivide

===================================================================

M	source/blender/editors/gpencil/gpencil_paint.c
M	source/blender/editors/gpencil/gpencil_utils.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_paint.c b/source/blender/editors/gpencil/gpencil_paint.c
index 1af8d9e2b17..3ae1600b582 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -586,7 +586,6 @@ static short gp_stroke_addpoint(
 		}
 		CLAMP(pt->uv_rot, -M_PI_2, M_PI_2);
 
-
 		/* apply angle of stroke to brush size */
 		if (brush->draw_angle_factor > 0.0f) {
 			gp_brush_angle(gpd, brush, pt, mval);
@@ -988,7 +987,6 @@ static void gp_stroke_newfrombuffer(tGPsdata *p)
 			}
 		}
 
-
 		pt = gps->points;
 
 		/* convert all points (normal behavior) */
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 58161303d1e..0f358d6bff7 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -917,6 +917,8 @@ void gp_subdivide_stroke(bGPDstroke *gps, const int sublevel)
 			pt_final->flag = pt->flag;
 			pt_final->totweight = pt->totweight;
 			pt_final->weights = pt->weights;
+			pt_final->uv_fac = pt->uv_fac;
+			pt_final->uv_rot = pt->uv_rot;
 			i2 -= 2;
 		}
 		/* interpolate mid points */
@@ -934,6 +936,9 @@ void gp_subdivide_stroke(bGPDstroke *gps, const int sublevel)
 			pt_final->time = interpf(pt->time, next->time, 0.5f);
 			pt_final->totweight = 0;
 			pt_final->weights = NULL;
+			pt_final->uv_fac = interpf(pt->uv_fac, next->uv_fac, 0.5f);
+			pt_final->uv_rot = interpf(pt->uv_rot, next->uv_rot, 0.5f);
+
 			i2 += 2;
 		}



More information about the Bf-blender-cvs mailing list