[Bf-blender-cvs] [8b05d38305c] blender2.8: GP: Cleanup names and code

Antonioya noreply at git.blender.org
Fri Oct 5 08:59:43 CEST 2018


Commit: 8b05d38305c4af49848b41e307ceb3ed424f5fbc
Author: Antonioya
Date:   Fri Oct 5 08:59:16 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB8b05d38305c4af49848b41e307ceb3ed424f5fbc

GP: Cleanup names and code

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

M	source/blender/blenkernel/intern/gpencil.c
M	source/blender/blenloader/intern/versioning_280.c
M	source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M	source/blender/makesdna/DNA_gpencil_types.h
M	source/blender/makesrna/intern/rna_gpencil.c

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

diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index 1f27c146399..ae78dd8d175 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -471,7 +471,7 @@ bGPdata *BKE_gpencil_data_addnew(Main *bmain, const char name[])
 	ARRAY_SET_ITEMS(gpd->grid.color, 0.5f, 0.5f, 0.5f); // Color
 	ARRAY_SET_ITEMS(gpd->grid.scale, 1.0f, 1.0f); // Scale
 	gpd->grid.lines = GP_DEFAULT_GRID_LINES; // Number of lines
-	gpd->grid.axis = V3D_GP_GRID_AXIS_Y;
+	gpd->grid.axis = GP_GRID_AXIS_Y;
 
 	/* onion-skinning settings (datablock level) */
 	gpd->onion_flag |= (GP_ONION_GHOST_PREVCOL | GP_ONION_GHOST_NEXTCOL);
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c
index 466513d91bb..ab52a9b8b8f 100644
--- a/source/blender/blenloader/intern/versioning_280.c
+++ b/source/blender/blenloader/intern/versioning_280.c
@@ -2160,7 +2160,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
 			ARRAY_SET_ITEMS(gpd->grid.color, 0.5f, 0.5f, 0.5f); // Color
 			ARRAY_SET_ITEMS(gpd->grid.scale, 1.0f, 1.0f); // Scale
 			gpd->grid.lines = GP_DEFAULT_GRID_LINES; // Number of lines
-			gpd->grid.axis = V3D_GP_GRID_AXIS_Y;
+			gpd->grid.axis = GP_GRID_AXIS_Y;
 		}
 
 
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
index 9e0e8c919e2..40245810f42 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -621,12 +621,12 @@ static void set_grid_point(
 
 	float pos[3];
 	/* Set the grid in the selected axis (default is always Y axis) */
-	if (axis & V3D_GP_GRID_AXIS_X) {
+	if (axis & GP_GRID_AXIS_X) {
 		pos[0] = 0.0f;
 		pos[1] = v1;
 		pos[2] = v2;
 	}
-	else if (axis & V3D_GP_GRID_AXIS_Z) {
+	else if (axis & GP_GRID_AXIS_Z) {
 		pos[0] = v1;
 		pos[1] = v2;
 		pos[2] = 0.0f;
@@ -672,7 +672,7 @@ GPUBatch *DRW_gpencil_get_grid(Object *ob)
 
 	/* if use locked axis, copy value */
 	int axis = gpd->grid.axis;
-	if ((gpd->grid.axis & V3D_GP_GRID_AXIS_LOCK) == 0) {
+	if ((gpd->grid.axis & GP_GRID_AXIS_LOCK) == 0) {
 
 		axis = gpd->grid.axis;
 	}
@@ -680,18 +680,18 @@ GPUBatch *DRW_gpencil_get_grid(Object *ob)
 		switch (ts->gp_sculpt.lock_axis) {
 			case GP_LOCKAXIS_X:
 			{
-				axis = V3D_GP_GRID_AXIS_X;
+				axis = GP_GRID_AXIS_X;
 				break;
 			}
 			case GP_LOCKAXIS_NONE:
 			case GP_LOCKAXIS_Y:
 			{
-				axis = V3D_GP_GRID_AXIS_Y;
+				axis = GP_GRID_AXIS_Y;
 				break;
 			}
 			case GP_LOCKAXIS_Z:
 			{
-				axis = V3D_GP_GRID_AXIS_Z;
+				axis = GP_GRID_AXIS_Z;
 				break;
 			}
 		}
diff --git a/source/blender/makesdna/DNA_gpencil_types.h b/source/blender/makesdna/DNA_gpencil_types.h
index d991bb34a0a..b9df4137862 100644
--- a/source/blender/makesdna/DNA_gpencil_types.h
+++ b/source/blender/makesdna/DNA_gpencil_types.h
@@ -374,8 +374,8 @@ typedef struct bGPdata {
 	int   totstroke;
 	int   totpoint;
 	char pad_3[4];
-	bGPdata_runtime runtime;
 	bGPgrid grid;
+	bGPdata_runtime runtime;
 } bGPdata;
 
 /* bGPdata->flag */
@@ -473,10 +473,10 @@ typedef enum eGP_DepthOrdering {
 
 /* gpencil_grid_axis */
 enum {
-	V3D_GP_GRID_AXIS_LOCK = (1 << 0),
-	V3D_GP_GRID_AXIS_X = (1 << 1),
-	V3D_GP_GRID_AXIS_Y = (1 << 2),
-	V3D_GP_GRID_AXIS_Z = (1 << 3),
+	GP_GRID_AXIS_LOCK = (1 << 0),
+	GP_GRID_AXIS_X    = (1 << 1),
+	GP_GRID_AXIS_Y    = (1 << 2),
+	GP_GRID_AXIS_Z    = (1 << 3),
 };
 
 /* ***************************************** */
diff --git a/source/blender/makesrna/intern/rna_gpencil.c b/source/blender/makesrna/intern/rna_gpencil.c
index 02419237a9e..adef80f43c7 100644
--- a/source/blender/makesrna/intern/rna_gpencil.c
+++ b/source/blender/makesrna/intern/rna_gpencil.c
@@ -73,10 +73,10 @@ static EnumPropertyItem rna_enum_gpencil_onion_modes_items[] = {
 };
 
 static const EnumPropertyItem rna_enum_gpencil_grid_axis_items[] = {
-	{V3D_GP_GRID_AXIS_LOCK, "LOCK", 0, "Drawing Plane", "Use current drawing locked axis" },
-	{V3D_GP_GRID_AXIS_X, "X", 0, "Y-Z", ""},
-	{V3D_GP_GRID_AXIS_Y, "Y", 0, "X-Z", ""},
-	{V3D_GP_GRID_AXIS_Z, "Z", 0, "X-Y", ""},
+	{GP_GRID_AXIS_LOCK, "LOCK", 0, "Drawing Plane", "Use current drawing locked axis" },
+	{GP_GRID_AXIS_X, "X", 0, "Y-Z", ""},
+	{GP_GRID_AXIS_Y, "Y", 0, "X-Z", ""},
+	{GP_GRID_AXIS_Z, "Z", 0, "X-Y", ""},
 	{0, NULL, 0, NULL, NULL}
 };
 #endif



More information about the Bf-blender-cvs mailing list