diff options
author | Antonioya <blendergit@gmail.com> | 2019-05-14 18:28:31 +0300 |
---|---|---|
committer | Antonioya <blendergit@gmail.com> | 2019-05-14 18:28:42 +0300 |
commit | 70f3ff808ac591b4e9c7c71583ce1032024b9e4f (patch) | |
tree | a87d4f5ba5dd180d4a551524bc421c22e12c6b82 /source/blender/draw | |
parent | 0d2e708ea44941b79bbf412354d37a77afc8e486 (diff) |
GPencil: Rename property Follow Drawing Path to Alignment
The old name was not clear and with new options the new name is more easy to understand.
Diffstat (limited to 'source/blender/draw')
4 files changed, 14 insertions, 14 deletions
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 cc0c5e114bf..7b2c0ed168e 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -134,7 +134,7 @@ void DRW_gpencil_get_point_geom(GpencilBatchCacheElem *be, bGPDstroke *gps, short thickness, const float ink[4], - const int follow_mode) + const int alignment_mode) { int totvertex = gps->totpoints; if (be->vbo == NULL) { @@ -178,7 +178,7 @@ void DRW_gpencil_get_point_geom(GpencilBatchCacheElem *be, /* use previous point to determine stroke direction */ bGPDspoint *pt2 = NULL; float fpt[3]; - if (follow_mode != GP_STYLE_FOLLOW_PATH) { + if (alignment_mode != GP_STYLE_FOLLOW_PATH) { /* add small offset to get a vector */ copy_v3_v3(fpt, &pt->x); fpt[0] += 0.00001f; diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c index 5747de72d7a..71e83dac461 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_utils.c @@ -725,8 +725,8 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(GPENCIL_e_data *e_data, DRW_shgroup_uniform_float(grp, "mix_stroke_factor", &stl->shgroups[id].mix_stroke_factor, 1); /* lock rotation of dots and boxes */ - stl->shgroups[id].follow_mode = gp_style->follow_mode; - DRW_shgroup_uniform_int(grp, "follow_mode", &stl->shgroups[id].follow_mode, 1); + stl->shgroups[id].alignment_mode = gp_style->alignment_mode; + DRW_shgroup_uniform_int(grp, "alignment_mode", &stl->shgroups[id].alignment_mode, 1); } else { stl->storage->obj_scale = 1.0f; @@ -758,7 +758,7 @@ static DRWShadingGroup *DRW_gpencil_shgroup_point_create(GPENCIL_e_data *e_data, DRW_shgroup_uniform_float(grp, "mix_stroke_factor", &stl->storage->mix_stroke_factor, 1); /* lock rotation of dots and boxes */ - DRW_shgroup_uniform_int(grp, "follow_mode", &stl->storage->follow_mode, 1); + DRW_shgroup_uniform_int(grp, "alignment_mode", &stl->storage->alignment_mode, 1); } DRW_shgroup_uniform_vec4(grp, "colormix", gp_style->stroke_rgba, 1); @@ -870,7 +870,7 @@ static void gpencil_add_stroke_vertexdata(GpencilBatchCache *cache, float ink[4]; short sthickness; MaterialGPencilStyle *gp_style = BKE_material_gpencil_settings_get(ob, gps->mat_nr + 1); - const int follow_mode = (gp_style) ? gp_style->follow_mode : GP_STYLE_FOLLOW_PATH; + const int alignment_mode = (gp_style) ? gp_style->alignment_mode : GP_STYLE_FOLLOW_PATH; /* set color using base color, tint color and opacity */ if (cache->is_dirty) { @@ -920,7 +920,7 @@ static void gpencil_add_stroke_vertexdata(GpencilBatchCache *cache, else { /* create vertex data */ const int old_len = cache->b_point.vbo_len; - DRW_gpencil_get_point_geom(&cache->b_point, gps, sthickness, ink, follow_mode); + DRW_gpencil_get_point_geom(&cache->b_point, gps, sthickness, ink, alignment_mode); /* add to list of groups */ if (old_len < cache->b_point.vbo_len) { @@ -1491,7 +1491,7 @@ void DRW_gpencil_populate_buffer_strokes(GPENCIL_e_data *e_data, /* save gradient info */ stl->storage->gradient_f = brush->gpencil_settings->gradient_f; copy_v2_v2(stl->storage->gradient_s, brush->gpencil_settings->gradient_s); - stl->storage->follow_mode = (gp_style) ? gp_style->follow_mode : GP_STYLE_FOLLOW_PATH; + stl->storage->alignment_mode = (gp_style) ? gp_style->alignment_mode : GP_STYLE_FOLLOW_PATH; /* if only one point, don't need to draw buffer because the user has no time to see it */ if (gpd->runtime.sbuffer_size > 1) { diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index b4df86b5a4c..9ebd168bc4c 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -129,7 +129,7 @@ typedef struct GPENCIL_shgroup { int caps_mode[2]; float obj_scale; int xray_mode; - int follow_mode; + int alignment_mode; float gradient_f; float gradient_s[2]; @@ -182,7 +182,7 @@ typedef struct GPENCIL_Storage { float gradient_f; float gradient_s[2]; - int follow_mode; + int alignment_mode; float mix_stroke_factor; diff --git a/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl b/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl index fed24665be5..a2f4c1f9b15 100644 --- a/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl +++ b/source/blender/draw/engines/gpencil/shaders/gpencil_point_geom.glsl @@ -1,6 +1,6 @@ uniform vec2 Viewport; uniform int xraymode; -uniform int follow_mode; +uniform int alignment_mode; layout(points) in; layout(triangle_strip, max_vertices = 4) out; @@ -20,8 +20,8 @@ out vec2 mTexCoord; #define M_2PI 6.28318530717958647692 /* 2*pi */ #define FALSE 0 -/* keep this definition equals to GP_STYLE_FOLLOW_NONE value */ -#define NONE 2 +/* keep this definition equals to GP_STYLE_FOLLOW_FIXED value */ +#define FIXED 2 /* project 3d point to 2d on screen space */ vec2 toScreenSpace(vec4 vertex) @@ -72,7 +72,7 @@ float getAngle(vec2 pt0, vec2 pt1) return 0.0; } - if (follow_mode == NONE) { + if (alignment_mode == FIXED) { return 0.0; } |