[Bf-blender-cvs] [d844271aef2] master: GP: Use weight in noise modifier for all types

Antonioya noreply at git.blender.org
Tue Jan 15 20:24:19 CET 2019


Commit: d844271aef2d4bfbe0177918ee6c993d6ed9e1c3
Author: Antonioya
Date:   Tue Jan 15 20:24:07 2019 +0100
Branches: master
https://developer.blender.org/rBd844271aef2d4bfbe0177918ee6c993d6ed9e1c3

GP: Use weight in noise modifier for all types

The weight was used only for position.

===================================================================

M	source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c

===================================================================

diff --git a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
index 722cf861fb1..7a9a3efbd95 100644
--- a/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
+++ b/source/blender/gpencil_modifiers/intern/MOD_gpencilnoise.c
@@ -219,10 +219,10 @@ static void deformStroke(
 		/* apply randomness to thickness */
 		if (mmd->flag & GP_NOISE_MOD_THICKNESS) {
 			if (vdir > 0.5f) {
-				pt1->pressure -= pt1->pressure * vran * mmd->factor;
+				pt1->pressure -= pt1->pressure * vran * mmd->factor * weight;
 			}
 			else {
-				pt1->pressure += pt1->pressure * vran * mmd->factor;
+				pt1->pressure += pt1->pressure * vran * mmd->factor * weight;
 			}
 			CLAMP_MIN(pt1->pressure, GPENCIL_STRENGTH_MIN);
 		}
@@ -230,20 +230,20 @@ static void deformStroke(
 		/* apply randomness to color strength */
 		if (mmd->flag & GP_NOISE_MOD_STRENGTH) {
 			if (vdir > 0.5f) {
-				pt1->strength -= pt1->strength * vran * mmd->factor;
+				pt1->strength -= pt1->strength * vran * mmd->factor * weight;
 			}
 			else {
-				pt1->strength += pt1->strength * vran * mmd->factor;
+				pt1->strength += pt1->strength * vran * mmd->factor * weight;
 			}
 			CLAMP_MIN(pt1->strength, GPENCIL_STRENGTH_MIN);
 		}
 		/* apply randomness to uv rotation */
 		if (mmd->flag & GP_NOISE_MOD_UV) {
 			if (vdir > 0.5f) {
-				pt1->uv_rot -= pt1->uv_rot * vran * mmd->factor;
+				pt1->uv_rot -= pt1->uv_rot * vran * mmd->factor * weight;
 			}
 			else {
-				pt1->uv_rot += pt1->uv_rot * vran * mmd->factor;
+				pt1->uv_rot += pt1->uv_rot * vran * mmd->factor * weight;
 			}
 			CLAMP(pt1->uv_rot, -M_PI_2, M_PI_2);
 		}



More information about the Bf-blender-cvs mailing list