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>2010-04-03 15:19:17 +0400
committerJoshua Leung <aligorith@gmail.com>2010-04-03 15:19:17 +0400
commitea44ea86f9d74efe90827294ffa2d9069ce72f4d (patch)
tree1cfc998e0d038369c13f083d5fec77f9e7d69f35 /source/blender/editors/space_nla
parent939a83e3475d95fe95713e691d275abef6753d40 (diff)
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.
Diffstat (limited to 'source/blender/editors/space_nla')
-rw-r--r--source/blender/editors/space_nla/nla_edit.c24
1 files changed, 15 insertions, 9 deletions
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index eeb8fc5e696..3319c36e92b 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -1600,12 +1600,19 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
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 @@ static int nla_fmodifier_add_exec(bContext *C, wmOperator *op)
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);
}
}
}