Commit: 37ffbb292d9fe1b3d55587f712bff82602463ce3
Author: Antonio Vazquez
Date:   Tue Jun 12 16:24:05 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB37ffbb292d9fe1b3d55587f712bff82602463ce3

Rename field gradient_boxsize to pattern_gridsize

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

M       release/scripts/startup/bl_ui/properties_material_gpencil.py
M       source/blender/blenkernel/intern/material.c
M       source/blender/draw/engines/gpencil/gpencil_draw_utils.c
M       source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
M       source/blender/editors/gpencil/drawgpencil.c
M       source/blender/makesdna/DNA_material_types.h
M       source/blender/makesrna/intern/rna_material.c

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

diff --git a/release/scripts/startup/bl_ui/properties_material_gpencil.py 
b/release/scripts/startup/bl_ui/properties_material_gpencil.py
index 592c301f646..ee8c3132b39 100644
--- a/release/scripts/startup/bl_ui/properties_material_gpencil.py
+++ b/release/scripts/startup/bl_ui/properties_material_gpencil.py
@@ -230,7 +230,7 @@ class MATERIAL_PT_gpencil_fillcolor(GPMaterialButtonsPanel, 
Panel):
                         col.prop(gpcolor, "pattern_angle", text="Angle")
 
                 if gpcolor.fill_style == 'CHESSBOARD':
-                    col.prop(gpcolor, "pattern_boxsize", text="Box")
+                    col.prop(gpcolor, "pattern_gridsize", text="Box Size")
 
             # Texture
             if gpcolor.fill_style == 'TEXTURE' or (gpcolor.texture_mix is True 
and gpcolor.fill_style == 'SOLID'):
diff --git a/source/blender/blenkernel/intern/material.c 
b/source/blender/blenkernel/intern/material.c
index 7138e3b3bfb..d522db09b71 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -119,7 +119,7 @@ void BKE_material_init_gpencil_settings(Material *ma)
                MaterialGPencilStyle *gp_style = ma->gp_style;
                /* set basic settings */
                gp_style->stroke_rgba[3] = 1.0f;
-               gp_style->gradient_boxsize = 0.1f;
+               gp_style->pattern_gridsize = 0.1f;
                gp_style->gradient_radius = 0.5f;
                ARRAY_SET_ITEMS(gp_style->mix_rgba, 1.0f, 1.0f, 1.0f, 0.2f);
                ARRAY_SET_ITEMS(gp_style->gradient_scale, 1.0f, 1.0f);
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c 
b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
index 5fc6291e926..36e5bc186e5 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c
@@ -304,7 +304,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_fill_create(
 
        DRW_shgroup_uniform_float(grp, "gradient_angle", 
&gp_style->gradient_angle, 1);
        DRW_shgroup_uniform_float(grp, "gradient_radius", 
&gp_style->gradient_radius, 1);
-       DRW_shgroup_uniform_float(grp, "gradient_boxsize", 
&gp_style->gradient_boxsize, 1);
+       DRW_shgroup_uniform_float(grp, "pattern_gridsize", 
&gp_style->pattern_gridsize, 1);
        DRW_shgroup_uniform_vec2(grp, "gradient_scale", 
gp_style->gradient_scale, 1);
        DRW_shgroup_uniform_vec2(grp, "gradient_shift", 
gp_style->gradient_shift, 1);
 
diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl 
b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
index da5cfdc457f..dfd1d1dc438 100644
--- a/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
+++ b/source/blender/draw/engines/gpencil/shaders/gpencil_fill_frag.glsl
@@ -4,7 +4,7 @@ uniform float mix_factor;
 
 uniform float gradient_angle;
 uniform float gradient_radius;
-uniform float gradient_boxsize;
+uniform float pattern_gridsize;
 uniform vec2 gradient_scale;
 uniform vec2 gradient_shift;
 
@@ -106,7 +106,7 @@ void main()
                }
                /* chessboard */
                if (fill_type == CHESS) {
-                       vec2 pos = rot / gradient_boxsize;
+                       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;
                        }
diff --git a/source/blender/editors/gpencil/drawgpencil.c 
b/source/blender/editors/gpencil/drawgpencil.c
index b21cbc554cc..04d8dbe8e8e 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -648,7 +648,7 @@ static void gp_draw_stroke_fill(
 
        immUniform1f("gradient_angle", gp_style->gradient_angle);
        immUniform1f("gradient_radius", gp_style->gradient_radius);
-       immUniform1f("gradient_boxsize", gp_style->gradient_boxsize);
+       immUniform1f("pattern_gridsize", gp_style->pattern_gridsize);
        immUniform2fv("gradient_scale", gp_style->gradient_scale);
        immUniform2fv("gradient_shift", gp_style->gradient_shift);
 
diff --git a/source/blender/makesdna/DNA_material_types.h 
b/source/blender/makesdna/DNA_material_types.h
index 2379f2dcd40..67fafd10548 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -67,7 +67,7 @@ typedef struct MaterialGPencilStyle {
        float mix_factor;        /* factor used to define shader behavior 
(several uses) */
        float gradient_angle;    /* angle used for gradients orientation */
        float gradient_radius;   /* radius for radial gradients */
-       float gradient_boxsize;  /* cheesboard size */
+       float pattern_gridsize;  /* cheesboard size */
        float gradient_scale[2]; /* uv coordinates scale */
        float gradient_shift[2]; /* factor to shift filling in 2d space */
        float texture_angle;     /* angle used for texture orientation */
diff --git a/source/blender/makesrna/intern/rna_material.c 
b/source/blender/makesrna/intern/rna_material.c
index e4e91d4ba9c..eebc470d9d2 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -441,8 +441,8 @@ static void rna_def_material_greasepencil(BlenderRNA *brna)
        RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, 
"rna_Material_update");
 
        /* Box size */
-       prop = RNA_def_property(srna, "pattern_boxsize", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "gradient_boxsize");
+       prop = RNA_def_property(srna, "pattern_gridsize", PROP_FLOAT, 
PROP_NONE);
+       RNA_def_property_float_sdna(prop, NULL, "pattern_gridsize");
        RNA_def_property_range(prop, 0.0001f, 10.0f);
        RNA_def_property_ui_text(prop, "Size", "Box Size");
        RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, 
"rna_Material_update");

_______________________________________________
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
https://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to