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:
authorJoshua Leung <aligorith@gmail.com>2009-07-02 06:12:37 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-02 06:12:37 +0400
commit1588de008a7c9c80d193034c0f8b4dc766620a38 (patch)
tree6283229555be564f8f0820d4ed817920cdedb58b /source/blender/makesdna/DNA_anim_types.h
parentede921fdfac1c76b8c54cae1723fbe9efd891939 (diff)
NLA SoC: Separated 'Built-In Function Generator' FModifier into a separate FModifier
Started cleaning up FModifiers in preparation for allowing them to be used on NLA Strips. This commit separates the 'Built-in Function' mode for the Generator modifier out into its own modifier, since it was being quite frequently used (and the RNA wrapping for this used to be quite hackish). BACKWARDS COMPATABILITY WARNING: Old files with FModifiers saved (i.e. old 2.5 files, but not any others) will not load correctly as a result of these changes (the wrong modifiers will be shown). I've decided that there are not likely to be many files affected by this yet, but doing this will result in a much nicer modifiers-define list in the long run.
Diffstat (limited to 'source/blender/makesdna/DNA_anim_types.h')
-rw-r--r--source/blender/makesdna/DNA_anim_types.h45
1 files changed, 31 insertions, 14 deletions
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h
index 2b089530236..ad3edde6552 100644
--- a/source/blender/makesdna/DNA_anim_types.h
+++ b/source/blender/makesdna/DNA_anim_types.h
@@ -1,5 +1,5 @@
/**
- * $Id: DNA_anim_types.h 21023 2009-06-20 04:02:49Z aligorith $
+ * $Id$
*
* ***** BEGIN GPL LICENSE BLOCK *****
*
@@ -66,6 +66,7 @@ typedef struct FModifier {
enum {
FMODIFIER_TYPE_NULL = 0,
FMODIFIER_TYPE_GENERATOR,
+ FMODIFIER_TYPE_FN_GENERATOR,
FMODIFIER_TYPE_ENVELOPE,
FMODIFIER_TYPE_CYCLES,
FMODIFIER_TYPE_NOISE, /* unimplemented - generate variations using some basic noise generator... */
@@ -91,39 +92,55 @@ enum {
/* --- */
-/* generator modifier data */
+/* Generator modifier data */
typedef struct FMod_Generator {
- /* generator based on PyExpression */
- char expression[256]; /* python expression to use as generator */
-
/* general generator information */
float *coefficients; /* coefficients array */
unsigned int arraysize; /* size of the coefficients array */
- short poly_order; /* order of polynomial generated (i.e. 1 for linear, 2 for quadratic) */
- short func_type; /* builtin math function eFMod_Generator_Functions */
-
- int pad;
+ int poly_order; /* order of polynomial generated (i.e. 1 for linear, 2 for quadratic) */
+ int mode; /* which 'generator' to use eFMod_Generator_Modes */
/* settings */
- short flag; /* settings */
- short mode; /* which 'generator' to use eFMod_Generator_Modes */
+ int flag; /* settings */
} FMod_Generator;
/* generator modes */
enum {
FCM_GENERATOR_POLYNOMIAL = 0,
FCM_GENERATOR_POLYNOMIAL_FACTORISED,
- FCM_GENERATOR_FUNCTION,
- FCM_GENERATOR_EXPRESSION,
} eFMod_Generator_Modes;
-/* generator flags */
+
+/* generator flags
+ * - shared by Generator and Function Generator
+ */
enum {
/* generator works in conjunction with other modifiers (i.e. doesn't replace those before it) */
FCM_GENERATOR_ADDITIVE = (1<<0),
} eFMod_Generator_Flags;
+
+/* 'Built-In Function' Generator modifier data
+ *
+ * This uses the general equation for equations:
+ * y = amplitude * fn(phase_multiplier*x + phase_offset) + y_offset
+ *
+ * where amplitude, phase_multiplier/offset, y_offset are user-defined coefficients,
+ * x is the evaluation 'time', and 'y' is the resultant value
+ */
+typedef struct FMod_FunctionGenerator {
+ /* coefficients for general equation (as above) */
+ float amplitude;
+ float phase_multiplier;
+ float phase_offset;
+ float value_offset;
+
+ /* flags */
+ int type; /* eFMod_Generator_Functions */
+ int flag; /* eFMod_Generator_flags */
+} FMod_FunctionGenerator;
+
/* 'function' generator types */
enum {
FCM_GENERATOR_FN_SIN = 0,