Vertex Paint: use brush front-face setting
Follow sculpt mode more closely by using the brush front-face option.
This commit is contained in:
@@ -143,7 +143,7 @@ static float view_angle_limits_apply_falloff(
|
||||
|
||||
static bool vwpaint_use_normal(const VPaint *vp)
|
||||
{
|
||||
return ((vp->flag & VP_FLAG_PROJECT_BACKFACE) == 0) ||
|
||||
return ((vp->paint.brush->flag & BRUSH_FRONTFACE) != 0) ||
|
||||
((vp->flag & VP_FLAG_PROJECT_FLAT) == 0);
|
||||
}
|
||||
|
||||
@@ -1556,7 +1556,7 @@ static void do_wpaint_brush_blur_task_cb_ex(
|
||||
float brush_strength = cache->bstrength;
|
||||
const float angle_cos = (use_normal && vd.no) ?
|
||||
dot_vf3vs3(ss->cache->sculpt_normal_symm, vd.no) : 1.0f;
|
||||
if (((data->vp->flag & VP_FLAG_PROJECT_BACKFACE) ||
|
||||
if (((brush->flag & BRUSH_FRONTFACE) == 0 ||
|
||||
(angle_cos > 0.0f)) &&
|
||||
((data->vp->flag & VP_FLAG_PROJECT_FLAT) ||
|
||||
view_angle_limits_apply_falloff(&data->wpd->normal_angle_precalc, angle_cos, &brush_strength)))
|
||||
@@ -1632,7 +1632,7 @@ static void do_wpaint_brush_smear_task_cb_ex(
|
||||
float brush_strength = cache->bstrength;
|
||||
const float angle_cos = (use_normal && vd.no) ?
|
||||
dot_vf3vs3(ss->cache->sculpt_normal_symm, vd.no) : 1.0f;
|
||||
if (((data->vp->flag & VP_FLAG_PROJECT_BACKFACE) ||
|
||||
if (((brush->flag & BRUSH_FRONTFACE) == 0 ||
|
||||
(angle_cos > 0.0f)) &&
|
||||
((data->vp->flag & VP_FLAG_PROJECT_FLAT) ||
|
||||
view_angle_limits_apply_falloff(&data->wpd->normal_angle_precalc, angle_cos, &brush_strength)))
|
||||
@@ -1733,7 +1733,7 @@ static void do_wpaint_brush_draw_task_cb_ex(
|
||||
float brush_strength = cache->bstrength;
|
||||
const float angle_cos = (use_normal && vd.no) ?
|
||||
dot_vf3vs3(ss->cache->sculpt_normal_symm, vd.no) : 1.0f;
|
||||
if (((data->vp->flag & VP_FLAG_PROJECT_BACKFACE) ||
|
||||
if (((brush->flag & BRUSH_FRONTFACE) == 0 ||
|
||||
(angle_cos > 0.0f)) &&
|
||||
((data->vp->flag & VP_FLAG_PROJECT_FLAT) ||
|
||||
view_angle_limits_apply_falloff(&data->wpd->normal_angle_precalc, angle_cos, &brush_strength)))
|
||||
@@ -2530,7 +2530,7 @@ static void do_vpaint_brush_draw_task_cb_ex(
|
||||
float brush_strength = cache->bstrength;
|
||||
const float angle_cos = (use_normal && vd.no) ?
|
||||
dot_vf3vs3(ss->cache->sculpt_normal_symm, vd.no) : 1.0f;
|
||||
if (((data->vp->flag & VP_FLAG_PROJECT_BACKFACE) ||
|
||||
if (((brush->flag & BRUSH_FRONTFACE) == 0 ||
|
||||
(angle_cos > 0.0f)) &&
|
||||
((data->vp->flag & VP_FLAG_PROJECT_FLAT) ||
|
||||
view_angle_limits_apply_falloff(&data->vpd->normal_angle_precalc, angle_cos, &brush_strength)))
|
||||
@@ -2616,7 +2616,7 @@ static void do_vpaint_brush_blur_task_cb_ex(
|
||||
float brush_strength = cache->bstrength;
|
||||
const float angle_cos = (use_normal && vd.no) ?
|
||||
dot_vf3vs3(ss->cache->sculpt_normal_symm, vd.no) : 1.0f;
|
||||
if (((data->vp->flag & VP_FLAG_PROJECT_BACKFACE) ||
|
||||
if (((brush->flag & BRUSH_FRONTFACE) == 0 ||
|
||||
(angle_cos > 0.0f)) &&
|
||||
((data->vp->flag & VP_FLAG_PROJECT_FLAT) ||
|
||||
view_angle_limits_apply_falloff(&data->vpd->normal_angle_precalc, angle_cos, &brush_strength)))
|
||||
@@ -2731,7 +2731,7 @@ static void do_vpaint_brush_smear_task_cb_ex(
|
||||
float brush_strength = cache->bstrength;
|
||||
const float angle_cos = (use_normal && vd.no) ?
|
||||
dot_vf3vs3(ss->cache->sculpt_normal_symm, vd.no) : 1.0f;
|
||||
if (((data->vp->flag & VP_FLAG_PROJECT_BACKFACE) ||
|
||||
if (((brush->flag & BRUSH_FRONTFACE) == 0 ||
|
||||
(angle_cos > 0.0f)) &&
|
||||
((data->vp->flag & VP_FLAG_PROJECT_FLAT) ||
|
||||
view_angle_limits_apply_falloff(&data->vpd->normal_angle_precalc, angle_cos, &brush_strength)))
|
||||
|
||||
@@ -1125,7 +1125,6 @@ typedef struct VPaint {
|
||||
|
||||
/* VPaint.flag */
|
||||
enum {
|
||||
VP_FLAG_PROJECT_BACKFACE = (1 << 0),
|
||||
/* TODO */
|
||||
// VP_FLAG_PROJECT_XRAY = (1 << 1),
|
||||
VP_FLAG_PROJECT_FLAT = (1 << 3),
|
||||
|
||||
@@ -671,11 +671,6 @@ static void rna_def_vertex_paint(BlenderRNA *brna)
|
||||
RNA_def_struct_path_func(srna, "rna_VertexPaint_path");
|
||||
RNA_def_struct_ui_text(srna, "Vertex Paint", "Properties of vertex and weight paint mode");
|
||||
|
||||
prop = RNA_def_property(srna, "use_backface_culling", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", VP_FLAG_PROJECT_BACKFACE);
|
||||
RNA_def_property_ui_text(prop, "Cull", "Ignore vertices pointing away from the view (faster)");
|
||||
RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, NULL);
|
||||
|
||||
prop = RNA_def_property(srna, "use_normal_falloff", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_negative_sdna(prop, NULL, "flag", VP_FLAG_PROJECT_FLAT);
|
||||
RNA_def_property_ui_text(prop, "Normals", "Paint most on faces pointing towards the view");
|
||||
|
||||
Reference in New Issue
Block a user