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-06-29 05:00:35 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-29 05:00:35 +0400
commit26c7c01c32957f17a3f6cffb52975eddc7cd40f1 (patch)
tree26a637c4212a51d551fdde77a7467a4d7b03ff25 /source/blender/editors/space_nla/nla_draw.c
parentaa4ed13e4a216a3464f7b9d6643c195927aea98a (diff)
NLA SoC: Lines are now drawn on action-clip strips for indicating the timing of repeats
Diffstat (limited to 'source/blender/editors/space_nla/nla_draw.c')
-rw-r--r--source/blender/editors/space_nla/nla_draw.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c
index 51c1960c4c6..6d4f65fe249 100644
--- a/source/blender/editors/space_nla/nla_draw.c
+++ b/source/blender/editors/space_nla/nla_draw.c
@@ -293,6 +293,23 @@ static void nla_draw_strip (AnimData *adt, NlaTrack *nlt, NlaStrip *strip, View2
/* draw outline */
gl_round_box_shade(GL_LINE_LOOP, strip->start, yminc, strip->end, ymaxc, 0.0, 0.0, 0.1);
+ /* if action-clip strip, draw lines delimiting repeats too (in the same colour */
+ if ((strip->type == NLASTRIP_TYPE_CLIP) && IS_EQ(strip->repeat, 1.0f)==0) {
+ float repeatLen = (strip->actend - strip->actstart) * strip->scale;
+ int i;
+
+ /* only draw lines for whole-numbered repeats, starting from the first full-repeat
+ * up to the last full repeat (but not if it lies on the end of the strip)
+ */
+ for (i = 1; i < strip->repeat; i++) {
+ float repeatPos = strip->start + (repeatLen * i);
+
+ /* don't draw if line would end up on or after the end of the strip */
+ if (repeatPos < strip->end)
+ fdrawline(repeatPos, yminc, repeatPos, ymaxc);
+ }
+ }
+
/* reset linestyle */
setlinestyle(0);
}