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>2010-04-01 10:26:41 +0400
committerJoshua Leung <aligorith@gmail.com>2010-04-01 10:26:41 +0400
commitc46a955ee0e13d812780f8afe78a6a9c34bb84fa (patch)
tree30d4dbcfc9eb107c71235087151ed1dd56b4306b /source/blender/blenkernel/intern/nla.c
parentceebd182ed2e3310d6b65fa73574b941156aa1b0 (diff)
Assorted animsys fixes/tweaks:
* Fixed all the dangerous code added in 27907. Using the code there, scripters could corrupt animation files in ways which would render them useless, with channels not appearing in any animation editors, and others not getting evaluated at all. * Partial fix of bug 21818, by disabling destructive replacement of keyframes. Will followup this commit with a more comprehensive commit which gets rid of the rest of the problems, by incorporating some requests from Durian team. * Fixed problems with users being able to see+edit the name of the active Keying Set in the Scene buttons. There is still a bug though with the list widget given how the indices are now interpreted...
Diffstat (limited to 'source/blender/blenkernel/intern/nla.c')
-rw-r--r--source/blender/blenkernel/intern/nla.c61
1 files changed, 60 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 4af007a5f91..4b6a3a7e8e4 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -39,10 +39,12 @@
#include "BLI_ghash.h"
#include "DNA_anim_types.h"
+#include "DNA_scene_types.h"
#include "BKE_action.h"
#include "BKE_fcurve.h"
#include "BKE_nla.h"
+#include "BKE_global.h"
#include "BKE_library.h"
#include "BKE_utildefines.h"
@@ -956,6 +958,35 @@ short BKE_nlatrack_add_strip (NlaTrack *nlt, NlaStrip *strip)
return BKE_nlastrips_add_strip(&nlt->strips, strip);
}
+/* Get the extents of the given NLA-Track including gaps between strips,
+ * returning whether this succeeded or not
+ */
+short BKE_nlatrack_get_bounds (NlaTrack *nlt, float bounds[2])
+{
+ NlaStrip *strip;
+
+ /* initialise bounds */
+ if (bounds)
+ bounds[0] = bounds[1] = 0.0f;
+ else
+ return 0;
+
+ /* sanity checks */
+ if ELEM(NULL, nlt, nlt->strips.first)
+ return 0;
+
+ /* lower bound is first strip's start frame */
+ strip = nlt->strips.first;
+ bounds[0] = strip->start;
+
+ /* upper bound is last strip's end frame */
+ strip = nlt->strips.last;
+ bounds[1] = strip->end;
+
+ /* done */
+ return 1;
+}
+
/* NLA Strips -------------------------------------- */
/* Find the active NLA-strip within the given track */
@@ -1474,7 +1505,10 @@ short BKE_nla_tweakmode_enter (AnimData *adt)
}
}
if ELEM3(NULL, activeTrack, activeStrip, activeStrip->act) {
- printf("NLA tweakmode enter - neither active requirement found \n");
+ if (G.f & G_DEBUG) {
+ printf("NLA tweakmode enter - neither active requirement found \n");
+ printf("\tactiveTrack = %p, activeStrip = %p \n", activeTrack, activeStrip);
+ }
return 0;
}
@@ -1553,4 +1587,29 @@ void BKE_nla_tweakmode_exit (AnimData *adt)
adt->flag &= ~ADT_NLA_EDIT_ON;
}
+/* Baking Tools ------------------------------------------- */
+
+void BKE_nla_bake (Scene *scene, ID *id, AnimData *adt, int flag)
+{
+
+ /* verify that data is valid
+ * 1) Scene and AnimData must be provided
+ * 2) there must be tracks to merge...
+ */
+ if ELEM3(NULL, scene, adt, adt->nla_tracks.first)
+ return;
+
+ /* if animdata currently has an action, 'push down' this onto the stack first */
+ if (adt->action)
+ BKE_nla_action_pushdown(adt);
+
+ /* get range of motion to bake, and the channels involved... */
+
+ /* temporarily mute the action, and start keying to it */
+
+ /* start keying... */
+
+ /* unmute the action */
+}
+
/* *************************************************** */