[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [27974] trunk/blender/source/blender/ editors/space_nla/nla_edit.c: Bugfix #21896: Adding an modifier to a NLA strip adds it to all NLA strips
Joshua Leung
aligorith at gmail.com
Sat Apr 3 13:19:17 CEST 2010
Revision: 27974
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=27974
Author: aligorith
Date: 2010-04-03 13:19:17 +0200 (Sat, 03 Apr 2010)
Log Message:
-----------
Bugfix #21896: Adding an modifier to a NLA strip adds it to all NLA strips
When adding modifiers to a NLA strips vs adding to the active NLA strip only, was missing a check that strips were selected first.
Modified Paths:
--------------
trunk/blender/source/blender/editors/space_nla/nla_edit.c
Modified: trunk/blender/source/blender/editors/space_nla/nla_edit.c
===================================================================
--- trunk/blender/source/blender/editors/space_nla/nla_edit.c 2010-04-03 10:28:16 UTC (rev 27973)
+++ trunk/blender/source/blender/editors/space_nla/nla_edit.c 2010-04-03 11:19:17 UTC (rev 27974)
@@ -1600,12 +1600,19 @@
for (ale= anim_data.first; ale; ale= ale->next) {
NlaTrack *nlt= (NlaTrack *)ale->data;
NlaStrip *strip;
- int i = 1;
- for (strip= nlt->strips.first; strip; strip=strip->next, i++) {
- /* only add F-Modifier if on active strip? */
- if ((onlyActive) && (strip->flag & NLASTRIP_FLAG_ACTIVE)==0)
- continue;
+ for (strip= nlt->strips.first; strip; strip=strip->next) {
+ /* can F-Modifier be added to the current strip? */
+ if (onlyActive) {
+ /* if not active, cannot add since we're only adding to active strip */
+ if ((strip->flag & NLASTRIP_FLAG_ACTIVE)==0)
+ continue;
+ }
+ else {
+ /* strip must be selected, since we're not just doing active */
+ if ((strip->flag & NLASTRIP_FLAG_SELECT)==0)
+ continue;
+ }
/* add F-Modifier of specified type to selected, and make it the active one */
fcm= add_fmodifier(&strip->modifiers, type);
@@ -1613,10 +1620,9 @@
if (fcm)
set_active_fmodifier(&strip->modifiers, fcm);
else {
- char errormsg[128];
- sprintf(errormsg, "Modifier couldn't be added to (%s : %d). See console for details.", nlt->name, i);
-
- BKE_report(op->reports, RPT_ERROR, errormsg);
+ BKE_reportf(op->reports, RPT_ERROR,
+ "Modifier couldn't be added to (%s : %s). See console for details.",
+ nlt->name, strip->name);
}
}
}
More information about the Bf-blender-cvs
mailing list