[Bf-blender-cvs] [6957967e992] greasepencil-object: Apply weight only for loc/rot

Antonio Vazquez noreply at git.blender.org
Sat Dec 9 22:53:06 CET 2017


Commit: 6957967e99230363e30c678add163b2f3707aaee
Author: Antonio Vazquez
Date:   Sat Dec 9 22:52:57 2017 +0100
Branches: greasepencil-object
https://developer.blender.org/rB6957967e99230363e30c678add163b2f3707aaee

Apply weight only for loc/rot

The weight cannot be used for scale.

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

M	source/blender/modifiers/intern/MOD_gpenciloffset.c

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

diff --git a/source/blender/modifiers/intern/MOD_gpenciloffset.c b/source/blender/modifiers/intern/MOD_gpenciloffset.c
index d71823fa540..6842a371474 100644
--- a/source/blender/modifiers/intern/MOD_gpenciloffset.c
+++ b/source/blender/modifiers/intern/MOD_gpenciloffset.c
@@ -71,6 +71,7 @@ static void deformStroke(ModifierData *md, const EvaluationContext *UNUSED(eval_
 	int vindex = defgroup_name_index(ob, mmd->vgname);
 	
 	float mat[4][4];
+	float loc[3], rot[3];
 
 	if (!is_stroke_affected_by_modifier(
 	        mmd->layername, mmd->pass_index, 1, gpl, gps,
@@ -87,8 +88,10 @@ static void deformStroke(ModifierData *md, const EvaluationContext *UNUSED(eval_
 		if (weight < 0) {
 			continue;
 		}
-		/* calculate matrix (weight value cannot be used or get weird result */
-		loc_eul_size_to_mat4(mat, mmd->loc, mmd->rot, mmd->scale);
+		/* calculate matrix (weight value cannot be used in scale) */
+		mul_v3_v3fl(loc, mmd->loc, weight);
+		mul_v3_v3fl(rot, mmd->rot, weight);
+		loc_eul_size_to_mat4(mat, loc, rot, mmd->scale);
 
 		mul_m4_v3(mat, &pt->x);
 	}



More information about the Bf-blender-cvs mailing list