Fix T79683: Dim GPencil points created by modifiers

This change makes the generated points a light dimmer than selectable points.

Before:

{F8765593}

After:
{F8765585}

Maniphest Tasks: T79683

Differential Revision: https://developer.blender.org/D8515
This commit is contained in:
Antonio Vazquez
2020-08-11 19:10:52 +02:00
parent 48c0a82f7a
commit cae4041878
2 changed files with 8 additions and 0 deletions

View File

@@ -26,6 +26,7 @@ void discard_vert()
#define GP_EDIT_MULTIFRAME 4u /* 1 << 2 */
#define GP_EDIT_STROKE_START 8u /* 1 << 3 */
#define GP_EDIT_STROKE_END 16u /* 1 << 4 */
#define GP_EDIT_POINT_DIMMED 32u /* 1 << 5 */
#ifdef USE_POINTS
# define colorUnselect colorGpencilVertex
@@ -60,6 +61,7 @@ void main()
bool is_multiframe = (vflag & GP_EDIT_MULTIFRAME) != 0u;
bool is_stroke_sel = (vflag & GP_EDIT_STROKE_SELECTED) != 0u;
bool is_point_sel = (vflag & GP_EDIT_POINT_SELECTED) != 0u;
bool is_point_dimmed = (vflag & GP_EDIT_POINT_DIMMED) != 0u;
if (doWeightColor) {
finalColor.rgb = weight_to_rgb(weight);
@@ -73,6 +75,10 @@ void main()
#ifdef USE_POINTS
gl_PointSize = sizeVertex * 2.0;
if (is_point_dimmed) {
finalColor.rgb = clamp(colorUnselect.rgb + vec3(0.3), 0.0, 1.0);
}
if (doStrokeEndpoints && !doWeightColor) {
bool is_stroke_start = (vflag & GP_EDIT_STROKE_START) != 0u;
bool is_stroke_end = (vflag & GP_EDIT_STROKE_END) != 0u;

View File

@@ -645,6 +645,7 @@ void DRW_cache_gpencil_sbuffer_clear(Object *ob)
#define GP_EDIT_MULTIFRAME (1 << 2)
#define GP_EDIT_STROKE_START (1 << 3)
#define GP_EDIT_STROKE_END (1 << 4)
#define GP_EDIT_POINT_DIMMED (1 << 5)
typedef struct gpEditIterData {
gpEditVert *verts;
@@ -660,6 +661,7 @@ static uint32_t gpencil_point_edit_flag(const bool layer_lock,
SET_FLAG_FROM_TEST(sflag, (!layer_lock) && pt->flag & GP_SPOINT_SELECT, GP_EDIT_POINT_SELECTED);
SET_FLAG_FROM_TEST(sflag, v == 0, GP_EDIT_STROKE_START);
SET_FLAG_FROM_TEST(sflag, v == (v_len - 1), GP_EDIT_STROKE_END);
SET_FLAG_FROM_TEST(sflag, pt->runtime.pt_orig == NULL, GP_EDIT_POINT_DIMMED);
return sflag;
}