Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--release/scripts/ui/space_image.py1
-rw-r--r--release/scripts/ui/space_view3d_toolbar.py2
-rw-r--r--source/blender/blenkernel/intern/brush.c17
-rw-r--r--source/blender/makesrna/intern/rna_brush.c5
4 files changed, 16 insertions, 9 deletions
diff --git a/release/scripts/ui/space_image.py b/release/scripts/ui/space_image.py
index 1927962d90b..171b10aeee1 100644
--- a/release/scripts/ui/space_image.py
+++ b/release/scripts/ui/space_image.py
@@ -685,6 +685,7 @@ class IMAGE_PT_tools_brush_texture(BrushButtonsPanel, bpy.types.Panel):
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
+ col.prop(brush, "use_fixed_texture")
class IMAGE_PT_tools_brush_tool(BrushButtonsPanel, bpy.types.Panel):
diff --git a/release/scripts/ui/space_view3d_toolbar.py b/release/scripts/ui/space_view3d_toolbar.py
index 106cf608554..f849729709f 100644
--- a/release/scripts/ui/space_view3d_toolbar.py
+++ b/release/scripts/ui/space_view3d_toolbar.py
@@ -694,6 +694,8 @@ class VIEW3D_PT_tools_brush_texture(PaintPanel, bpy.types.Panel):
col = layout.column()
col.template_ID_preview(brush, "texture", new="texture.new", rows=3, cols=8)
+ if brush.use_paint_texture:
+ col.prop(brush, "use_fixed_texture")
if context.sculpt_object:
#XXX duplicated from properties_texture.py
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c
index df545741e0e..f4d117d8a07 100644
--- a/source/blender/blenkernel/intern/brush.c
+++ b/source/blender/blenkernel/intern/brush.c
@@ -593,7 +593,7 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
dst[2]= FTOCHAR(rgba[2]);
dst[3]= FTOCHAR(rgba[3]);
}
- else {
+ else if (texfall == 2) {
dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
brush_sample_tex(brush, xy, rgba, 0);
@@ -601,6 +601,14 @@ void brush_imbuf_new(Brush *brush, short flt, short texfall, int bufsize, ImBuf
dst[1] = FTOCHAR(rgba[1]*brush->rgb[1]);
dst[2] = FTOCHAR(rgba[2]*brush->rgb[2]);
dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius));
+ } else {
+ dist = sqrt(xy[0]*xy[0] + xy[1]*xy[1]);
+
+ brush_sample_tex(brush, xy, rgba, 0);
+ dst[0]= crgb[0];
+ dst[1]= crgb[1];
+ dst[2]= crgb[2];
+ dst[3] = FTOCHAR(rgba[3]*alpha*brush_curve_strength_clamp(brush, dist, radius));
}
}
}
@@ -870,11 +878,8 @@ static void brush_painter_refresh_cache(BrushPainter *painter, float *pos)
flt= cache->flt;
size= (cache->size)? cache->size: diameter;
- if (!(mtex && mtex->tex) || (mtex->tex->type==0)) {
- brush_imbuf_new(brush, flt, 0, size, &cache->ibuf);
- }
- else if (brush->flag & BRUSH_FIXED_TEX) {
- brush_imbuf_new(brush, flt, 0, size, &cache->maskibuf);
+ if (brush->flag & BRUSH_FIXED_TEX) {
+ brush_imbuf_new(brush, flt, 3, size, &cache->maskibuf);
brush_painter_fixed_tex_partial_update(painter, pos);
}
else
diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c
index 312283e40fc..06dcaa5441e 100644
--- a/source/blender/makesrna/intern/rna_brush.c
+++ b/source/blender/makesrna/intern/rna_brush.c
@@ -665,11 +665,10 @@ static void rna_def_brush(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Restore Mesh", "Allows a single dot to be carefully positioned");
RNA_def_property_update(prop, 0, "rna_Brush_update");
- /* not exposed in the interface yet
- prop= RNA_def_property(srna, "fixed_tex", PROP_BOOLEAN, PROP_NONE);
+ prop= RNA_def_property(srna, "use_fixed_texture", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flag", BRUSH_FIXED_TEX);
RNA_def_property_ui_text(prop, "Fixed Texture", "Keep texture origin in fixed position");
- RNA_def_property_update(prop, 0, "rna_Brush_update"); */
+ RNA_def_property_update(prop, 0, "rna_Brush_update");
/* only for projection paint, TODO, other paint modes */
prop= RNA_def_property(srna, "use_alpha", PROP_BOOLEAN, PROP_NONE);