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>2006-12-06 05:37:32 +0300
committerJoshua Leung <aligorith@gmail.com>2006-12-06 05:37:32 +0300
commit6c138fc6a9117e88e65ff990443f2fecaa6d9550 (patch)
treebee70cf913dd50c96c19df311c4f7f498e4263b6 /source/blender/src/drawaction.c
parent4eb36442865338da80ae72d4a9f5c14aeac3e934 (diff)
== Action Editor ==
Now it is possible to 'protect' action channels and constraint channels. * When a channel is 'protected', the only operation possible on keyframes is selection. All other operations are not able to be performed. * The padlock to the right of each channel's name toggles the protection status of that channel. You can only alter the protection status of one channel at a time. Todos: * Menus still pop up when trying to do stuff to keyframes even if all the keyframes selected are from protected channels. * Shapekey channels shown in action editor should also get locks
Diffstat (limited to 'source/blender/src/drawaction.c')
-rw-r--r--source/blender/src/drawaction.c26
1 files changed, 21 insertions, 5 deletions
diff --git a/source/blender/src/drawaction.c b/source/blender/src/drawaction.c
index 12e52382ab0..c8b7198f00a 100644
--- a/source/blender/src/drawaction.c
+++ b/source/blender/src/drawaction.c
@@ -92,7 +92,6 @@
/* local functions ----------------------------------------------------- */
-int count_action_levels(bAction *act);
static ListBase *ipo_to_keylist(Ipo *ipo, int flags);
static ListBase *action_to_keylist(bAction *act, int flags);
static ListBase *ob_to_keylist(Object *ob, int flags);
@@ -227,9 +226,19 @@ static void draw_action_channel_names(bAction *act)
for (chan=act->chanbase.first; chan; chan=chan->next){
if((chan->flag & ACHAN_HIDDEN)==0) {
+ glEnable(GL_BLEND);
+
+ /* draw backing strip behind action channel name */
BIF_ThemeColorShade(TH_HEADER, 20);
glRectf(x, y-CHANNELHEIGHT/2, (float)NAMEWIDTH, y+CHANNELHEIGHT/2);
-
+
+ /* draw 'lock' indicating whether channel is protected */
+ if (chan->flag & ACHAN_PROTECTED)
+ BIF_icon_draw(NAMEWIDTH-16, y-CHANNELHEIGHT/2, ICON_LOCKED);
+ else
+ BIF_icon_draw(NAMEWIDTH-16, y-CHANNELHEIGHT/2, ICON_UNLOCKED);
+
+ /* draw name of action channel */
if (chan->flag & ACHAN_SELECTED)
BIF_ThemeColor(TH_TEXT_HI);
else
@@ -239,17 +248,24 @@ static void draw_action_channel_names(bAction *act)
y-=CHANNELHEIGHT+CHANNELSKIP;
/* Draw constraint channels */
- for (conchan=chan->constraintChannels.first;
- conchan; conchan=conchan->next){
+ for (conchan=chan->constraintChannels.first; conchan; conchan=conchan->next) {
+ /* draw 'lock' to indicate if constraint channel is protected */
+ if (conchan->flag & CONSTRAINT_CHANNEL_PROTECTED)
+ BIF_icon_draw(NAMEWIDTH-16, y-CHANNELHEIGHT/2, ICON_LOCKED);
+ else
+ BIF_icon_draw(NAMEWIDTH-16, y-CHANNELHEIGHT/2, ICON_UNLOCKED);
+
+ /* draw name of constraint channel */
if (conchan->flag & CONSTRAINT_CHANNEL_SELECT)
BIF_ThemeColor(TH_TEXT_HI);
else
BIF_ThemeColor(TH_TEXT);
-
glRasterPos2f(x+32, y-4);
BMF_DrawString(G.font, conchan->name);
y-=CHANNELHEIGHT+CHANNELSKIP;
}
+
+ glDisable(GL_BLEND);
}
}
}