From d89a8c34f3dc1a2923b6853c260de4f1deab9466 Mon Sep 17 00:00:00 2001 From: Joshua Leung Date: Fri, 19 Mar 2010 03:38:14 +0000 Subject: More F-Modifier Tweaks: This commit started out aiming to make the "Stepped" F-Modifier (committed last night) even more useful, but ended up fixing a few other finer-points of how F-Modifiers work. Firstly, the new stuff: I've addded options to the Stepped F-Modifier to not affect frames before and/or after specified values, and renamed the 'start offset' to 'offset' for clarity. The main objective of this is to allow Stepped F-Modifiers to only affect certain time ranges, so that by layering/using multiple instances of the F-Modifier, it can be possible to have multiple stepping-sizes. This allows for effects like: http://www.pasteall.org/blend/2230 or in words, it provides a convenient mechanism for animators to specify whether sections of the animation is shown "on twos", "fours", or even "forty-second-ths plus a smidgen", as can be easily done with 2D. Assorted changes to support this: * Properly fixed up how F-Modifiers that work with time, evaluate the time to evaluate the curve at. Now layered time effects like this should be possible in a much nicer way. * Added proper value range validation/clamping to many properties. There are still a lot more that need checking, but at least more properties now do "the right thing". --- source/blender/makesdna/DNA_anim_types.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'source/blender/makesdna') diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 44727218f4f..83f68758da9 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -236,9 +236,20 @@ typedef enum eFMod_Noise_Modifications { /* stepped modifier data */ typedef struct FMod_Stepped { float step_size; /* Number of frames each interpolated value should be held */ - float start; /* Reference frame number that stepping starts from */ + float offset; /* Reference frame number that stepping starts from */ + + float start_frame; /* start frame of the frame range that modifier works in */ + float end_frame; /* end frame of the frame range that modifier works in */ + + int flag; /* various settings */ } FMod_Stepped; +/* stepped modifier range flags */ +typedef enum eFMod_Stepped_Flags { + FCM_STEPPED_NO_BEFORE = (1<<0), /* don't affect frames before the start frame */ + FCM_STEPPED_NO_AFTER = (1<<1), /* don't affect frames after the end frame */ +} eFMod_Stepped_Flags; + /* Drivers -------------------------------------- */ /* Driver Target (dtar) -- cgit v1.2.3