Grease Pencil:
* Separated duplicate methods out into several functions * Added copy/paste for gp-frames in Action Editor. Only strokes that are appropriate for the spacetype that the destination layer belongs to will be added to avoid wasted memory usage. Otherwise, was impossible to move sketches between views/layers (which was intended for PyAPI access that didn't get done). Note: there will currently still be an extra gp-frame created, even if the current no strokes got pasted. There's commented out code which would delete it, but somehow that causes errors, so better to be safe for now.
This commit is contained in:
@@ -285,10 +285,16 @@ void do_action_buttons(unsigned short event)
|
||||
|
||||
/* copy/paste buttons in Action Editor header */
|
||||
case B_ACTCOPYKEYS:
|
||||
copy_actdata();
|
||||
if (G.saction->mode == SACTCONT_GPENCIL)
|
||||
copy_gpdata();
|
||||
else
|
||||
copy_actdata();
|
||||
break;
|
||||
case B_ACTPASTEKEYS:
|
||||
paste_actdata();
|
||||
if (G.saction->mode == SACTCONT_GPENCIL)
|
||||
paste_gpdata();
|
||||
else
|
||||
paste_actdata();
|
||||
break;
|
||||
|
||||
case B_ACTPIN: /* __PINFAKE */
|
||||
@@ -1735,20 +1741,24 @@ void action_buttons(void)
|
||||
uiClearButLock();
|
||||
|
||||
xco += 8;
|
||||
|
||||
/* 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);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/* 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);
|
||||
|
||||
|
||||
if (G.saction->mode != SACTCONT_GPENCIL) {
|
||||
/* draw AUTOSNAP */
|
||||
if (G.saction->flag & SACTION_DRAWTIME) {
|
||||
uiDefButC(block, MENU, B_REDR,
|
||||
|
||||
Reference in New Issue
Block a user