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:
authorTon Roosendaal <ton@blender.org>2005-10-10 21:42:48 +0400
committerTon Roosendaal <ton@blender.org>2005-10-10 21:42:48 +0400
commit87365d8d407d5cfddcfa48f1dc3902f7f1a3fa5b (patch)
treea43ae94a544511409f44b9d08e828a6eedfcf123 /source/blender/src/editkey.c
parentad915277a0d7be10889cf8d00ce392b4800ca0d5 (diff)
Stage two of the giant animation recode project; Ipo/Action/NLA cleanup
-> Note; added 2 new c files (split editipo.c). MSVC needs upgrade. Impatient people can check the goodies in CMS: http://www.blender3d.org/cms/Action_and_NLA_editor.706.0.html Most work was on trying to unwind the spaghetti for editing ipos. Too much history and bad design got added here. Most evident changes: - made generic 'context' for detecting which Ipo is being edited, or to assign ipos or to retrieve ipo curves. - made generic insertkey() for all ipo types, including actions - shuffled a lot of code around to make things more logical. Also made sure local functions are not exported It is far from ready... when action/nla was added in Blender, a lot of duplicate code was generated. That's for another time. Now the goodies; - made Actions to allow any Ipo type - made NLA to define active actions, for Action window too - corrected timing for active action, so it shows the 'real time', as defined in NLA editor. I did update python code, but that would require testing. Testing is needed for this commit in general, too many changes happened on all levels of the animation system. :) Will keep track of all reports this evening, hopefully it doesnt break the pre-release schedule!
Diffstat (limited to 'source/blender/src/editkey.c')
-rw-r--r--source/blender/src/editkey.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/src/editkey.c b/source/blender/src/editkey.c
index 345c48d789f..2262d3298cf 100644
--- a/source/blender/src/editkey.c
+++ b/source/blender/src/editkey.c
@@ -96,18 +96,20 @@ float meshslidervals[64] = {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};
-static IpoCurve *get_key_icu(Key *key, int keynum) {
+static IpoCurve *get_key_icu(Key *key, int keynum)
+{
/* return the Ipocurve that has the specified
* keynum as ardcode -- return NULL if no such
* curve exists.
*/
IpoCurve *icu;
+
+ /* why this? (ton) */
if (!(key->ipo)) {
- key->ipo = get_ipo((ID *)key, ID_KE, 1);
+ key->ipo= add_ipo("KeyIpo", ID_KE);
return NULL;
}
-
for (icu = key->ipo->curve.first; icu ; icu = icu->next) {
if (!icu->adrcode) continue;
if (icu->adrcode == keynum) return icu;
@@ -158,7 +160,7 @@ static void rvk_slider_func(void *voidkey, void *voidkeynum)
cfra = frame_to_float(CFRA);
- icu = get_key_icu(key, keynum);
+ icu = verify_ipocurve(&key->id, ID_KE, NULL, NULL, keynum);
if (icu) {
/* if the ipocurve exists, try to get a bezier
@@ -166,12 +168,6 @@ static void rvk_slider_func(void *voidkey, void *voidkeynum)
*/
bezt = get_bezt_icu_time(icu, &cfra, &rvkval);
}
- else {
- /* create an IpoCurve if one doesn't already
- * exist.
- */
- icu = get_ipocurve(key->from, GS(key->from->name), keynum, key->ipo);
- }
/* create the bezier triple if one doesn't exist,
* otherwise modify it's value