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-09 05:04:42 +0400
committerJoshua Leung <aligorith@gmail.com>2009-07-09 05:04:42 +0400
commit518911e78c2ae4511cbb9261c5cca410c0a77d73 (patch)
tree432f6c48fa99ebd19db9ea7df9e56846cf44ccbe /source/blender/blenkernel
parent5f5ddb00146884d28414811bc92311af56d55904 (diff)
NLA SoC: Assorted cleanups
* Some cleanups aimed at giving some (neglible) speedups * Preparation for NLA-Strip keyframes to be editable
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_nla.h2
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c8
-rw-r--r--source/blender/blenkernel/intern/nla.c41
3 files changed, 47 insertions, 4 deletions
diff --git a/source/blender/blenkernel/BKE_nla.h b/source/blender/blenkernel/BKE_nla.h
index 7fdff7e41f7..04d4b0f8da2 100644
--- a/source/blender/blenkernel/BKE_nla.h
+++ b/source/blender/blenkernel/BKE_nla.h
@@ -83,6 +83,8 @@ struct NlaStrip *BKE_nlastrip_find_active(struct NlaTrack *nlt);
short BKE_nlastrip_within_bounds(struct NlaStrip *strip, float min, float max);
+short BKE_nlatrack_has_animated_strips(struct NlaTrack *nlt);
+short BKE_nlatracks_have_animated_strips(ListBase *tracks);
void BKE_nlastrip_validate_fcurves(struct NlaStrip *strip);
/* ............ */
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 1037b2fd15d..ebe3d28cb21 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -392,10 +392,10 @@ void BKE_keyingsets_free (ListBase *list)
short animsys_remap_path (AnimMapper *remap, char *path, char **dst)
{
/* is there a valid remapping table to use? */
- if (remap) {
+ //if (remap) {
/* find a matching entry... to use to remap */
// ...TODO...
- }
+ //}
/* nothing suitable found, so just set dst to look at path (i.e. no alloc/free needed) */
*dst= path;
@@ -521,7 +521,6 @@ static void animsys_evaluate_drivers (PointerRNA *ptr, AnimData *adt, float ctim
short ok= 0;
/* check if this driver's curve should be skipped */
- // FIXME: maybe we shouldn't check for muted, though that would make things more confusing, as there's already too many ways to disable?
if ((fcu->flag & (FCURVE_MUTED|FCURVE_DISABLED)) == 0)
{
/* check if driver itself is tagged for recalculation */
@@ -1185,6 +1184,9 @@ static void animsys_evaluate_nla (PointerRNA *ptr, AnimData *adt, float ctime)
ListBase echannels= {NULL, NULL};
NlaEvalStrip *nes;
+ // TODO: need to zero out all channels used, otherwise we have problems with threadsafety
+ // and also when the user jumps between different times instead of moving sequentially...
+
/* 1. get the stack of strips to evaluate at current time (influence calculated here) */
for (nlt=adt->nla_tracks.first; nlt; nlt=nlt->next, track_index++) {
/* if tweaking is on and this strip is the tweaking track, stop on this one */
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 217444d16d2..c697f639021 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -926,7 +926,6 @@ void BKE_nlatrack_set_active (ListBase *tracks, NlaTrack *nlt_a)
nlt_a->flag |= NLATRACK_ACTIVE;
}
-
/* Check if there is any space in the given track to add a strip of the given length */
short BKE_nlatrack_has_space (NlaTrack *nlt, float start, float end)
{
@@ -1050,6 +1049,46 @@ short nlastrip_is_first (AnimData *adt, NlaStrip *strip)
return 1;
}
+/* Animated Strips ------------------------------------------- */
+
+/* Check if the given NLA-Track has any strips with own F-Curves */
+short BKE_nlatrack_has_animated_strips (NlaTrack *nlt)
+{
+ NlaStrip *strip;
+
+ /* sanity checks */
+ if ELEM(NULL, nlt, nlt->strips.first)
+ return 0;
+
+ /* check each strip for F-Curves only (don't care about whether the flags are set) */
+ for (strip= nlt->strips.first; strip; strip= strip->next) {
+ if (strip->fcurves.first)
+ return 1;
+ }
+
+ /* none found */
+ return 0;
+}
+
+/* Check if given NLA-Tracks have any strips with own F-Curves */
+short BKE_nlatracks_have_animated_strips (ListBase *tracks)
+{
+ NlaTrack *nlt;
+
+ /* sanity checks */
+ if ELEM(NULL, tracks, tracks->first)
+ return 0;
+
+ /* check each track, stopping on the first hit */
+ for (nlt= tracks->first; nlt; nlt= nlt->next) {
+ if (BKE_nlatrack_has_animated_strips(nlt))
+ return 1;
+ }
+
+ /* none found */
+ return 0;
+}
+
/* Validate the NLA-Strips 'control' F-Curves based on the flags set*/
void BKE_nlastrip_validate_fcurves (NlaStrip *strip)
{