diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-03-16 04:12:37 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-03-16 04:12:37 +0300 |
commit | 8522b08e05c31f9fc4b5fee25c64b884593dc180 (patch) | |
tree | 0dd3b66d607ca3e3355d3a9f7311d5088ad28ce3 /source/blender/makesdna | |
parent | 9ad4cd89c2cdee8d8086f7da9d9b35fdec12366a (diff) |
F-Curve Modifiers: Generator Modifier Code
* Rewrote the Generator modifier to be more efficient and support more options
* A few UI tweaks for this, but the UI for this is still not yet functional though.
Diffstat (limited to 'source/blender/makesdna')
-rw-r--r-- | source/blender/makesdna/DNA_anim_types.h | 43 |
1 files changed, 38 insertions, 5 deletions
diff --git a/source/blender/makesdna/DNA_anim_types.h b/source/blender/makesdna/DNA_anim_types.h index 3ce656faf92..f51300e5f7b 100644 --- a/source/blender/makesdna/DNA_anim_types.h +++ b/source/blender/makesdna/DNA_anim_types.h @@ -69,21 +69,37 @@ typedef struct FMod_Generator { /* generator based on PyExpression */ char expression[256]; /* python expression to use as generator */ - /* simple polynomial generator (y = C[0]*(x^(n)) + C[1]*(x^(n-1)) + ... C[n]) */ - float *poly_coefficients; /* array of the coefficients for the polynomial (poly_order + 1 items long) */ - unsigned int poly_order; /* order of the polynomial (i.e. 1 for linear, 2 for quadratic) */ + /* general generator information */ + float *coefficients; /* coefficients array */ + unsigned int arraysize; /* size of the coefficients array */ + + unsigned 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; /* settings */ short flag; /* settings */ - short mode; /* which 'generator' to use */ + short mode; /* which 'generator' to use eFMod_Generator_Modes */ } FMod_Generator; /* generator modes */ enum { FCM_GENERATOR_POLYNOMIAL = 0, + FCM_GENERATOR_POLYNOMIAL_FACTORISED, + FCM_GENERATOR_FUNCTION, FCM_GENERATOR_EXPRESSION, } eFMod_Generator_Modes; +/* 'function' generator types */ +enum { + FCM_GENERATOR_FN_SIN = 0, + FCM_GENERATOR_FN_COS, + FCM_GENERATOR_FN_TAN, + FCM_GENERATOR_FN_SQRT, + FCM_GENERATOR_FN_LN, +} eFMod_Generator_Functions; + /* envelope modifier - envelope data */ typedef struct FCM_EnvelopeData { @@ -444,7 +460,6 @@ enum { * be generic (using various placeholder template tags that will be * replaced with appropriate information from the context). */ -// TODO: how should templates work exactly? For now, we only implement the specific KeyingSets... typedef struct KS_Path { struct KS_Path *next, *prev; @@ -452,6 +467,10 @@ typedef struct KS_Path { ID *id; /* ID block that keyframes are for */ char group[64]; /* name of the group to add to */ + /* relative paths only */ + int idtype; /* ID-type that path can be used on */ + int templates; /* Templates that will be encountered in the path (as set of bitflags) */ + /* all paths */ char *rna_path; /* dynamically (or statically in the case of predefined sets) path */ int array_index; /* index that path affects */ @@ -476,6 +495,20 @@ enum { KSP_GROUP_KSNAME, } eKSP_Grouping; +/* KS_Path->templates (Template Flags) + * + * Templates in paths are used to substitute information from the + * active context into relavent places in the path strings. This + * enum here defines the flags which define which templates are + * required by a path before it can be used + */ +enum { + KSP_TEMPLATE_OBJECT = (1<<0), /* #obj - selected object */ + KSP_TEMPLATE_PCHAN = (1<<1), /* #pch - selected posechannel */ + KSP_TEMPLATE_CONSTRAINT = (1<<2), /* #con - active only */ + KSP_TEMPLATE_NODE = (1<<3), /* #nod - selected node */ +} eKSP_TemplateTypes; + /* ---------------- */ /* KeyingSet definition (ks) |