From 80123efc5fc258ef8b27efba67d6ad2a0efb7edd Mon Sep 17 00:00:00 2001 From: Antonioya Date: Thu, 1 Aug 2019 17:54:51 +0200 Subject: Fix T67939: GPencil Noise modifier wrong random calculation There were several problems in the old random calculation: * Different result in the viewport and render. * Noise "pop" in some frames. * Random number was calculated every time the file was opened, so get different results. Now, instead to calculate the random numbers when n number of frames changed, the random values are calculated using a unique seed by stroke. Also, a new Seed parameter has been added and this adds more control in the noise generated. This value can be animated and get more variations. Differential Revision: http://developer.blender.org/D5393 --- source/blender/makesdna/DNA_gpencil_modifier_types.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_gpencil_modifier_types.h b/source/blender/makesdna/DNA_gpencil_modifier_types.h index c2a9d3cf296..47347753f42 100644 --- a/source/blender/makesdna/DNA_gpencil_modifier_types.h +++ b/source/blender/makesdna/DNA_gpencil_modifier_types.h @@ -90,16 +90,10 @@ typedef struct NoiseGpencilModifierData { float factor; /** How many frames before recalculate randoms. */ int step; - /** Last gp frame used. */ - int gp_frame; - /** First scene frame used. */ - int scene_frame; - /** Random values. */ - float vrand1, vrand2; - struct RNG *rng; /** Custom index for passes. */ int layer_pass; - char _pad[4]; + /** Random seed */ + int seed; } NoiseGpencilModifierData; typedef enum eNoiseGpencil_Flag { -- cgit v1.2.3