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:
Diffstat (limited to 'source/blender/src/header_time.c')
-rw-r--r--source/blender/src/header_time.c47
1 files changed, 38 insertions, 9 deletions
diff --git a/source/blender/src/header_time.c b/source/blender/src/header_time.c
index 9a77a4c44eb..02bdda86b4e 100644
--- a/source/blender/src/header_time.c
+++ b/source/blender/src/header_time.c
@@ -45,6 +45,7 @@
#include "BIF_gl.h"
#include "BIF_interface.h"
+#include "BIF_keyframing.h"
#include "BIF_resources.h"
#include "BIF_screen.h"
#include "BIF_space.h"
@@ -130,6 +131,17 @@ void do_time_buttons(ScrArea *sa, unsigned short event)
BIF_undo_push("Set anim-preview range");
allqueue(REDRAWALL, 0);
break;
+
+ case B_TL_INSERTKEY:
+ /* insert keyframe */
+ common_insertkey();
+ allqueue(REDRAWTIME, 1);
+ break;
+ case B_TL_DELETEKEY:
+ /* delete keyframe */
+ common_deletekey();
+ allqueue(REDRAWTIME, 1);
+ break;
}
}
@@ -148,6 +160,9 @@ static void do_time_redrawmenu(void *arg, int event)
if(event==1001) {
button(&G.scene->r.frs_sec,1,120,"FPS:");
}
+ else if(event==1002) {
+ G.scene->audio.flag ^= AUDIO_SYNC;
+ }
}
}
@@ -190,7 +205,11 @@ static uiBlock *time_redrawmenu(void *arg_unused)
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
- sprintf(str, "Set Frames/Sec (%d/%f)", G.scene->r.frs_sec, G.scene->r.frs_sec_base);
+ if(G.scene->audio.flag & AUDIO_SYNC) icon= ICON_CHECKBOX_HLT;
+ else icon= ICON_CHECKBOX_DEHLT;
+ uiDefIconTextBut(block, BUTM, 1, icon, "Sync Playback to Frames/Sec", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1002, "");
+
+ sprintf(str, "Set Frames/Sec (%d/%2f)", G.scene->r.frs_sec, G.scene->r.frs_sec_base);
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, str, 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1001, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
@@ -488,7 +507,7 @@ void time_buttons(ScrArea *sa)
&G.scene->r.psfra,MINFRAMEF, MAXFRAMEF, 0, 0,
"The start frame of the animation preview (inclusive)");
- xco += 4.5*XIC;
+ xco += (short)(4.5*XIC);
uiDefButI(block, NUM, REDRAWALL,"End:",
xco,0,4.5*XIC,YIC,
@@ -501,23 +520,23 @@ void time_buttons(ScrArea *sa)
&G.scene->r.sfra,MINFRAMEF, MAXFRAMEF, 0, 0,
"The start frame of the animation (inclusive)");
- xco += 4.5*XIC;
+ xco += (short)(4.5*XIC);
uiDefButI(block, NUM, REDRAWALL,"End:",
xco,0,4.5*XIC,YIC,
- &G.scene->r.efra,SFRA,MAXFRAMEF, 0, 0,
+ &G.scene->r.efra,(float)SFRA,MAXFRAMEF, 0, 0,
"The end frame of the animation (inclusive)");
}
uiBlockEndAlign(block);
- xco += 4.5*XIC+16;
+ xco += (short)(4.5 * XIC + 16);
uiDefButI(block, NUM, B_NEWFRAME, "",
xco,0,3.5*XIC,YIC,
&(G.scene->r.cfra), MINFRAMEF, MAXFRAMEF, 0, 0,
"Displays Current Frame of animation");
- xco += 3.5*XIC+16;
+ xco += (short)(3.5 * XIC + 16);
uiDefIconBut(block, BUT, B_TL_REW, ICON_REW,
xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Skip to Start frame (Shift DownArrow)");
@@ -542,21 +561,31 @@ void time_buttons(ScrArea *sa)
xco+= XIC+8;
uiDefIconButBitS(block, TOG, AUTOKEY_ON, REDRAWINFO, ICON_REC,
- xco, 0, XIC, YIC, &(U.autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
+ xco, 0, XIC, YIC, &(G.scene->autokey_mode), 0, 0, 0, 0, "Automatic keyframe insertion for Objects and Bones");
xco+= XIC;
if (IS_AUTOKEY_ON) {
uiDefButS(block, MENU, REDRAWINFO,
"Auto-Keying Mode %t|Add/Replace Keys%x3|Replace Keys %x5",
- xco, 0, 3*XIC, YIC, &(U.autokey_mode), 0, 1, 0, 0,
+ xco, 0, 3.5*XIC, YIC, &(G.scene->autokey_mode), 0, 1, 0, 0,
"Mode of automatic keyframe insertion for Objects and Bones");
xco+= (4*XIC);
}
xco+= 16;
-
+
+ uiDefIconBut(block, BUT, B_TL_INSERTKEY, ICON_KEY_HLT,
+ xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Insert Keyframe for the context of the largest area (IKEY)");
+ xco+= XIC+4;
+ uiDefIconBut(block, BUT, B_TL_DELETEKEY, ICON_KEY_DEHLT,
+ xco, 0, XIC, YIC, 0, 0, 0, 0, 0, "Delete Keyframe for the context of the largest area (ALTKEY-IKEY)");
+ xco+= XIC+4;
+
+ xco+= 16;
+
uiDefIconButBitI(block, TOG, TIME_WITH_SEQ_AUDIO, B_DIFF, ICON_SPEAKER,
xco, 0, XIC, YIC, &(stime->redraws), 0, 0, 0, 0, "Play back and sync with audio from Sequence Editor");
+
/* always as last */
sa->headbutlen= xco+XIC+80; // +80 because the last button is not an icon