[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27574] branches/render25/source/blender: option for cyclic time adjustment for nla strips, needed for adjusting the speed of flapping wings
Campbell Barton
ideasman42 at gmail.com
Wed Mar 17 17:02:30 CET 2010
Revision: 27574
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27574
Author: campbellbarton
Date: 2010-03-17 17:02:29 +0100 (Wed, 17 Mar 2010)
Log Message:
-----------
option for cyclic time adjustment for nla strips, needed for adjusting the speed of flapping wings
Modified Paths:
--------------
branches/render25/source/blender/blenkernel/intern/anim_sys.c
branches/render25/source/blender/editors/render/render_shading.c
branches/render25/source/blender/editors/space_nla/nla_buttons.c
branches/render25/source/blender/makesdna/DNA_anim_types.h
branches/render25/source/blender/makesrna/intern/rna_nla.c
Modified: branches/render25/source/blender/blenkernel/intern/anim_sys.c
===================================================================
--- branches/render25/source/blender/blenkernel/intern/anim_sys.c 2010-03-17 11:34:27 UTC (rev 27573)
+++ branches/render25/source/blender/blenkernel/intern/anim_sys.c 2010-03-17 16:02:29 UTC (rev 27574)
@@ -995,6 +995,9 @@
/* execute these settings as per normal */
animsys_evaluate_fcurves(&strip_ptr, &strip->fcurves, NULL, ctime);
}
+
+ if (strip->flag & NLASTRIP_FLAG_USR_TIME && strip->flag & NLASTRIP_FLAG_USR_TIME_CYCLIC)
+ strip->strip_time= fmod(strip->strip_time - strip->actstart, strip->actend - strip->actstart);
}
/* gets the strip active at the current time for a list of strips for evaluation purposes */
Modified: branches/render25/source/blender/editors/render/render_shading.c
===================================================================
--- branches/render25/source/blender/editors/render/render_shading.c 2010-03-17 11:34:27 UTC (rev 27573)
+++ branches/render25/source/blender/editors/render/render_shading.c 2010-03-17 16:02:29 UTC (rev 27574)
@@ -40,6 +40,7 @@
#include "DNA_space_types.h"
#include "DNA_world_types.h"
+#include "BKE_animsys.h"
#include "BKE_context.h"
#include "BKE_depsgraph.h"
#include "BKE_font.h"
Modified: branches/render25/source/blender/editors/space_nla/nla_buttons.c
===================================================================
--- branches/render25/source/blender/editors/space_nla/nla_buttons.c 2010-03-17 11:34:27 UTC (rev 27573)
+++ branches/render25/source/blender/editors/space_nla/nla_buttons.c 2010-03-17 16:02:29 UTC (rev 27574)
@@ -379,7 +379,7 @@
{
PointerRNA strip_ptr;
uiLayout *layout= pa->layout;
- uiLayout *column, *subcolumn;
+ uiLayout *column, *subcolumn, *subrow;
uiBlock *block;
/* check context and also validity of pointer */
@@ -398,10 +398,13 @@
column= uiLayoutColumn(layout, 1);
- uiItemR(column, NULL, 0, &strip_ptr, "animated_time", 0);
-
+ subrow= uiLayoutRow(column, 0);
+ uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time", 0);
+ uiItemR(subrow, NULL, 0, &strip_ptr, "animated_time_cyclic", 0);
+
subcolumn= uiLayoutColumn(column, 1);
- uiLayoutSetEnabled(subcolumn, RNA_boolean_get(&strip_ptr, "animated_time"));
+ subrow= uiLayoutRow(subcolumn, 0);
+ uiLayoutSetEnabled(subrow, RNA_boolean_get(&strip_ptr, "animated_time"));
uiItemR(subcolumn, NULL, 0, &strip_ptr, "strip_time", 0);
}
Modified: branches/render25/source/blender/makesdna/DNA_anim_types.h
===================================================================
--- branches/render25/source/blender/makesdna/DNA_anim_types.h 2010-03-17 11:34:27 UTC (rev 27573)
+++ branches/render25/source/blender/makesdna/DNA_anim_types.h 2010-03-17 16:02:29 UTC (rev 27574)
@@ -581,6 +581,7 @@
/* strip influence is controlled by local F-Curve */
NLASTRIP_FLAG_USR_INFLUENCE = (1<<5),
NLASTRIP_FLAG_USR_TIME = (1<<6),
+ NLASTRIP_FLAG_USR_TIME_CYCLIC = (1<<7),
/* NLA strip length is synced to the length of the referenced action */
NLASTRIP_FLAG_SYNC_LENGTH = (1<<9),
Modified: branches/render25/source/blender/makesrna/intern/rna_nla.c
===================================================================
--- branches/render25/source/blender/makesrna/intern/rna_nla.c 2010-03-17 11:34:27 UTC (rev 27573)
+++ branches/render25/source/blender/makesrna/intern/rna_nla.c 2010-03-17 16:02:29 UTC (rev 27574)
@@ -411,6 +411,11 @@
RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME);
RNA_def_property_boolean_funcs(prop, NULL, "rna_NlaStrip_animated_time_set");
RNA_def_property_ui_text(prop, "Animated Strip Time", "Strip time is controlled by an F-Curve rather than automatically determined");
+
+ prop= RNA_def_property(srna, "animated_time_cyclic", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "flag", NLASTRIP_FLAG_USR_TIME_CYCLIC);
+ RNA_def_property_ui_text(prop, "Cyclic Strip Time", "Cycle the animated time within the action start & end");
+ RNA_def_property_update(prop, 0, "rna_NlaStrip_transform_update"); // is there a better update flag?
/* settings */
prop= RNA_def_property(srna, "active", PROP_BOOLEAN, PROP_NONE);
More information about the Bf-blender-cvs
mailing list