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:
authorCody Winchester <CodyWinch>2021-04-29 16:39:08 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-04-29 16:45:03 +0300
commit6a2bc40e0131aa2689aa37a915f672f28fed8aa8 (patch)
tree538c76db2ad71bf19bb58df9e85a130ae51f242e /source/blender/blenkernel/intern/gpencil_geom.c
parent4225a18b35f071ae1ff01c54b475ad396c77febc (diff)
Gpencil Offset Modifier - Add randomize offset options
This patch adds the Randomize options that exist in the Array modifier to the offset modifier. Currently the patch uses ``` BLI_findindex(&gpf->strokes, gps); ``` to get the index of the current stroke for making each stroke a different seed value. This is how the noise modifier also gets the stroke seed value and it is noted there as well that this method is slow, and should be fixed in the future with another method of getting the stroke index. Other methods were explored such as using the total number of points of the stroke, but that makes the randomize options incompatible with other modifiers before it such as Multiple Strokes, Array, Build, and Simplify. {F9591325} Differential Revision: https://developer.blender.org/D10171
Diffstat (limited to 'source/blender/blenkernel/intern/gpencil_geom.c')
-rw-r--r--source/blender/blenkernel/intern/gpencil_geom.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c
index 04403e264a4..612bfe65f34 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.c
+++ b/source/blender/blenkernel/intern/gpencil_geom.c
@@ -1688,6 +1688,7 @@ void BKE_gpencil_stroke_normal(const bGPDstroke *gps, float r_normal[3])
float vec1[3];
float vec2[3];
+ float vec3[3];
/* initial vector (p0 -> p1) */
sub_v3_v3v3(vec1, &pt1->x, &pt0->x);
@@ -1696,7 +1697,8 @@ void BKE_gpencil_stroke_normal(const bGPDstroke *gps, float r_normal[3])
sub_v3_v3v3(vec2, &pt3->x, &pt0->x);
/* vector orthogonal to polygon plane */
- cross_v3_v3v3(r_normal, vec1, vec2);
+ cross_v3_v3v3(vec3, vec1, vec2);
+ cross_v3_v3v3(r_normal, vec1, vec3);
/* Normalize vector */
normalize_v3(r_normal);