Cleanup: rename gpencil chess -> checker

Match existing texture name.
This commit is contained in:
2019-07-07 13:43:42 +10:00
parent 7a6c50e79c
commit e68c8ba24e
6 changed files with 28 additions and 28 deletions

View File

@@ -189,25 +189,25 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, Panel):
if gpcolor.fill_style != 'TEXTURE':
col.prop(gpcolor, "fill_color", text="Color")
if gpcolor.fill_style in {'GRADIENT', 'CHESSBOARD'}:
if gpcolor.fill_style in {'GRADIENT', 'CHECKER'}:
col.prop(gpcolor, "mix_color", text="Secondary Color")
if gpcolor.fill_style == 'GRADIENT':
col.prop(gpcolor, "mix_factor", text="Mix Factor", slider=True)
if gpcolor.fill_style in {'GRADIENT', 'CHESSBOARD'}:
if gpcolor.fill_style in {'GRADIENT', 'CHECKER'}:
col.prop(gpcolor, "flip", text="Flip Colors")
col.prop(gpcolor, "pattern_shift", text="Location")
col.prop(gpcolor, "pattern_scale", text="Scale")
if gpcolor.gradient_type == 'RADIAL' and gpcolor.fill_style not in {'SOLID', 'CHESSBOARD'}:
if gpcolor.gradient_type == 'RADIAL' and gpcolor.fill_style not in {'SOLID', 'CHECKER'}:
col.prop(gpcolor, "pattern_radius", text="Radius")
else:
if gpcolor.fill_style != 'SOLID':
col.prop(gpcolor, "pattern_angle", text="Angle")
if gpcolor.fill_style == 'CHESSBOARD':
if gpcolor.fill_style == 'CHECKER':
col.prop(gpcolor, "pattern_gridsize", text="Box Size")
# Texture

View File

@@ -57,7 +57,7 @@
#define SOLID 0
#define GRADIENT 1
#define RADIAL 2
#define CHESS 3
#define CHECKER 3
#define TEXTURE 4
#define PATTERN 5
@@ -387,8 +387,8 @@ static DRWShadingGroup *gpencil_shgroup_fill_create(GPENCIL_Data *vedata,
stl->shgroups[id].fill_style = RADIAL;
}
break;
case GP_STYLE_FILL_STYLE_CHESSBOARD:
stl->shgroups[id].fill_style = CHESS;
case GP_STYLE_FILL_STYLE_CHECKER:
stl->shgroups[id].fill_style = CHECKER;
break;
case GP_STYLE_FILL_STYLE_TEXTURE:
if (gp_style->flag & GP_STYLE_FILL_PATTERN) {

View File

@@ -30,7 +30,7 @@ uniform vec4 wire_color;
#define SOLID 0
#define GRADIENT 1
#define RADIAL 2
#define CHESS 3
#define CHECKER 3
#define TEXTURE 4
#define PATTERN 5
@@ -103,7 +103,7 @@ void main()
texture_read_as_srgb(
myTexture, myTexturePremultiplied, clamp(rot_tex * texture_scale, 0.0, 1.0));
vec4 text_color = vec4(tmp_color[0], tmp_color[1], tmp_color[2], tmp_color[3] * texture_opacity);
vec4 chesscolor;
vec4 checker_color;
/* wireframe with x-ray discard */
if ((viewport_xray == 1) && (shading_type[0] == OB_WIRE)) {
@@ -152,18 +152,18 @@ void main()
texture_flip,
fragColor);
}
/* chessboard */
if (fill_type == CHESS) {
/* Checkerboard */
if (fill_type == CHECKER) {
vec2 pos = rot / pattern_gridsize;
if ((fract(pos.x) < 0.5 && fract(pos.y) < 0.5) ||
(fract(pos.x) > 0.5 && fract(pos.y) > 0.5)) {
chesscolor = (texture_flip == 0) ? finalColor : color2;
checker_color = (texture_flip == 0) ? finalColor : color2;
}
else {
chesscolor = (texture_flip == 0) ? color2 : finalColor;
checker_color = (texture_flip == 0) ? color2 : finalColor;
}
/* mix with texture */
fragColor = (texture_mix == 1) ? mix(chesscolor, text_color, mix_factor) : chesscolor;
fragColor = (texture_mix == 1) ? mix(checker_color, text_color, mix_factor) : checker_color;
fragColor.a *= layer_opacity;
}
/* texture */

View File

@@ -22,7 +22,7 @@ uniform sampler2D myTexture;
#define SOLID 0
#define GRADIENT 1
#define RADIAL 2
#define CHESS 3
#define CHECKER 3
#define TEXTURE 4
in vec2 texCoord_interp;
@@ -104,7 +104,7 @@ void main()
vec2 rot_tex = (matrot_tex * (texCoord_interp - t_center)) + t_center + t_offset;
vec4 tmp_color = texture2D(myTexture, rot_tex * t_scale);
vec4 text_color = vec4(tmp_color[0], tmp_color[1], tmp_color[2], tmp_color[3] * t_opacity);
vec4 chesscolor;
vec4 checker_color;
/* solid fill */
if (fill_type == SOLID) {
@@ -144,32 +144,32 @@ void main()
}
set_color(color, color2, text_color, mix_factor, intensity, t_mix, t_flip, fragColor);
}
/* chessboard */
if (fill_type == CHESS) {
/* Checkerboard */
if (fill_type == CHECKER) {
vec2 pos = rot / g_boxsize;
if ((fract(pos.x) < 0.5 && fract(pos.y) < 0.5) ||
(fract(pos.x) > 0.5 && fract(pos.y) > 0.5)) {
if (t_flip == 0) {
chesscolor = color;
checker_color = color;
}
else {
chesscolor = color2;
checker_color = color2;
}
}
else {
if (t_flip == 0) {
chesscolor = color2;
checker_color = color2;
}
else {
chesscolor = color;
checker_color = color;
}
}
/* mix with texture */
if (t_mix == 1) {
fragColor = mix(chesscolor, text_color, mix_factor);
fragColor = mix(checker_color, text_color, mix_factor);
}
else {
fragColor = chesscolor;
fragColor = checker_color;
}
}
/* texture */

View File

@@ -338,7 +338,7 @@ enum {
enum {
GP_STYLE_FILL_STYLE_SOLID = 0,
GP_STYLE_FILL_STYLE_GRADIENT,
GP_STYLE_FILL_STYLE_CHESSBOARD,
GP_STYLE_FILL_STYLE_CHECKER,
GP_STYLE_FILL_STYLE_TEXTURE,
};

View File

@@ -433,11 +433,11 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
static EnumPropertyItem fill_style_items[] = {
{GP_STYLE_FILL_STYLE_SOLID, "SOLID", 0, "Solid", "Fill area with solid color"},
{GP_STYLE_FILL_STYLE_GRADIENT, "GRADIENT", 0, "Gradient", "Fill area with gradient color"},
{GP_STYLE_FILL_STYLE_CHESSBOARD,
"CHESSBOARD",
{GP_STYLE_FILL_STYLE_CHECKER,
"CHECKER",
0,
"Checker Board",
"Fill area with chessboard pattern"},
"Fill area with checkerboard pattern"},
{GP_STYLE_FILL_STYLE_TEXTURE, "TEXTURE", 0, "Texture", "Fill area with image texture"},
{0, NULL, 0, NULL, NULL},
};