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
path: root/source
diff options
context:
space:
mode:
authorAntony Riakiotakis <kalast@gmail.com>2014-09-26 16:13:32 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2014-10-03 17:09:26 +0400
commit359dd9b7b76c204a1fb3497c061ed0bd1ee8e6f1 (patch)
tree03486ef75a81980162d328b6e36d9111b4cb78c0 /source
parent7af5bd0b3a5663049105e28b516ca97a37614c80 (diff)
Fix T41956, Soften brush does not work
Disallow blur radius zero (versioning error). Also fix gaussian distibution for blurring This is to be included in the final release.
Diffstat (limited to 'source')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image.c b/source/blender/editors/sculpt_paint/paint_image.c
index 0e3592f59ee..87866f764bc 100644
--- a/source/blender/editors/sculpt_paint/paint_image.c
+++ b/source/blender/editors/sculpt_paint/paint_image.c
@@ -527,8 +527,11 @@ BlurKernel *paint_new_blur_kernel(Brush *br, bool proj)
kernel->pixel_len = radius;
}
else {
- radius = br->blur_kernel_radius;
+ if (br->blur_kernel_radius <= 0)
+ br->blur_kernel_radius = 1;
+ radius = br->blur_kernel_radius;
+
side = kernel->side = radius * 2 + 1;
kernel->side_squared = kernel->side * kernel->side;
kernel->wdata = MEM_mallocN(sizeof(float) * kernel->side_squared, "blur kernel data");
@@ -543,11 +546,11 @@ BlurKernel *paint_new_blur_kernel(Brush *br, bool proj)
case KERNEL_GAUSSIAN:
{
- /* at standard deviation of 3.0 kernel is at about zero */
+ /* at 3.0 standard deviations distance, kernel is about zero */
float standard_dev = radius / 3.0f;
/* make the necessary adjustment to the value for use in the normal distribution formula */
- standard_dev = standard_dev * standard_dev * 2;
+ standard_dev = -standard_dev * standard_dev * 2;
for (i = 0; i < side; i++) {
for (j = 0; j < side; j++) {