GP: Cleanup names and code
authorAntonioya <blendergit@gmail.com>
Fri, 5 Oct 2018 06:59:16 +0000 (08:59 +0200)
committerAntonioya <blendergit@gmail.com>
Fri, 5 Oct 2018 06:59:33 +0000 (08:59 +0200)
source/blender/blenkernel/intern/gpencil.c
source/blender/blenloader/intern/versioning_280.c
source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
source/blender/makesdna/DNA_gpencil_types.h
source/blender/makesrna/intern/rna_gpencil.c

index 1f27c146399eb512bccc5364b30fb58a91eca720..ae78dd8d175f5f8ce8217f179ad700cc47b1061c 100644 (file)
@@ -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);
index 466513d91bb0381622c6cc0fa9c413744d1d52bc..ab52a9b8b8fb39080f552d607ccf75b99673818b 100644 (file)
@@ -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;
                }
 
 
index 9e0e8c919e291af0f7c5bfb715954b2ea9cc5ed9..40245810f42028d765446b23956f30ec582fb3b1 100644 (file)
@@ -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;
                        }
                }
index d991bb34a0a6e7f334e945548e0a149f27691ef2..b9df41378623135b267c16a531640c9753f65326 100644 (file)
@@ -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),
 };
 
 /* ***************************************** */
index 02419237a9e7a5011d46a860296a2bbe060b83cc..adef80f43c77003a4b786130d3be02c0f1917091 100644 (file)
@@ -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