[Bf-blender-cvs] [46cdecbd0f5] greasepencil-object: GP: Reduce default edges for Box and Lines

Antonioya noreply at git.blender.org
Wed Dec 12 10:31:07 CET 2018


Commit: 46cdecbd0f5d206b7329f7a45803c219a3b99726
Author: Antonioya
Date:   Wed Dec 12 10:26:59 2018 +0100
Branches: greasepencil-object
https://developer.blender.org/rB46cdecbd0f5d206b7329f7a45803c219a3b99726

GP: Reduce default edges for Box and Lines

Also avoid saving of edge number to reset for each new shape.

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

M	source/blender/editors/gpencil/gpencil_primitive.c

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

diff --git a/source/blender/editors/gpencil/gpencil_primitive.c b/source/blender/editors/gpencil/gpencil_primitive.c
index 5a77b176134..ffca53acb16 100644
--- a/source/blender/editors/gpencil/gpencil_primitive.c
+++ b/source/blender/editors/gpencil/gpencil_primitive.c
@@ -1,4 +1,4 @@
-/*
+/*
  * ***** BEGIN GPL LICENSE BLOCK *****
  *
  * This program is free software; you can redistribute it and/or
@@ -894,8 +894,10 @@ static void gpencil_primitive_init(bContext *C, wmOperator *op)
 
 	/* set default edge count */
 	
-	if (tgpi->type == GP_STROKE_BOX)
-		RNA_int_set(op->ptr, "edges", 32);
+	if (tgpi->type == GP_STROKE_LINE)
+		RNA_int_set(op->ptr, "edges", 8);
+	else if (tgpi->type == GP_STROKE_BOX)
+		RNA_int_set(op->ptr, "edges", 8);
 	else if (tgpi->type == GP_STROKE_CIRCLE)
 		RNA_int_set(op->ptr, "edges", 96);
 	else
@@ -1401,7 +1403,9 @@ void GPENCIL_OT_primitive(wmOperatorType *ot)
 	/* properties */
 	PropertyRNA *prop;
 
-	RNA_def_int(ot->srna, "edges", 4, MIN_EDGES, MAX_EDGES, "Edges", "Number of polygon edges", MIN_EDGES, MAX_EDGES);
+	prop = RNA_def_int(ot->srna, "edges", 4, MIN_EDGES, MAX_EDGES, "Edges", "Number of polygon edges", MIN_EDGES, MAX_EDGES);
+	RNA_def_property_flag(prop, PROP_SKIP_SAVE);
+
 	RNA_def_enum(ot->srna, "type", primitive_type, GP_STROKE_BOX, "Type", "Type of shape");
 
 	prop = RNA_def_boolean(ot->srna, "wait_for_input", true, "Wait for Input", "");



More information about the Bf-blender-cvs mailing list