diff options
author | Ton Roosendaal <ton@blender.org> | 2006-11-01 18:33:45 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2006-11-01 18:33:45 +0300 |
commit | 6dd4f6020e010f13508c0fe2a3f6c3b7d430fe9a (patch) | |
tree | 6214f4c129f37f47995d0e834e8a5b74a2c15dd4 /source | |
parent | f5fc880a41d990a337df6e0c2e6743a54da043fd (diff) |
Patch #4848, Joshua Leung
NLA Strip "Mute" option, to temporally disable a strip. Option only in
Properties panel still, should be in menus and hotkey.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/blenkernel/intern/action.c | 2 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_nla_types.h | 2 | ||||
-rw-r--r-- | source/blender/src/drawnla.c | 22 |
3 files changed, 19 insertions, 7 deletions
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index fca4fcb2466..17910c01fa3 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -1044,7 +1044,7 @@ static void do_nla(Object *ob, int blocktype) for (strip=ob->nlastrips.first; strip; strip=strip->next){ doit=dostride= 0; - if (strip->act){ /* so theres an action */ + if (strip->act && !(strip->flag & ACTSTRIP_MUTE)) { /* so theres an action */ /* Determine if the current frame is within the strip's range */ length = strip->end-strip->start; diff --git a/source/blender/makesdna/DNA_nla_types.h b/source/blender/makesdna/DNA_nla_types.h index c97ef5ab197..457e667018e 100644 --- a/source/blender/makesdna/DNA_nla_types.h +++ b/source/blender/makesdna/DNA_nla_types.h @@ -89,6 +89,8 @@ typedef struct bActionStrip { #define ACTSTRIP_HOLDLASTFRAME 0x08 #define ACTSTRIP_ACTIVE 0x10 #define ACTSTRIP_LOCK_ACTION 0x20 +#define ACTSTRIP_MUTE 0x40 +#define ACTSTRIP_REVERSE 0x80 #endif diff --git a/source/blender/src/drawnla.c b/source/blender/src/drawnla.c index a1a5bebe8d6..39e6b24481d 100644 --- a/source/blender/src/drawnla.c +++ b/source/blender/src/drawnla.c @@ -346,13 +346,22 @@ static void draw_nla_strips_keys(SpaceNla *snla) glEnd(); } + gla2DDrawTranslatePt(di, strip->start, y, &stripstart, &channel_y); + gla2DDrawTranslatePt(di, strip->end, y, &stripend, &channel_y); + + /* muted strip */ + if(strip->flag & ACTSTRIP_MUTE) { + glColor3f(1, 0, 0); + glBegin(GL_LINES); + glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3); + glVertex2f(stripend, channel_y+NLACHANNELHEIGHT/2-3); + glEnd(); + } + /* Draw border */ glEnable (GL_BLEND); - glBegin(GL_LINE_STRIP); glColor4f(1, 1, 1, 0.7); - gla2DDrawTranslatePt(di, strip->start, y, &stripstart, &channel_y); - gla2DDrawTranslatePt(di, strip->end, y, &stripend, &channel_y); glVertex2f(stripstart, channel_y-NLACHANNELHEIGHT/2+3); glVertex2f(stripstart, channel_y+NLACHANNELHEIGHT/2-3); @@ -549,9 +558,10 @@ static void nla_panel_properties(short cntrl) // NLA_HANDLER_PROPERTIES } uiBlockBeginAlign(block); - uiDefButF(block, NUM, B_NLA_PANEL, "Blendin:", 10,100,145,19, &strip->blendin, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-in"); - uiDefButF(block, NUM, B_NLA_PANEL, "Blendout:", 10,80,145,19, &strip->blendout, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-out"); - + uiDefButF(block, NUM, B_NLA_PANEL, "Blendin:", 10,100,145,19, &strip->blendin, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-in"); + uiDefButF(block, NUM, B_NLA_PANEL, "Blendout:", 10,80,145,19, &strip->blendout, 0.0, strip->end-strip->start, 100, 0, "Number of frames of ease-out"); + uiDefButBitS(block, TOG, ACTSTRIP_MUTE, B_NLA_PANEL, "Mute", 10,60,145,19, &strip->flag, 0, 0, 0, 0, "Toggles whether the strip contributes to the NLA solution"); + uiBlockBeginAlign(block); uiDefButF(block, NUM, B_NLA_PANEL, "Repeat:", 160,100,150,19, &strip->repeat, 0.001, 1000.0f, 100, 0, "Number of times the action should repeat"); but= uiDefButC(block, TEX, B_NLA_PANEL, "OffsBone:", 160,80,150,19, strip->offs_bone, 0, 31.0f, 0, 0, "Name of Bone that defines offset for repeat"); |