From b98e6743dcaf8ec513bbbadc0015cb8729a72a18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Sun, 23 Dec 2018 16:26:21 +0100 Subject: Texture Paint: Add filtering option for texture paint overlay The overlay should now use the texture interpolation setting in material mode. In image mode, there is now a new button to let the user choose the texture filter. The option is located in the Texture Slots popover and only shows in Image mode. --- source/blender/makesrna/intern/rna_sculpt_paint.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_sculpt_paint.c b/source/blender/makesrna/intern/rna_sculpt_paint.c index 581b0e94aad..f9f21c4c76a 100644 --- a/source/blender/makesrna/intern/rna_sculpt_paint.c +++ b/source/blender/makesrna/intern/rna_sculpt_paint.c @@ -872,6 +872,14 @@ static void rna_def_image_paint(BlenderRNA *brna) {0, NULL, 0, NULL, NULL} }; + static const EnumPropertyItem paint_interp_items[] = { + {IMAGEPAINT_INTERP_LINEAR, "LINEAR", 0, + "Linear", "Linear interpolation"}, + {IMAGEPAINT_INTERP_CLOSEST, "CLOSEST", 0, + "Closest", "No interpolation (sample closest texel)"}, + {0, NULL, 0, NULL, NULL} + }; + srna = RNA_def_struct(brna, "ImagePaint", "Paint"); RNA_def_struct_sdna(srna, "ImagePaintSettings"); RNA_def_struct_path_func(srna, "rna_ImagePaintSettings_path"); @@ -964,6 +972,13 @@ static void rna_def_image_paint(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Mode", "Mode of operation for projection painting"); RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update"); + prop = RNA_def_property(srna, "interpolation", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "interp"); + RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE); + RNA_def_property_enum_items(prop, paint_interp_items); + RNA_def_property_ui_text(prop, "Interpolation", "Texture filtering type"); + RNA_def_property_update(prop, NC_SCENE | ND_TOOLSETTINGS, "rna_ImaPaint_mode_update"); + /* Missing data */ prop = RNA_def_property(srna, "missing_uvs", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "missing_data", IMAGEPAINT_MISSING_UVS); -- cgit v1.2.3