[Bf-blender-cvs] [48355d7430d] greasepencil-object: GP: Trim Strokes: UI Changes

Charlie Jolly noreply at git.blender.org
Mon Feb 11 14:54:19 CET 2019


Commit: 48355d7430d8d58fdce07352db8c458ac43a9888
Author: Charlie Jolly
Date:   Mon Feb 11 13:54:01 2019 +0000
Branches: greasepencil-object
https://developer.blender.org/rB48355d7430d8d58fdce07352db8c458ac43a9888

GP: Trim Strokes: UI Changes

+ Fix inner loop

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

M	release/scripts/startup/bl_ui/space_view3d_toolbar.py
M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/makesrna/intern/rna_brush.c

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

diff --git a/release/scripts/startup/bl_ui/space_view3d_toolbar.py b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
index 1c83a86f6b1..884036d7e96 100644
--- a/release/scripts/startup/bl_ui/space_view3d_toolbar.py
+++ b/release/scripts/startup/bl_ui/space_view3d_toolbar.py
@@ -1587,9 +1587,6 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
         gp_settings = brush.gpencil_settings
         layout.active = gp_settings.use_settings_postprocess
 
-        col = layout.column(align=True)
-        col.prop(gp_settings, "trim")
-        
         col = layout.column(align=True)
         col.prop(gp_settings, "pen_smooth_factor")
         col.prop(gp_settings, "pen_smooth_steps")
@@ -1602,6 +1599,9 @@ class VIEW3D_PT_tools_grease_pencil_brush_settings(View3DPanel, Panel):
         col.prop(gp_settings, "pen_subdivision_steps")
         col.prop(gp_settings, "random_subdiv", text="Randomness", slider=True)
 
+        col = layout.column(align=True)
+        col.prop(gp_settings, "trim")
+
 
 class VIEW3D_PT_tools_grease_pencil_brush_random(View3DPanel, Panel):
     bl_context = ".greasepencil_paint"
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 73ca5d0212e..8fa45ade8fd 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -1716,7 +1716,7 @@ bool BKE_gpencil_trim_stroke(bGPDstroke *gps)
 		start = i;
 		bGPDspoint *a = &gps->points[start];
 		bGPDspoint *b = &gps->points[start + 1];
-		for (int j = start + 2; j < gps->totpoints; j++) {
+		for (int j = start + 2; j < gps->totpoints - 1; j++) {
 			end = j + 1;
 			bGPDspoint *c = &gps->points[j];
 			bGPDspoint *d = &gps->points[end];
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 34e011e4b53..fb504b2b8fc 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -1275,7 +1275,7 @@ static void rna_def_gpencil_options(BlenderRNA *brna)
 	prop = RNA_def_property(srna, "trim", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_BRUSH_TRIM_STROKE);
 	RNA_def_property_boolean_default(prop, false);
-	RNA_def_property_ui_text(prop, "Trim", "Trim stroke ends");
+	RNA_def_property_ui_text(prop, "Trim Strokes", "Trim intersecting stroke ends");
 	RNA_def_parameter_clear_flags(prop, PROP_ANIMATABLE, 0);
 
 	/* Material */



More information about the Bf-blender-cvs mailing list