Commit: 9771c008da60983a0fb84cc4f400469fc46adda0
Author: Antonio Vazquez
Date:   Fri May 11 17:13:55 2018 +0200
Branches: greasepencil-object
https://developer.blender.org/rB9771c008da60983a0fb84cc4f400469fc46adda0

Rename gradient and texture fields

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

M       source/blender/blenkernel/intern/material.c
M       source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
M       source/blender/editors/gpencil/drawgpencil.c
M       source/blender/editors/gpencil/gpencil_paint.c
M       source/blender/editors/gpencil/gpencil_utils.c
M       source/blender/makesdna/DNA_material_types.h
M       source/blender/makesrna/intern/rna_material.c

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

diff --git a/source/blender/blenkernel/intern/material.c 
b/source/blender/blenkernel/intern/material.c
index 22ebd4a0ffc..45abee90542 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -119,13 +119,13 @@ void BKE_material_init_gpencil_settings(Material *ma)
                MaterialGPencilStyle *gp_style = ma->gp_style;
                /* set basic settings */
                gp_style->rgb[3] = 1.0f;
-               gp_style->g_boxsize = 0.1f;
-               gp_style->g_radius = 0.5f;
+               gp_style->gradient_boxsize = 0.1f;
+               gp_style->gradient_radius = 0.5f;
                ARRAY_SET_ITEMS(gp_style->scolor, 1.0f, 1.0f, 1.0f, 0.2f);
-               ARRAY_SET_ITEMS(gp_style->g_scale, 1.0f, 1.0f);
-               ARRAY_SET_ITEMS(gp_style->t_scale, 1.0f, 1.0f);
-               gp_style->t_opacity = 1.0f;
-               gp_style->t_pixsize = 100.0f;
+               ARRAY_SET_ITEMS(gp_style->gradient_scale, 1.0f, 1.0f);
+               ARRAY_SET_ITEMS(gp_style->texture_scale, 1.0f, 1.0f);
+               gp_style->texture_opacity = 1.0f;
+               gp_style->texture_pixsize = 100.0f;
        }
 }
 
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 fab150887af..ecf022356c1 100644
--- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
+++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c
@@ -70,16 +70,16 @@ static DRWShadingGroup 
*DRW_gpencil_shgroup_fill_create(GPENCIL_e_data *e_data,
        DRW_shgroup_uniform_int(grp, "fill_type", 
&stl->shgroups[id].fill_style, 1);
        DRW_shgroup_uniform_float(grp, "mix_factor", &gp_style->mix_factor, 1);
 
-       DRW_shgroup_uniform_float(grp, "g_angle", &gp_style->g_angle, 1);
-       DRW_shgroup_uniform_float(grp, "g_radius", &gp_style->g_radius, 1);
-       DRW_shgroup_uniform_float(grp, "g_boxsize", &gp_style->g_boxsize, 1);
-       DRW_shgroup_uniform_vec2(grp, "g_scale", gp_style->g_scale, 1);
-       DRW_shgroup_uniform_vec2(grp, "g_shift", gp_style->g_shift, 1);
-
-       DRW_shgroup_uniform_float(grp, "t_angle", &gp_style->t_angle, 1);
-       DRW_shgroup_uniform_vec2(grp, "t_scale", gp_style->t_scale, 1);
-       DRW_shgroup_uniform_vec2(grp, "t_offset", gp_style->t_offset, 1);
-       DRW_shgroup_uniform_float(grp, "t_opacity", &gp_style->t_opacity, 1);
+       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_vec2(grp, "gradient_scale", 
gp_style->gradient_scale, 1);
+       DRW_shgroup_uniform_vec2(grp, "gradient_shift", 
gp_style->gradient_shift, 1);
+
+       DRW_shgroup_uniform_float(grp, "texture_angle", 
&gp_style->texture_angle, 1);
+       DRW_shgroup_uniform_vec2(grp, "texture_scale", gp_style->texture_scale, 
1);
+       DRW_shgroup_uniform_vec2(grp, "texture_offset", 
gp_style->texture_offset, 1);
+       DRW_shgroup_uniform_float(grp, "texture_opacity", 
&gp_style->texture_opacity, 1);
 
        stl->shgroups[id].t_mix = gp_style->flag & GP_STYLE_COLOR_TEX_MIX ? 1 : 
0;
        DRW_shgroup_uniform_int(grp, "t_mix", &stl->shgroups[id].t_mix, 1);
diff --git a/source/blender/editors/gpencil/drawgpencil.c 
b/source/blender/editors/gpencil/drawgpencil.c
index ad59badc365..58dda4d3f16 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -644,16 +644,16 @@ static void gp_draw_stroke_fill(
        immUniform1i("fill_type", gp_style->fill_style);
        immUniform1f("mix_factor", gp_style->mix_factor);
 
-       immUniform1f("g_angle", gp_style->g_angle);
-       immUniform1f("g_radius", gp_style->g_radius);
-       immUniform1f("g_boxsize", gp_style->g_boxsize);
-       immUniform2fv("g_scale", gp_style->g_scale);
-       immUniform2fv("g_shift", gp_style->g_shift);
-
-       immUniform1f("t_angle", gp_style->t_angle);
-       immUniform2fv("t_scale", gp_style->t_scale);
-       immUniform2fv("t_offset", gp_style->t_offset);
-       immUniform1f("t_opacity", gp_style->t_opacity);
+       immUniform1f("gradient_angle", gp_style->gradient_angle);
+       immUniform1f("gradient_radius", gp_style->gradient_radius);
+       immUniform1f("gradient_boxsize", gp_style->gradient_boxsize);
+       immUniform2fv("gradient_scale", gp_style->gradient_scale);
+       immUniform2fv("gradient_shift", gp_style->gradient_shift);
+
+       immUniform1f("texture_angle", gp_style->texture_angle);
+       immUniform2fv("texture_scale", gp_style->texture_scale);
+       immUniform2fv("texture_offset", gp_style->texture_offset);
+       immUniform1f("texture_opacity", gp_style->texture_opacity);
        immUniform1i("t_mix", gp_style->flag & GP_STYLE_COLOR_TEX_MIX ? 1 : 0);
        immUniform1i("t_flip", gp_style->flag & GP_STYLE_COLOR_FLIP_FILL ? 1 : 
0);
        /* image texture */
diff --git a/source/blender/editors/gpencil/gpencil_paint.c 
b/source/blender/editors/gpencil/gpencil_paint.c
index 30e31708688..ce35c60a63c 100644
--- a/source/blender/editors/gpencil/gpencil_paint.c
+++ b/source/blender/editors/gpencil/gpencil_paint.c
@@ -697,7 +697,7 @@ static short gp_stroke_addpoint(
                
                /* point uv (only 3d view) */
                if ((p->sa->spacetype == SPACE_VIEW3D) && (gpd->sbuffer_size > 
1)) {
-                       float pixsize = gp_style->t_pixsize / 1000000.0f;
+                       float pixsize = gp_style->texture_pixsize / 1000000.0f;
                        tGPspoint *ptb = (tGPspoint *)gpd->sbuffer + 
gpd->sbuffer_size - 2;
                        bGPDspoint spt, spt2;
 
diff --git a/source/blender/editors/gpencil/gpencil_utils.c 
b/source/blender/editors/gpencil/gpencil_utils.c
index e16bdd54063..e099f801848 100644
--- a/source/blender/editors/gpencil/gpencil_utils.c
+++ b/source/blender/editors/gpencil/gpencil_utils.c
@@ -1665,7 +1665,7 @@ void ED_gpencil_calc_stroke_uv(Object *ob, bGPDstroke 
*gps)
        MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, 
gps->mat_nr + 1);
        float pixsize;
        if (gp_style) {
-               pixsize = gp_style->t_pixsize / 1000000.0f;
+               pixsize = gp_style->texture_pixsize / 1000000.0f;
        }
        else {
                /* use this value by default */
diff --git a/source/blender/makesdna/DNA_material_types.h 
b/source/blender/makesdna/DNA_material_types.h
index fcb286c4041..450d0caee6b 100644
--- a/source/blender/makesdna/DNA_material_types.h
+++ b/source/blender/makesdna/DNA_material_types.h
@@ -70,21 +70,21 @@ typedef struct MaterialGPencilStyle {
        float rgb[4];            /* color for paint and strokes (alpha 
included) */
        float fill[4];           /* color that should be used for drawing 
"fills" for strokes (alpha included) */
        float scolor[4];         /* secondary color used for gradients and 
other stuff */
-       short flag;              /* settings for palette color */
+       short flag;              /* settings */
        short index;             /* custom index for passes */
        short stroke_style;      /* style for drawing strokes (used to select 
shader type) */
        short fill_style;        /* style for filling areas (used to select 
shader type) */
        float mix_factor;        /* factor used to define shader behavior 
(several uses) */
-       float g_angle;           /* angle used for gradients orientation */
-       float g_radius;          /* radius for radial gradients */
-       float g_boxsize;         /* cheesboard size */
-       float g_scale[2];        /* uv coordinates scale */
-       float g_shift[2];        /* factor to shift filling in 2d space */
-       float t_angle;           /* angle used for texture orientation */
-       float t_scale[2];        /* texture scale (separated of uv scale) */
-       float t_offset[2];       /* factor to shift texture in 2d space */
-       float t_opacity;         /* texture opacity */
-       float t_pixsize;         /* pixel size for uv along the stroke */
+       float gradient_angle;    /* angle used for gradients orientation */
+       float gradient_radius;   /* radius for radial gradients */
+       float gradient_boxsize;  /* 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 */
+       float texture_scale[2];  /* texture scale (separated of uv scale) */
+       float texture_offset[2]; /* factor to shift texture in 2d space */
+       float texture_opacity;   /* texture opacity */
+       float texture_pixsize;   /* pixel size for uv along the stroke */
        int mode;                /* drawing mode (line or dots) */
 } MaterialGPencilStyle;
 
diff --git a/source/blender/makesrna/intern/rna_material.c 
b/source/blender/makesrna/intern/rna_material.c
index 410b3537e51..92689d97c8b 100644
--- a/source/blender/makesrna/intern/rna_material.c
+++ b/source/blender/makesrna/intern/rna_material.c
@@ -464,68 +464,68 @@ static void rna_def_material_greasepencil(BlenderRNA 
*brna)
 
        /* Scale factor for uv coordinates */
        prop = RNA_def_property(srna, "pattern_scale", PROP_FLOAT, PROP_COORDS);
-       RNA_def_property_float_sdna(prop, NULL, "g_scale");
+       RNA_def_property_float_sdna(prop, NULL, "gradient_scale");
        RNA_def_property_array(prop, 2);
        RNA_def_property_ui_text(prop, "Scale", "Scale Factor for UV 
coordinates");
        RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, 
"rna_Material_update");
 
        /* Shift factor to move pattern filling in 2d space */
        prop = RNA_def_property(srna, "pattern_shift", PROP_FLOAT, PROP_COORDS);
-       RNA_def_property_float_sdna(prop, NULL, "g_shift");
+       RNA_def_property_float_sdna(prop, NULL, "gradient_shift");
        RNA_def_property_array(prop, 2);
        RNA_def_property_ui_text(prop, "Shift", "Shift filling pattern in 2d 
space");
        RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, 
"rna_Material_update");
 
        /* Gradient angle */
        prop = RNA_def_property(srna, "pattern_angle", PROP_FLOAT, PROP_ANGLE);
-       RNA_def_property_float_sdna(prop, NULL, "g_angle");
+       RNA_def_property_float_sdna(prop, NULL, "gradient_angle");
        RNA_def_property_ui_text(prop, "Angle", "Pattern Orientation Angle");
        RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, 
"rna_Material_update");
 
        /* Gradient radius */
        prop = RNA_def_property(srna, "pattern_radius", PROP_FLOAT, PROP_NONE);
-       RNA_def_property_float_sdna(prop, NULL, "g_radius");
+       RNA_def_property_float_sdna(prop, NULL, "gradient_radius");
        RNA_def_property_range(prop, 0.0001f, 10.0f);
        RNA_def_property_ui_text(prop, "Radius", "Pattern Radius");
        RNA_def_property_update(prop, NC_GPENCIL | ND_SHADING, 
"rna_Material_update");
 
        /* Box size */
        prop = RNA_def_property(srna, "pattern_boxsize", P

@@ Diff output truncated at 10240 characters. @@

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

Reply via email to