GP: Cleanup names and code

This commit is contained in:
Antonio Vazquez 2018-10-05 08:59:16 +02:00
parent f36f029321
commit 8b05d38305
5 changed files with 17 additions and 17 deletions

View 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);

View 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;
}

View 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;
}
}

View 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),
};
/* ***************************************** */

View 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