[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21228] branches/soc-2009-aligorith/source /blender: NLA SoC: Lines are now drawn on action-clip strips for indicating the timing of repeats
Joshua Leung
aligorith at gmail.com
Mon Jun 29 03:00:37 CEST 2009
Revision: 21228
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=21228
Author: aligorith
Date: 2009-06-29 03:00:35 +0200 (Mon, 29 Jun 2009)
Log Message:
-----------
NLA SoC: Lines are now drawn on action-clip strips for indicating the timing of repeats
Modified Paths:
--------------
branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
branches/soc-2009-aligorith/source/blender/makesrna/intern/rna_nla.c
Modified: branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c 2009-06-28 23:18:30 UTC (rev 21227)
+++ branches/soc-2009-aligorith/source/blender/editors/space_nla/nla_draw.c 2009-06-29 01:00:35 UTC (rev 21228)
@@ -293,6 +293,23 @@
/* 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);
}
Modified: branches/soc-2009-aligorith/source/blender/makesrna/intern/rna_nla.c
===================================================================
--- branches/soc-2009-aligorith/source/blender/makesrna/intern/rna_nla.c 2009-06-28 23:18:30 UTC (rev 21227)
+++ branches/soc-2009-aligorith/source/blender/makesrna/intern/rna_nla.c 2009-06-29 01:00:35 UTC (rev 21228)
@@ -288,7 +288,7 @@
RNA_def_property_float_sdna(prop, NULL, "repeat");
RNA_def_property_float_funcs(prop, NULL, "rna_NlaStrip_repeat_set", NULL);
RNA_def_property_range(prop, 0.1f, 1000.0f); /* these limits have currently be chosen arbitarily, but could be extended (minimum should still be > 0 though) if needed... */
- RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the ");
+ RNA_def_property_ui_text(prop, "Repeat", "Number of times to repeat the action range.");
prop= RNA_def_property(srna, "scale", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "scale");
More information about the Bf-blender-cvs
mailing list