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>2007-09-17 15:41:12 +0400
committerJoshua Leung <aligorith@gmail.com>2007-09-17 15:41:12 +0400
commit52f551678b3c9020bad91041ad28a71d4e776140 (patch)
tree32a88e58de17d3e15af2190fc73ee11d1a9001fe /source/blender/src/header_action.c
parent023a929363bb822f90528eff0ab3b38c86a4b309 (diff)
== Action Editor - Copy and Paste Tools ==
Now it is possible to do Copy+Paste in the Action Editor, like in the IPO Editor. There are two new buttons in the Action Editor header for this, using the familiar icons. * To copy... Select the keyframes you wish to copy, and the channels that they occur in (except for ShapeKey mode, where it is not possible to select channels). Click copy button. * To paste... Place the current frame where you want the first of the keyframes from the buffer is to be pasted. Select all channels you wish the keyframes to be pasted into. Click paste button. Currently, keyframes are only pasted into 'compatible' curves (i.e. LocX keyframes can only go to LocX, and so on). This may change after user feedback, if this is found to be too restrictive. == Code Changes == I've made a few changes which allow this code to be nicer. * renamed insert_vert_ipo to insert_vert_icu, as that represents its actual purpose better (and changed all occurrences I could find) * created a new function, insert_bezt_icu, which does the actual inserting of provided BezTriple data to a given IpoCurve * recoded insert_vert_icu to use this new function, and also the IPO-Editor keyframe pasting (i.e. pasting in Editmode)
Diffstat (limited to 'source/blender/src/header_action.c')
-rw-r--r--source/blender/src/header_action.c50
1 files changed, 35 insertions, 15 deletions
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index 1c34bdbaeaf..d8afe0fd1f1 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -229,6 +229,14 @@ void do_action_buttons(unsigned short event)
paste_posebuf(1);
allqueue(REDRAWVIEW3D, 1);
break;
+
+ /* copy/paste buttons in Action Editor header */
+ case B_ACTCOPYKEYS:
+ copy_actdata();
+ break;
+ case B_ACTPASTEKEYS:
+ paste_actdata();
+ break;
case B_ACTPIN: /* __PINFAKE */
/* if (G.saction->flag & SACTION_PIN) {
@@ -1102,23 +1110,23 @@ void action_buttons(void)
{
uiBlock *block;
short xco, xmax;
- char naam[256];
+ char name[256];
Object *ob;
ID *from;
- if (!G.saction)
+ if (G.saction == NULL)
return;
- // copy from drawactionspace....
+ /* copied from drawactionspace.... */
if (!G.saction->pin) {
if (OBACT)
G.saction->action = OBACT->action;
else
- G.saction->action=NULL;
+ G.saction->action= NULL;
}
- sprintf(naam, "header %d", curarea->headwin);
- block= uiNewBlock(&curarea->uiblocks, naam,
+ sprintf(name, "header %d", curarea->headwin);
+ block= uiNewBlock(&curarea->uiblocks, name,
UI_EMBOSS, UI_HELV, curarea->headwin);
if (area_is_active_area(curarea))
@@ -1156,10 +1164,10 @@ void action_buttons(void)
uiBlockSetEmboss(block, UI_EMBOSS);
xco+=XIC;
- if((curarea->flag & HEADER_NO_PULLDOWN)==0) {
+ if ((curarea->flag & HEADER_NO_PULLDOWN)==0) {
/* pull down menus */
uiBlockSetEmboss(block, UI_EMBOSSP);
-
+
xmax= GetButStringLength("View");
uiDefPulldownBut(block, action_viewmenu, NULL,
"View", xco, -2, xmax-3, 24, "");
@@ -1184,8 +1192,8 @@ void action_buttons(void)
uiBlockSetEmboss(block, UI_EMBOSS);
/* NAME ETC */
- ob=OBACT;
- from = (ID*) ob;
+ ob= OBACT;
+ from = (ID *)ob;
xco= std_libbuttons(block, xco, 0, B_ACTPIN, &G.saction->pin,
B_ACTIONBROWSE, ID_AC, 0, (ID*)G.saction->action,
@@ -1195,7 +1203,7 @@ void action_buttons(void)
uiClearButLock();
/* draw AUTOSNAP */
- xco+= 8;
+ xco += 8;
if (G.saction->flag & SACTION_DRAWTIME) {
uiDefButS(block, MENU, B_REDR,
@@ -1210,15 +1218,27 @@ void action_buttons(void)
"Auto-snapping mode for keyframes when transforming");
}
- xco+= (70 + 8);
+ xco += (70 + 8);
- /* draw LOCK*/
-
+ /* COPY PASTE */
+ uiBlockBeginAlign(block);
+ if (curarea->headertype==HEADERTOP) {
+ uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYUP, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer");
+ uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEUP, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer");
+ }
+ else {
+ uiDefIconBut(block, BUT, B_ACTCOPYKEYS, ICON_COPYDOWN, xco,0,XIC,YIC, 0, 0, 0, 0, 0, "Copies the selected keyframes from the selected channel(s) to the buffer");
+ uiDefIconBut(block, BUT, B_ACTPASTEKEYS, ICON_PASTEDOWN, xco+=XIC,0,XIC,YIC, 0, 0, 0, 0, 0, "Pastes the keyframes from the buffer");
+ }
+ uiBlockEndAlign(block);
+ xco += (XIC + 8);
+
+ /* draw LOCK */
uiDefIconButS(block, ICONTOG, 1, ICON_UNLOCKED, xco, 0, XIC, YIC,
&(G.saction->lock), 0, 0, 0, 0,
"Updates other affected window spaces automatically "
"to reflect changes in real time");
-
+
/* always as last */
curarea->headbutlen = xco + 2*XIC;