[Bf-blender-cvs] [1e611c1ce0a] greasepencil-object: Remove Draw at Stroke Location

Antonio Vazquez noreply at git.blender.org
Tue Jun 12 17:11:15 CEST 2018


Commit: 1e611c1ce0a928b4df03703bef7da14fabfa0dd5
Author: Antonio Vazquez
Date:   Tue Jun 12 17:11:08 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB1e611c1ce0a928b4df03703bef7da14fabfa0dd5

Remove Draw at Stroke Location

This option at layer level was only for very limited situations and added complexity not needed.

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

M	release/scripts/startup/bl_ui/properties_data_gpencil.py
M	source/blender/editors/gpencil/gpencil_utils.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/release/scripts/startup/bl_ui/properties_data_gpencil.py b/release/scripts/startup/bl_ui/properties_data_gpencil.py
index 743cadf2fdc..bebe348a470 100644
--- a/release/scripts/startup/bl_ui/properties_data_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_data_gpencil.py
@@ -102,8 +102,6 @@ class DATA_PT_gpencil_layer_optionpanel(LayerDataButtonsPanel, Panel):
         col = layout.row(align=True)
         col.prop(gpl, "line_change", text="Stroke Thickness")
 
-        layout.prop(gpl, "use_stroke_location", text="Draw On Stroke Location")
-
 
 class DATA_PT_gpencil_parentpanel(LayerDataButtonsPanel, Panel):
     bl_space_type = 'PROPERTIES'
diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c
index 51db1b0858c..eb2688e48d8 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -782,20 +782,6 @@ void ED_gp_get_drawing_reference(View3D *v3d, Scene *scene, Object *ob, bGPDlaye
 	/* if using a gpencil object at cursor mode, can use the location of the object */
 	if (align_flag & GP_PROJECT_VIEWSPACE) {
 		if (ob && (ob->type == OB_GPENCIL)) {
-			/* use last stroke position for layer */
-			if (gpl && gpl->flag & GP_LAYER_USE_LOCATION) {
-				if (gpl->actframe) {
-					bGPDframe *gpf = gpl->actframe;
-					if (gpf->strokes.last) {
-						bGPDstroke *gps = gpf->strokes.last;
-						if (gps->totpoints > 0) {
-							copy_v3_v3(r_vec, &gps->points[gps->totpoints - 1].x);
-							mul_m4_v3(ob->obmat, r_vec);
-							return;
-						}
-					}
-				}
-			}
 			/* fallback (no strokes) - use cursor or object location */
 			if (align_flag & GP_PROJECT_CURSOR) {
 				/* use 3D-cursor */
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index b3db2c8140f..76bf073ac2a 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -283,8 +283,6 @@ typedef enum eGPDlayer_Flag {
 	GP_LAYER_VOLUMETRIC		= (1 << 10),
 	/* Unlock color */
 	GP_LAYER_UNLOCK_COLOR 	= (1 << 12),
-	/* draw new strokes using last stroke location (only in 3d view) */
-	GP_LAYER_USE_LOCATION = (1 << 14),
 } eGPDlayer_Flag;
 
 /* bGPDlayer->onion_flag */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index fec25c79b62..3188ee302a9 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -1008,12 +1008,6 @@ static void rna_def_gpencil_layer(BlenderRNA *brna)
 	RNA_def_property_ui_text(prop, "Onion Skinning", "Ghost frames on either side of frame");
 	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
 
-	prop = RNA_def_property(srna, "use_stroke_location", PROP_BOOLEAN, PROP_NONE);
-	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_USE_LOCATION);
-	RNA_def_property_ui_text(prop, "Use Stroke Location",
-		"When draw new strokes in 3D view, use last stroke origin, as new stroke origin");
-	RNA_def_property_update(prop, NC_GPENCIL | ND_DATA, "rna_GPencil_update");
-
 	/* Flags */
 	prop = RNA_def_property(srna, "hide", PROP_BOOLEAN, PROP_NONE);
 	RNA_def_property_boolean_sdna(prop, NULL, "flag", GP_LAYER_HIDE);



More information about the Bf-blender-cvs mailing list