Big Commit.
Now time-markers work in all time-related spaces (i.e. Ipo, Action Editor, NLA editor, TimeLine, Sound). The hotkeys and functionality set should be the same for each of these modes (with a few exceptions still). I've had to change a few hotkeys here and there, so hopefully they aren't too bad. Marker Operations: MKEY - Add Marker SHIFT MKEY - Rename marker (was CTRL MKEY) XKEY - Delete Marker PAGE UP - Jump to next marker PAGE DOWN - Jump to previous marker CTRL A - Select all markers SHIFT G - Transform markers (NLA, IPO, Action) G - Transform markers (Sound, Timeline) CTRL SHIFT D - Duplicate markers (NLA, IPO, Action) SHIFT D - Duplicate markers (Sound, Timeline) BKEY - select markers and other keyframes (if any) I've also made a few little tool additions to NLA and Action editors: * NLA editor - Snap To Frame. Now with the option to offset strip so that it starts at the current frame. Added menus for this. * Action editor - Snap To Frame A few new menus for this too
This commit is contained in:
@@ -78,24 +78,14 @@ void transform_actionchannel_keys(int mode, int dummy);
|
|||||||
void transform_meshchannel_keys(char mode, struct Key *key);
|
void transform_meshchannel_keys(char mode, struct Key *key);
|
||||||
struct Key *get_action_mesh_key(void);
|
struct Key *get_action_mesh_key(void);
|
||||||
int get_nearest_key_num(struct Key *key, short *mval, float *x);
|
int get_nearest_key_num(struct Key *key, short *mval, float *x);
|
||||||
void snap_keys_to_frame(void);
|
void snap_keys_to_frame(int snap_mode);
|
||||||
void clean_shapekeys(struct Key *key);
|
void clean_shapekeys(struct Key *key);
|
||||||
void clean_actionchannels(struct bAction *act);
|
void clean_actionchannels(struct bAction *act);
|
||||||
|
|
||||||
/* Marker Operations */
|
/* Marker Operations */
|
||||||
struct ListBase *get_saction_markers(struct SpaceAction *saction);
|
void get_minmax_saction_markers(float *first, float *last);
|
||||||
struct TimeMarker *find_nearest_saction_marker(struct ListBase *markers);
|
void selectkeys_columns_markers(void);
|
||||||
void get_minmax_saction_markers(struct ListBase *markers, float *first, float *last);
|
void selectkeys_between_markers(void);
|
||||||
void add_saction_marker(struct ListBase *markers, int frame);
|
|
||||||
void duplicate_saction_markers(struct ListBase *markers);
|
|
||||||
void remove_saction_markers(struct ListBase *markers);
|
|
||||||
void rename_saction_markers(struct ListBase *markers);
|
|
||||||
void transform_saction_markers(int mode, int smode);
|
|
||||||
void deselect_saction_markers(struct ListBase *markers, short test, short sel);
|
|
||||||
void borderselect_saction_markers(struct ListBase *markers, float xmin, float xmax, int selectmode);
|
|
||||||
void nextprev_saction_markers(ListBase *markers, short dir);
|
|
||||||
void selectkeys_columns_markers(struct ListBase *markers);
|
|
||||||
void selectkeys_between_markers(struct ListBase *markers);
|
|
||||||
|
|
||||||
/* channel/strip operations */
|
/* channel/strip operations */
|
||||||
void up_sel_action(void);
|
void up_sel_action(void);
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ void shift_nlastrips_up(void);
|
|||||||
void shift_nlastrips_down(void);
|
void shift_nlastrips_down(void);
|
||||||
void reset_action_strips(int val);
|
void reset_action_strips(int val);
|
||||||
void synchronize_action_strips(void);
|
void synchronize_action_strips(void);
|
||||||
void snap_action_strips(void);
|
void snap_action_strips(int snap_mode);
|
||||||
void add_nlablock(void);
|
void add_nlablock(void);
|
||||||
void copy_action_modifiers(void);
|
void copy_action_modifiers(void);
|
||||||
|
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ void sethandles_ipo(int code);
|
|||||||
void select_ipo_bezier_keys(struct Ipo *ipo, int selectmode);
|
void select_ipo_bezier_keys(struct Ipo *ipo, int selectmode);
|
||||||
void set_ipotype(void);
|
void set_ipotype(void);
|
||||||
void borderselect_ipo(void);
|
void borderselect_ipo(void);
|
||||||
void del_ipo(void);
|
void del_ipo(int need_check);
|
||||||
void del_ipoCurve ( struct IpoCurve * icu );
|
void del_ipoCurve ( struct IpoCurve * icu );
|
||||||
void free_ipocopybuf(void);
|
void free_ipocopybuf(void);
|
||||||
void copy_editipo(void);
|
void copy_editipo(void);
|
||||||
|
|||||||
@@ -33,19 +33,28 @@
|
|||||||
#ifndef BSE_TIME_H
|
#ifndef BSE_TIME_H
|
||||||
#define BSE_TIME_H
|
#define BSE_TIME_H
|
||||||
|
|
||||||
struct SpaceAction;
|
struct View2D;
|
||||||
|
|
||||||
/* ******** Markers ********* */
|
/* ******** Markers - General Api ********* */
|
||||||
void add_timeline_marker(int frame);
|
void add_marker(int frame);
|
||||||
void duplicate_timeline_marker(void);
|
void duplicate_marker(void);
|
||||||
void remove_timeline_marker(void);
|
void remove_marker(void);
|
||||||
void rename_timeline_marker(void);
|
void rename_marker(void);
|
||||||
void select_timeline_markers(void);
|
void transform_markers(int mode, int smode);
|
||||||
|
void deselect_markers(short test, short sel);
|
||||||
|
void borderselect_markers(float xmin, float xmax, int selectmode);
|
||||||
|
struct TimeMarker *find_nearest_marker(int clip_y);
|
||||||
|
void nextprev_marker(short dir);
|
||||||
|
|
||||||
|
/* ******** Markers - Space Specific ************* */
|
||||||
|
/* TimeLine Marker Stuff ----------------------------------- */
|
||||||
|
void borderselect_timeline_markers(void);
|
||||||
|
/* Other Space Marker Stuff ----------------------------- */
|
||||||
|
void draw_markers_timespace(struct View2D *v2d);
|
||||||
|
|
||||||
|
/* *********** TimeLine Specific ***************/
|
||||||
void timeline_frame_to_center(void);
|
void timeline_frame_to_center(void);
|
||||||
void nextprev_timeline_key(short dir);
|
void nextprev_timeline_key(short dir);
|
||||||
void nextprev_timeline_marker(short dir);
|
|
||||||
void timeline_grab(int mode, int smode);
|
|
||||||
void draw_markers_action(struct SpaceAction *sact);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|||||||
@@ -300,6 +300,9 @@ int BoneSize(TransInfo *t, short mval[2]);
|
|||||||
void initBoneEnvelope(TransInfo *t);
|
void initBoneEnvelope(TransInfo *t);
|
||||||
int BoneEnvelope(TransInfo *t, short mval[2]);
|
int BoneEnvelope(TransInfo *t, short mval[2]);
|
||||||
|
|
||||||
|
void initBoneRoll(TransInfo *t);
|
||||||
|
int BoneRoll(TransInfo *t, short mval[2]);
|
||||||
|
|
||||||
/*********************** transform_conversions.c ********** */
|
/*********************** transform_conversions.c ********** */
|
||||||
struct ListBase;
|
struct ListBase;
|
||||||
void flushTransUVs(TransInfo *t);
|
void flushTransUVs(TransInfo *t);
|
||||||
|
|||||||
@@ -697,7 +697,7 @@ void drawactionspace(ScrArea *sa, void *spacedata)
|
|||||||
draw_cfra_action();
|
draw_cfra_action();
|
||||||
|
|
||||||
/* Draw markers */
|
/* Draw markers */
|
||||||
draw_markers_action(G.saction);
|
draw_markers_timespace(&(G.saction->v2d));
|
||||||
|
|
||||||
/* Draw scroll */
|
/* Draw scroll */
|
||||||
mywinset(curarea->win); // reset scissor too
|
mywinset(curarea->win); // reset scissor too
|
||||||
|
|||||||
@@ -85,6 +85,7 @@
|
|||||||
#include "BSE_editipo.h"
|
#include "BSE_editipo.h"
|
||||||
#include "BSE_editipo_types.h"
|
#include "BSE_editipo_types.h"
|
||||||
#include "BSE_editnla_types.h"
|
#include "BSE_editnla_types.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "BPY_extern.h"
|
#include "BPY_extern.h"
|
||||||
|
|
||||||
@@ -2136,6 +2137,9 @@ void drawipospace(ScrArea *sa, void *spacedata)
|
|||||||
draw_ipohandles(1);
|
draw_ipohandles(1);
|
||||||
draw_ipovertices(1);
|
draw_ipovertices(1);
|
||||||
|
|
||||||
|
/* draw markers */
|
||||||
|
draw_markers_timespace(&(sipo->v2d));
|
||||||
|
|
||||||
/* restore viewport */
|
/* restore viewport */
|
||||||
mywinset(sa->win);
|
mywinset(sa->win);
|
||||||
|
|
||||||
|
|||||||
@@ -66,6 +66,7 @@
|
|||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_editnla_types.h"
|
#include "BSE_editnla_types.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "BIF_editnla.h"
|
#include "BIF_editnla.h"
|
||||||
#include "BIF_gl.h"
|
#include "BIF_gl.h"
|
||||||
@@ -644,6 +645,7 @@ static void nla_blockhandlers(ScrArea *sa)
|
|||||||
|
|
||||||
void drawnlaspace(ScrArea *sa, void *spacedata)
|
void drawnlaspace(ScrArea *sa, void *spacedata)
|
||||||
{
|
{
|
||||||
|
SpaceNla *snla= G.snla;
|
||||||
float col[3];
|
float col[3];
|
||||||
short ofsx = 0, ofsy = 0;
|
short ofsx = 0, ofsy = 0;
|
||||||
|
|
||||||
@@ -687,6 +689,9 @@ void drawnlaspace(ScrArea *sa, void *spacedata)
|
|||||||
glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
|
glScissor(ofsx+G.v2d->mask.xmin, ofsy+G.v2d->mask.ymin, ( ofsx+G.v2d->mask.xmax-1)-(ofsx+G.v2d->mask.xmin)+1, ( ofsy+G.v2d->mask.ymax-1)-( ofsy+G.v2d->mask.ymin)+1);
|
||||||
myortho2 (G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
|
myortho2 (G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
|
||||||
draw_cfra_action();
|
draw_cfra_action();
|
||||||
|
|
||||||
|
/* draw markers */
|
||||||
|
draw_markers_timespace(&(snla->v2d));
|
||||||
|
|
||||||
/* Draw scroll */
|
/* Draw scroll */
|
||||||
mywinset(curarea->win); // reset scissor too
|
mywinset(curarea->win); // reset scissor too
|
||||||
|
|||||||
@@ -55,6 +55,7 @@
|
|||||||
#include "BIF_resources.h"
|
#include "BIF_resources.h"
|
||||||
|
|
||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
#include "BMF_Api.h"
|
#include "BMF_Api.h"
|
||||||
|
|
||||||
/* local */
|
/* local */
|
||||||
@@ -188,6 +189,7 @@ static void draw_cfra_sound(SpaceSound *ssound)
|
|||||||
|
|
||||||
void drawsoundspace(ScrArea *sa, void *spacedata)
|
void drawsoundspace(ScrArea *sa, void *spacedata)
|
||||||
{
|
{
|
||||||
|
SpaceSound *ssound;
|
||||||
float col[3];
|
float col[3];
|
||||||
short ofsx, ofsy;
|
short ofsx, ofsy;
|
||||||
|
|
||||||
@@ -217,7 +219,9 @@ void drawsoundspace(ScrArea *sa, void *spacedata)
|
|||||||
draw_sample(G.ssound->sound->sample);
|
draw_sample(G.ssound->sound->sample);
|
||||||
}
|
}
|
||||||
|
|
||||||
draw_cfra_sound(spacedata);
|
ssound= spacedata;
|
||||||
|
draw_cfra_sound(ssound);
|
||||||
|
draw_markers_timespace(&(ssound->v2d));
|
||||||
|
|
||||||
/* restore viewport */
|
/* restore viewport */
|
||||||
mywinset(curarea->win);
|
mywinset(curarea->win);
|
||||||
|
|||||||
@@ -45,6 +45,8 @@
|
|||||||
#include "DNA_scene_types.h"
|
#include "DNA_scene_types.h"
|
||||||
#include "DNA_space_types.h"
|
#include "DNA_space_types.h"
|
||||||
#include "DNA_screen_types.h"
|
#include "DNA_screen_types.h"
|
||||||
|
#include "DNA_sound_types.h"
|
||||||
|
#include "DNA_view2d_types.h"
|
||||||
|
|
||||||
#include "BKE_ipo.h"
|
#include "BKE_ipo.h"
|
||||||
#include "BKE_object.h"
|
#include "BKE_object.h"
|
||||||
@@ -162,7 +164,7 @@ static void draw_marker(TimeMarker *marker)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void draw_markers_time( void )
|
static void draw_markers_time(void)
|
||||||
{
|
{
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
|
|
||||||
@@ -179,17 +181,17 @@ static void draw_markers_time( void )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void draw_markers_action(SpaceAction *sact)
|
void draw_markers_timespace(View2D *v2d)
|
||||||
{
|
{
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
float yspace, ypixels;
|
float yspace, ypixels;
|
||||||
|
|
||||||
/* move ortho view to align with slider in bottom */
|
/* move ortho view to align with slider in bottom */
|
||||||
glTranslatef(0.0f, sact->v2d.cur.ymin, 0.0f);
|
glTranslatef(0.0f, v2d->cur.ymin, 0.0f);
|
||||||
|
|
||||||
/* bad hacks in drawing markers... inverse correct that as well */
|
/* bad hacks in drawing markers... inverse correct that as well */
|
||||||
yspace= sact->v2d.cur.ymax - sact->v2d.cur.ymin;
|
yspace= v2d->cur.ymax - v2d->cur.ymin;
|
||||||
ypixels= sact->v2d.mask.ymax - sact->v2d.mask.ymin;
|
ypixels= v2d->mask.ymax - v2d->mask.ymin;
|
||||||
glTranslatef(0.0f, -11.0*yspace/ypixels, 0.0f);
|
glTranslatef(0.0f, -11.0*yspace/ypixels, 0.0f);
|
||||||
|
|
||||||
/* unselected markers are drawn at the first time */
|
/* unselected markers are drawn at the first time */
|
||||||
@@ -203,12 +205,11 @@ void draw_markers_action(SpaceAction *sact)
|
|||||||
if(marker->flag & SELECT) draw_marker(marker);
|
if(marker->flag & SELECT) draw_marker(marker);
|
||||||
}
|
}
|
||||||
|
|
||||||
glTranslatef(0.0f, -sact->v2d.cur.ymin, 0.0f);
|
glTranslatef(0.0f, -v2d->cur.ymin, 0.0f);
|
||||||
glTranslatef(0.0f, 11.0*yspace/ypixels, 0.0f);
|
glTranslatef(0.0f, 11.0*yspace/ypixels, 0.0f);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static void draw_sfra_efra()
|
static void draw_sfra_efra()
|
||||||
{
|
{
|
||||||
BIF_ThemeColorShade(TH_BACK, -25);
|
BIF_ThemeColorShade(TH_BACK, -25);
|
||||||
|
|||||||
@@ -3278,7 +3278,7 @@ int play_anim(int mode)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(event==MKEY) {
|
else if(event==MKEY) {
|
||||||
if(val) add_timeline_marker(CFRA-1);
|
if(val) add_marker(CFRA-1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(ELEM3(event, ESCKEY, SPACEKEY, RIGHTMOUSE)) break;
|
if(ELEM3(event, ESCKEY, SPACEKEY, RIGHTMOUSE)) break;
|
||||||
|
|||||||
@@ -85,6 +85,7 @@
|
|||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
#include "BSE_editipo.h"
|
#include "BSE_editipo.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
#include "BSE_trans_types.h"
|
#include "BSE_trans_types.h"
|
||||||
|
|
||||||
#include "BDR_editobject.h"
|
#include "BDR_editobject.h"
|
||||||
@@ -601,18 +602,16 @@ static void mouse_action(int selectmode)
|
|||||||
bActionChannel *chan;
|
bActionChannel *chan;
|
||||||
bConstraintChannel *conchan;
|
bConstraintChannel *conchan;
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
ListBase *markers;
|
|
||||||
short mval[2];
|
short mval[2];
|
||||||
|
|
||||||
act=G.saction->action;
|
act=G.saction->action;
|
||||||
if (!act)
|
if (!act)
|
||||||
return;
|
return;
|
||||||
markers= get_saction_markers(G.saction);
|
|
||||||
|
|
||||||
getmouseco_areawin (mval);
|
getmouseco_areawin (mval);
|
||||||
|
|
||||||
chan=get_nearest_actionchannel_key(&selx, &sel, &conchan);
|
chan=get_nearest_actionchannel_key(&selx, &sel, &conchan);
|
||||||
marker=find_nearest_saction_marker(markers);
|
marker=find_nearest_marker(1);
|
||||||
|
|
||||||
if (chan){
|
if (chan){
|
||||||
if (selectmode == SELECT_REPLACE) {
|
if (selectmode == SELECT_REPLACE) {
|
||||||
@@ -644,7 +643,7 @@ static void mouse_action(int selectmode)
|
|||||||
else if (marker) {
|
else if (marker) {
|
||||||
/* not channel, so maybe marker */
|
/* not channel, so maybe marker */
|
||||||
if (selectmode == SELECT_REPLACE) {
|
if (selectmode == SELECT_REPLACE) {
|
||||||
deselect_saction_markers(markers, 0, 0);
|
deselect_markers(0, 0);
|
||||||
marker->flag |= SELECT;
|
marker->flag |= SELECT;
|
||||||
}
|
}
|
||||||
else if (selectmode == SELECT_INVERT) {
|
else if (selectmode == SELECT_INVERT) {
|
||||||
@@ -658,10 +657,13 @@ static void mouse_action(int selectmode)
|
|||||||
else if (selectmode == SELECT_SUBTRACT)
|
else if (selectmode == SELECT_SUBTRACT)
|
||||||
marker->flag &= ~SELECT;
|
marker->flag &= ~SELECT;
|
||||||
|
|
||||||
std_rmouse_transform(transform_saction_markers);
|
std_rmouse_transform(transform_markers);
|
||||||
|
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -673,7 +675,6 @@ static void mouse_mesh_action(int selectmode, Key *key)
|
|||||||
|
|
||||||
IpoCurve *icu;
|
IpoCurve *icu;
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
ListBase *markers;
|
|
||||||
short sel;
|
short sel;
|
||||||
float selx;
|
float selx;
|
||||||
short mval[2];
|
short mval[2];
|
||||||
@@ -685,8 +686,7 @@ static void mouse_mesh_action(int selectmode, Key *key)
|
|||||||
* data, etc)
|
* data, etc)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
markers= get_saction_markers(G.saction);
|
marker= find_nearest_marker(1);
|
||||||
marker= find_nearest_saction_marker(markers);
|
|
||||||
|
|
||||||
/* get the click location, and the cooresponding
|
/* get the click location, and the cooresponding
|
||||||
* ipo curve and selection time value
|
* ipo curve and selection time value
|
||||||
@@ -729,7 +729,7 @@ static void mouse_mesh_action(int selectmode, Key *key)
|
|||||||
else if (marker) {
|
else if (marker) {
|
||||||
/* not channel, so maybe marker */
|
/* not channel, so maybe marker */
|
||||||
if (selectmode == SELECT_REPLACE) {
|
if (selectmode == SELECT_REPLACE) {
|
||||||
deselect_saction_markers(markers, 0, 0);
|
deselect_markers(0, 0);
|
||||||
marker->flag |= SELECT;
|
marker->flag |= SELECT;
|
||||||
}
|
}
|
||||||
else if (selectmode == SELECT_INVERT) {
|
else if (selectmode == SELECT_INVERT) {
|
||||||
@@ -743,10 +743,13 @@ static void mouse_mesh_action(int selectmode, Key *key)
|
|||||||
else if (selectmode == SELECT_SUBTRACT)
|
else if (selectmode == SELECT_SUBTRACT)
|
||||||
marker->flag &= ~SELECT;
|
marker->flag &= ~SELECT;
|
||||||
|
|
||||||
std_rmouse_transform(transform_saction_markers);
|
std_rmouse_transform(transform_markers);
|
||||||
|
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -759,22 +762,19 @@ void borderselect_action(void)
|
|||||||
bActionChannel *chan;
|
bActionChannel *chan;
|
||||||
bConstraintChannel *conchan;
|
bConstraintChannel *conchan;
|
||||||
bAction *act;
|
bAction *act;
|
||||||
ListBase *markers;
|
|
||||||
float ymin, ymax;
|
float ymin, ymax;
|
||||||
|
|
||||||
act=G.saction->action;
|
act=G.saction->action;
|
||||||
|
|
||||||
if (!act)
|
if (!act)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
markers = get_saction_markers(G.saction);
|
|
||||||
|
|
||||||
if ( (val = get_border(&rect, 3)) ){
|
if ( (val = get_border(&rect, 3)) ){
|
||||||
if (val == LEFTMOUSE)
|
if (val == LEFTMOUSE)
|
||||||
selectmode = SELECT_ADD;
|
selectmode = SELECT_ADD;
|
||||||
else
|
else
|
||||||
selectmode = SELECT_SUBTRACT;
|
selectmode = SELECT_SUBTRACT;
|
||||||
|
|
||||||
mval[0]= rect.xmin;
|
mval[0]= rect.xmin;
|
||||||
mval[1]= rect.ymin+2;
|
mval[1]= rect.ymin+2;
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
||||||
@@ -782,6 +782,9 @@ void borderselect_action(void)
|
|||||||
mval[1]= rect.ymax-2;
|
mval[1]= rect.ymax-2;
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
|
/* do markers first */
|
||||||
|
borderselect_markers(rectf.xmin, rectf.xmax, selectmode);
|
||||||
|
|
||||||
/* if action is mapped in NLA, it returns a correction */
|
/* if action is mapped in NLA, it returns a correction */
|
||||||
if(G.saction->pin==0 && OBACT) {
|
if(G.saction->pin==0 && OBACT) {
|
||||||
rectf.xmin= get_action_frame(OBACT, rectf.xmin);
|
rectf.xmin= get_action_frame(OBACT, rectf.xmin);
|
||||||
@@ -814,22 +817,17 @@ void borderselect_action(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do markers first */
|
|
||||||
if (markers != NULL)
|
|
||||||
borderselect_saction_markers(markers, rectf.xmin, rectf.xmax, selectmode);
|
|
||||||
|
|
||||||
|
|
||||||
BIF_undo_push("Border Select Action");
|
BIF_undo_push("Border Select Action");
|
||||||
allqueue(REDRAWNLA, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWIPO, 0);
|
allqueue(REDRAWIPO, 0);
|
||||||
if (markers != NULL) allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void borderselect_mesh(Key *key)
|
void borderselect_mesh(Key *key)
|
||||||
{
|
{
|
||||||
ListBase *markers;
|
|
||||||
rcti rect;
|
rcti rect;
|
||||||
int val, adrcodemax, adrcodemin;
|
int val, adrcodemax, adrcodemin;
|
||||||
short mval[2];
|
short mval[2];
|
||||||
@@ -838,7 +836,6 @@ void borderselect_mesh(Key *key)
|
|||||||
int (*select_function)(BezTriple *);
|
int (*select_function)(BezTriple *);
|
||||||
IpoCurve *icu;
|
IpoCurve *icu;
|
||||||
|
|
||||||
markers = get_saction_markers(G.saction);
|
|
||||||
|
|
||||||
if ( (val = get_border(&rect, 3)) ){
|
if ( (val = get_border(&rect, 3)) ){
|
||||||
/* set the selection function based on what
|
/* set the selection function based on what
|
||||||
@@ -852,8 +849,8 @@ void borderselect_mesh(Key *key)
|
|||||||
else {
|
else {
|
||||||
selectmode = SELECT_SUBTRACT;
|
selectmode = SELECT_SUBTRACT;
|
||||||
select_function = select_bezier_subtract;
|
select_function = select_bezier_subtract;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* get the minimum and maximum adrcode numbers
|
/* get the minimum and maximum adrcode numbers
|
||||||
* for the IpoCurves (this is the number that
|
* for the IpoCurves (this is the number that
|
||||||
* relates an IpoCurve to the keyblock it
|
* relates an IpoCurve to the keyblock it
|
||||||
@@ -868,7 +865,10 @@ void borderselect_mesh(Key *key)
|
|||||||
mval[1]= rect.ymax-2;
|
mval[1]= rect.ymax-2;
|
||||||
adrcodemin = get_nearest_key_num(key, mval, &xmax);
|
adrcodemin = get_nearest_key_num(key, mval, &xmax);
|
||||||
adrcodemin = (adrcodemin < 1) ? 1 : adrcodemin;
|
adrcodemin = (adrcodemin < 1) ? 1 : adrcodemin;
|
||||||
|
|
||||||
|
/* do markers first */
|
||||||
|
borderselect_markers(rect.xmin, rect.xmax, selectmode);
|
||||||
|
|
||||||
/* Lets loop throug the IpoCurves and do borderselect
|
/* Lets loop throug the IpoCurves and do borderselect
|
||||||
* on the curves with adrcodes in our selected range.
|
* on the curves with adrcodes in our selected range.
|
||||||
*/
|
*/
|
||||||
@@ -884,16 +884,13 @@ void borderselect_mesh(Key *key)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* do markers too if any */
|
|
||||||
if (markers != NULL)
|
|
||||||
borderselect_saction_markers(markers, xmin, xmax, selectmode);
|
|
||||||
|
|
||||||
/* redraw stuff */
|
/* redraw stuff */
|
||||||
BIF_undo_push("Border select Action Key");
|
BIF_undo_push("Border select Action Key");
|
||||||
allqueue(REDRAWNLA, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWIPO, 0);
|
allqueue(REDRAWIPO, 0);
|
||||||
if (markers != NULL) allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2089,7 +2086,7 @@ static void set_snap_meshchannels(Key *key, short snaptype)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void snap_keys_to_frame()
|
void snap_keys_to_frame(int snap_mode)
|
||||||
{
|
{
|
||||||
/* This function is the generic entry-point for snapping keyframes
|
/* This function is the generic entry-point for snapping keyframes
|
||||||
* to a frame(s). It passes the work off to sub-functions for the
|
* to a frame(s). It passes the work off to sub-functions for the
|
||||||
@@ -2099,26 +2096,20 @@ void snap_keys_to_frame()
|
|||||||
SpaceAction *saction;
|
SpaceAction *saction;
|
||||||
bAction *act;
|
bAction *act;
|
||||||
Key *key;
|
Key *key;
|
||||||
short event;
|
|
||||||
|
|
||||||
/* get data */
|
/* get data */
|
||||||
saction= curarea->spacedata.first;
|
saction= curarea->spacedata.first;
|
||||||
if (!saction) return;
|
if (!saction) return;
|
||||||
act = saction->action;
|
act = saction->action;
|
||||||
key = get_action_mesh_key();
|
key = get_action_mesh_key();
|
||||||
|
|
||||||
/* find the type of snapping to do */
|
|
||||||
if (act || key)
|
|
||||||
event = pupmenu("Snap Frames To%t|Nearest Frame%x1|Current Frame%x2");
|
|
||||||
else return;
|
|
||||||
|
|
||||||
/* handle events */
|
/* handle events */
|
||||||
switch (event) {
|
switch (snap_mode) {
|
||||||
case 1: /* snap to nearest frame */
|
case 1: /* snap to nearest frame */
|
||||||
if (act)
|
if (act)
|
||||||
set_snap_actionchannels(act, event);
|
set_snap_actionchannels(act, snap_mode);
|
||||||
else
|
else
|
||||||
set_snap_meshchannels(key, event);
|
set_snap_meshchannels(key, snap_mode);
|
||||||
|
|
||||||
/* Clean up and redraw stuff */
|
/* Clean up and redraw stuff */
|
||||||
remake_action_ipos (act);
|
remake_action_ipos (act);
|
||||||
@@ -2131,9 +2122,9 @@ void snap_keys_to_frame()
|
|||||||
break;
|
break;
|
||||||
case 2: /* snap to current frame */
|
case 2: /* snap to current frame */
|
||||||
if (act)
|
if (act)
|
||||||
set_snap_actionchannels(act, event);
|
set_snap_actionchannels(act, snap_mode);
|
||||||
else
|
else
|
||||||
set_snap_meshchannels(key, event);
|
set_snap_meshchannels(key, snap_mode);
|
||||||
|
|
||||||
/* Clean up and redraw stuff */
|
/* Clean up and redraw stuff */
|
||||||
remake_action_ipos (act);
|
remake_action_ipos (act);
|
||||||
@@ -2435,12 +2426,12 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
extern void do_actionbuts(unsigned short event); // drawaction.c
|
extern void do_actionbuts(unsigned short event); // drawaction.c
|
||||||
SpaceAction *saction;
|
SpaceAction *saction;
|
||||||
bAction *act;
|
bAction *act;
|
||||||
ListBase *markers;
|
|
||||||
Key *key;
|
Key *key;
|
||||||
float dx,dy;
|
float dx,dy;
|
||||||
int doredraw= 0;
|
int doredraw= 0;
|
||||||
int cfra;
|
int cfra;
|
||||||
short mval[2];
|
short mval[2];
|
||||||
|
short nr;
|
||||||
unsigned short event= evt->event;
|
unsigned short event= evt->event;
|
||||||
short val= evt->val;
|
short val= evt->val;
|
||||||
short mousebut = L_MOUSE;
|
short mousebut = L_MOUSE;
|
||||||
@@ -2450,8 +2441,6 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
saction= curarea->spacedata.first;
|
saction= curarea->spacedata.first;
|
||||||
if (!saction)
|
if (!saction)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
markers = get_saction_markers(saction);
|
|
||||||
|
|
||||||
act=saction->action;
|
act=saction->action;
|
||||||
if(val) {
|
if(val) {
|
||||||
@@ -2489,9 +2478,12 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (G.qual == LR_CTRLKEY) {
|
if (G.qual == LR_CTRLKEY) {
|
||||||
deselect_saction_markers(markers, 1, 0);
|
deselect_markers(1, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deselect_meshchannel_keys(key, 1);
|
deselect_meshchannel_keys(key, 1);
|
||||||
@@ -2511,9 +2503,12 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
}
|
}
|
||||||
else if (mval[0]>ACTWIDTH) {
|
else if (mval[0]>ACTWIDTH) {
|
||||||
if (G.qual == LR_CTRLKEY) {
|
if (G.qual == LR_CTRLKEY) {
|
||||||
deselect_saction_markers(markers, 1, 0);
|
deselect_markers (1, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
deselect_actionchannel_keys (act, 1);
|
deselect_actionchannel_keys (act, 1);
|
||||||
@@ -2579,26 +2574,34 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DKEY:
|
case DKEY:
|
||||||
if (key) {
|
if (mval[0]>ACTWIDTH) {
|
||||||
if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH) {
|
if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY)) {
|
||||||
duplicate_meshchannel_keys(key);
|
duplicate_marker();
|
||||||
}
|
}
|
||||||
}
|
else if (G.qual == LR_SHIFTKEY) {
|
||||||
else if (act) {
|
if (key) {
|
||||||
if (G.qual & LR_SHIFTKEY && mval[0]>ACTWIDTH){
|
duplicate_meshchannel_keys(key);
|
||||||
duplicate_actionchannel_keys();
|
}
|
||||||
remake_action_ipos(act);
|
else if (act) {
|
||||||
|
duplicate_actionchannel_keys();
|
||||||
|
remake_action_ipos(act);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GKEY:
|
case GKEY:
|
||||||
if (mval[0]>=ACTWIDTH) {
|
if (G.qual & LR_SHIFTKEY) {
|
||||||
if (key) {
|
transform_markers('g', 0);
|
||||||
transform_meshchannel_keys('g', key);
|
}
|
||||||
}
|
else {
|
||||||
else if (act) {
|
if (mval[0]>=ACTWIDTH) {
|
||||||
transform_actionchannel_keys ('g', 0);
|
if (key) {
|
||||||
|
transform_meshchannel_keys('g', key);
|
||||||
|
}
|
||||||
|
else if (act) {
|
||||||
|
transform_actionchannel_keys ('g', 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -2636,25 +2639,17 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
|
|
||||||
case MKEY:
|
case MKEY:
|
||||||
/* marker operations */
|
/* marker operations */
|
||||||
if (markers != NULL) {
|
if (G.qual == 0)
|
||||||
if (G.qual == 0)
|
add_marker(CFRA);
|
||||||
add_saction_marker(markers, CFRA);
|
else if (G.qual == LR_SHIFTKEY)
|
||||||
else if (G.qual == LR_ALTKEY) {
|
rename_marker();
|
||||||
if( okee("Erase selected markers")==0 )
|
else
|
||||||
break;
|
break;
|
||||||
remove_saction_markers(markers);
|
allqueue(REDRAWTIME, 0);
|
||||||
}
|
allqueue(REDRAWIPO, 0);
|
||||||
else if (G.qual == LR_CTRLKEY)
|
allqueue(REDRAWACTION, 0);
|
||||||
rename_saction_markers(markers);
|
allqueue(REDRAWNLA, 0);
|
||||||
else if (G.qual == LR_SHIFTKEY)
|
allqueue(REDRAWSOUND, 0);
|
||||||
transform_saction_markers('g', 0);
|
|
||||||
else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
|
|
||||||
duplicate_saction_markers(markers);
|
|
||||||
else
|
|
||||||
break;
|
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case NKEY:
|
case NKEY:
|
||||||
@@ -2677,7 +2672,8 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
case SKEY:
|
case SKEY:
|
||||||
if (mval[0]>=ACTWIDTH) {
|
if (mval[0]>=ACTWIDTH) {
|
||||||
if(G.qual & LR_SHIFTKEY) {
|
if(G.qual & LR_SHIFTKEY) {
|
||||||
snap_keys_to_frame();
|
val = pupmenu("Snap Keys To%t|Nearest Frame%x1|Current Frame%x2");
|
||||||
|
snap_keys_to_frame(val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (key)
|
if (key)
|
||||||
@@ -2713,7 +2709,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
case PAGEUPKEY:
|
case PAGEUPKEY:
|
||||||
if (key) {
|
if (key) {
|
||||||
/* only jump to markers possible (key channels can't be moved yet) */
|
/* only jump to markers possible (key channels can't be moved yet) */
|
||||||
nextprev_saction_markers(markers, 1);
|
nextprev_marker(1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(G.qual & LR_SHIFTKEY)
|
if(G.qual & LR_SHIFTKEY)
|
||||||
@@ -2721,13 +2717,13 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
else if (G.qual & LR_CTRLKEY)
|
else if (G.qual & LR_CTRLKEY)
|
||||||
up_sel_action();
|
up_sel_action();
|
||||||
else
|
else
|
||||||
nextprev_saction_markers(markers, 1);
|
nextprev_marker(1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case PAGEDOWNKEY:
|
case PAGEDOWNKEY:
|
||||||
if (key) {
|
if (key) {
|
||||||
/* only jump to markers possible (key channels can't be moved yet) */
|
/* only jump to markers possible (key channels can't be moved yet) */
|
||||||
nextprev_saction_markers(markers, -1);
|
nextprev_marker(-1);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if(G.qual & LR_SHIFTKEY)
|
if(G.qual & LR_SHIFTKEY)
|
||||||
@@ -2735,19 +2731,33 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
else if (G.qual & LR_CTRLKEY)
|
else if (G.qual & LR_CTRLKEY)
|
||||||
down_sel_action();
|
down_sel_action();
|
||||||
else
|
else
|
||||||
nextprev_saction_markers(markers, -1);
|
nextprev_marker(-1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DELKEY:
|
case DELKEY:
|
||||||
case XKEY:
|
case XKEY:
|
||||||
if (key) {
|
nr= pupmenu("Erase selected%t|Keys %x1|Markers %x2|Both %x3");
|
||||||
delete_meshchannel_keys(key);
|
if (nr>0) {
|
||||||
}
|
if (nr==1||nr==3) {
|
||||||
else {
|
if (key) {
|
||||||
if (mval[0]<NAMEWIDTH)
|
delete_meshchannel_keys(key);
|
||||||
delete_actionchannels ();
|
}
|
||||||
else
|
else {
|
||||||
delete_actionchannel_keys ();
|
if (mval[0]<NAMEWIDTH)
|
||||||
|
delete_actionchannels();
|
||||||
|
else
|
||||||
|
delete_actionchannel_keys();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nr==2) {
|
||||||
|
remove_marker();
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
|
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
|
||||||
@@ -2913,351 +2923,14 @@ int get_nearest_key_num(Key *key, short *mval, float *x) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************* Action Editor Markers ************************************* */
|
/* ************************************* Action Editor Markers ************************************* */
|
||||||
|
void get_minmax_saction_markers(float *first, float *last)
|
||||||
/* returns the current active markers */
|
|
||||||
ListBase *get_saction_markers (SpaceAction *saction)
|
|
||||||
{
|
{
|
||||||
|
TimeMarker *marker;
|
||||||
ListBase *markers;
|
ListBase *markers;
|
||||||
|
|
||||||
// if (saction->markert == SACTION_SCMARKERS)
|
|
||||||
markers = &(G.scene->markers);
|
|
||||||
// else if ((saction->markert == SACTION_ACMARKERS) && (saction->action != NULL))
|
|
||||||
// markers = &(saction->action->markers);
|
|
||||||
// else
|
|
||||||
// markers = NULL;
|
|
||||||
|
|
||||||
return markers;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add a TimeMarker - code basically taken from edittime.c */
|
|
||||||
void add_saction_marker (ListBase *markers, int frame)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* two markers can't be at the same place */
|
|
||||||
for(marker= markers->first; marker; marker= marker->next)
|
|
||||||
if(marker->frame == frame) return;
|
|
||||||
/* deselect all */
|
|
||||||
for(marker= markers->first; marker; marker= marker->next)
|
|
||||||
marker->flag &= ~SELECT;
|
|
||||||
|
|
||||||
marker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
|
|
||||||
marker->flag= SELECT;
|
|
||||||
marker->frame= frame;
|
|
||||||
BLI_addtail(markers, marker);
|
|
||||||
|
|
||||||
BIF_undo_push("Add Marker");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* remove a TimeMarker - code basically taken from edittime.c */
|
|
||||||
void remove_saction_markers(ListBase *markers)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT){
|
|
||||||
BLI_freelinkN(markers, marker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BIF_undo_push("Remove Marker");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* rename a TimeMarker - code basically taken from edittime.c */
|
|
||||||
void rename_saction_markers(ListBase *markers)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
char name[64];
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
sprintf(name, marker->name);
|
|
||||||
if (sbutton(name, 0, sizeof(name)-1, "Name: "))
|
|
||||||
BLI_strncpy(marker->name, name, sizeof(marker->name));
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BIF_undo_push("Rename Marker");
|
|
||||||
}
|
|
||||||
|
|
||||||
/* duplicate selected TimeMarkers - code basically taken from edittime.c */
|
|
||||||
void duplicate_saction_markers(ListBase *markers)
|
|
||||||
{
|
|
||||||
TimeMarker *marker, *newmarker;
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* go through the list of markers, duplicate selected markers and add duplicated copies
|
|
||||||
* to the begining of the list (unselect original markers) */
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT){
|
|
||||||
/* unselect selected marker */
|
|
||||||
marker->flag &= ~SELECT;
|
|
||||||
/* create and set up new marker */
|
|
||||||
newmarker = MEM_callocN(sizeof(TimeMarker), "TimeMarker");
|
|
||||||
newmarker->flag= SELECT;
|
|
||||||
newmarker->frame= marker->frame;
|
|
||||||
BLI_strncpy(newmarker->name, marker->name, sizeof(marker->name));
|
|
||||||
/* new marker is added to the begining of list */
|
|
||||||
BLI_addhead(markers, newmarker);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
transform_saction_markers('g', 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
void transform_saction_markers(int mode, int smode) // mode and smode unused here, for callback
|
|
||||||
{
|
|
||||||
SpaceAction *saction= curarea->spacedata.first;
|
|
||||||
TimeMarker *marker, *selmarker=NULL;
|
|
||||||
ListBase *markers;
|
|
||||||
float dx, fac;
|
|
||||||
int a, ret_val= 0, totmark=0, *oldframe, offs, firsttime=1;
|
|
||||||
unsigned short event;
|
|
||||||
short val, pmval[2], mval[2], mvalo[2];
|
|
||||||
char str[32];
|
|
||||||
|
|
||||||
markers= get_saction_markers(saction);
|
|
||||||
if (markers == NULL) return;
|
|
||||||
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) totmark++;
|
|
||||||
}
|
|
||||||
if(totmark==0) return;
|
|
||||||
|
|
||||||
oldframe= MEM_mallocN(totmark*sizeof(int), "marker array");
|
|
||||||
for(a=0, marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
oldframe[a]= marker->frame;
|
|
||||||
selmarker= marker; // used for hederprint
|
|
||||||
a++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dx= G.v2d->mask.xmax-G.v2d->mask.xmin;
|
|
||||||
dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/dx;
|
|
||||||
|
|
||||||
getmouseco_areawin(pmval);
|
|
||||||
mvalo[0]= pmval[0];
|
|
||||||
|
|
||||||
while(ret_val == 0) {
|
|
||||||
|
|
||||||
getmouseco_areawin(mval);
|
|
||||||
|
|
||||||
if (mval[0] != mvalo[0] || firsttime) {
|
|
||||||
mvalo[0]= mval[0];
|
|
||||||
firsttime= 0;
|
|
||||||
|
|
||||||
fac= (((float)(mval[0] - pmval[0]))*dx);
|
|
||||||
|
|
||||||
apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
|
|
||||||
offs= (int)fac;
|
|
||||||
|
|
||||||
for(a=0, marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
marker->frame= oldframe[a] + offs;
|
|
||||||
a++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(totmark==1) // we print current marker value
|
|
||||||
sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs));
|
|
||||||
else
|
|
||||||
sprintf(str, "Marker offset %.2f ", (double)(offs));
|
|
||||||
|
|
||||||
headerprint(str);
|
|
||||||
|
|
||||||
force_draw(0); // areas identical to this, 0 = no header
|
|
||||||
}
|
|
||||||
else PIL_sleep_ms(10); // idle
|
|
||||||
|
|
||||||
/* emptying queue and reading events */
|
|
||||||
while( qtest() ) {
|
|
||||||
event= extern_qread(&val);
|
|
||||||
|
|
||||||
if(val) {
|
|
||||||
if(event==ESCKEY || event==RIGHTMOUSE) ret_val= 2;
|
|
||||||
else if(event==LEFTMOUSE || event==RETKEY || event==SPACEKEY) ret_val= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* restore? */
|
|
||||||
if(ret_val==2) {
|
|
||||||
for(a=0, marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
marker->frame= oldframe[a];
|
|
||||||
a++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BIF_undo_push("Move Markers");
|
|
||||||
}
|
|
||||||
MEM_freeN(oldframe);
|
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
TimeMarker *find_nearest_saction_marker(ListBase *markers)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
float xmin, xmax;
|
|
||||||
rctf rectf;
|
|
||||||
short mval[2];
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
getmouseco_areawin (mval);
|
|
||||||
|
|
||||||
/* first clip selection in Y */
|
|
||||||
if(mval[1] > 30)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
mval[0]-=7;
|
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
|
||||||
mval[0]+=14;
|
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
|
||||||
|
|
||||||
xmin= rectf.xmin;
|
|
||||||
xmax= rectf.xmax;
|
|
||||||
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if ((marker->frame > xmin) && (marker->frame <= xmax)) {
|
|
||||||
return marker;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* select next/previous marker */
|
|
||||||
void nextprev_saction_markers(ListBase *markers, short dir)
|
|
||||||
{
|
|
||||||
TimeMarker *marker, *cur=NULL, *first, *last;
|
|
||||||
int mindist= MAXFRAME, dist;
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
first= last= markers->first;
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
/* find closest to current frame first */
|
|
||||||
dist= (marker->frame/G.scene->r.framelen) - CFRA;
|
|
||||||
if(dir==1 && dist>0 && dist<mindist) {
|
|
||||||
mindist= dist;
|
|
||||||
cur= marker;
|
|
||||||
}
|
|
||||||
else if(dir==-1 && dist<0 && -dist<mindist) {
|
|
||||||
mindist= -dist;
|
|
||||||
cur= marker;
|
|
||||||
}
|
|
||||||
/* find first/last */
|
|
||||||
if(marker->frame > last->frame) last= marker;
|
|
||||||
if(marker->frame < first->frame) first= marker;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(cur==NULL) {
|
|
||||||
if(dir==1) cur= first;
|
|
||||||
else cur= last;
|
|
||||||
}
|
|
||||||
if(cur) {
|
|
||||||
CFRA= cur->frame/G.scene->r.framelen;
|
|
||||||
update_for_newframe();
|
|
||||||
allqueue(REDRAWALL, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* select/deselect all TimeMarkers */
|
|
||||||
void deselect_saction_markers(ListBase *markers, short test, short sel)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* check if need to find out whether to how to select markers */
|
|
||||||
if (test) {
|
|
||||||
/* dependant on existing selection */
|
|
||||||
/* determine if select all or deselect all */
|
|
||||||
sel = 1;
|
|
||||||
for (marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if (marker->flag & SELECT) {
|
|
||||||
sel = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* do selection */
|
|
||||||
for (marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if (sel) {
|
|
||||||
if ((marker->flag & SELECT)==0)
|
|
||||||
marker->flag |= SELECT;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (marker->flag & SELECT)
|
|
||||||
marker->flag &= ~SELECT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
/* not dependant on existing selection */
|
|
||||||
for (marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if (sel) {
|
|
||||||
if ((marker->flag & SELECT)==0)
|
|
||||||
marker->flag |= SELECT;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if (marker->flag & SELECT)
|
|
||||||
marker->flag &= ~SELECT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void borderselect_saction_markers(ListBase *markers, float xmin, float xmax, int selectmode)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
for(marker= markers->first; marker; marker= marker->next) {
|
|
||||||
if ((marker->frame > xmin) && (marker->frame <= xmax)) {
|
|
||||||
switch (selectmode) {
|
|
||||||
case SELECT_ADD:
|
|
||||||
if ((marker->flag & SELECT) == 0)
|
|
||||||
marker->flag |= SELECT;
|
|
||||||
break;
|
|
||||||
case SELECT_SUBTRACT:
|
|
||||||
if (marker->flag & SELECT)
|
|
||||||
marker->flag &= ~SELECT;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void get_minmax_saction_markers(ListBase *markers, float *first, float *last)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
float min, max;
|
float min, max;
|
||||||
|
|
||||||
if (!markers)
|
markers= &(G.scene->markers);
|
||||||
return;
|
|
||||||
|
|
||||||
min= ((TimeMarker *)markers->first)->frame;
|
min= ((TimeMarker *)markers->first)->frame;
|
||||||
max= ((TimeMarker *)markers->last)->frame;
|
max= ((TimeMarker *)markers->last)->frame;
|
||||||
|
|
||||||
|
|||||||
@@ -111,6 +111,7 @@
|
|||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
#include "BSE_node.h"
|
#include "BSE_node.h"
|
||||||
#include "BSE_sequence.h"
|
#include "BSE_sequence.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "blendef.h"
|
#include "blendef.h"
|
||||||
#include "mydevice.h"
|
#include "mydevice.h"
|
||||||
@@ -1360,6 +1361,7 @@ void mouse_select_ipo(void)
|
|||||||
IpoCurve *icu;
|
IpoCurve *icu;
|
||||||
IpoKey *ik, *actik;
|
IpoKey *ik, *actik;
|
||||||
BezTriple *bezt;
|
BezTriple *bezt;
|
||||||
|
TimeMarker *marker;
|
||||||
float x, y, dist, mindist;
|
float x, y, dist, mindist;
|
||||||
int a, oldflag = 0, hand, ok;
|
int a, oldflag = 0, hand, ok;
|
||||||
short mval[2], xo, yo;
|
short mval[2], xo, yo;
|
||||||
@@ -1367,6 +1369,7 @@ void mouse_select_ipo(void)
|
|||||||
if(G.sipo->editipo==0) return;
|
if(G.sipo->editipo==0) return;
|
||||||
|
|
||||||
get_status_editipo();
|
get_status_editipo();
|
||||||
|
marker=find_nearest_marker(1);
|
||||||
|
|
||||||
if(G.sipo->showkey) {
|
if(G.sipo->showkey) {
|
||||||
getmouseco_areawin(mval);
|
getmouseco_areawin(mval);
|
||||||
@@ -1435,6 +1438,21 @@ void mouse_select_ipo(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (marker) {
|
||||||
|
/* select timeline marker */
|
||||||
|
if ((G.qual & LR_SHIFTKEY)==0) {
|
||||||
|
oldflag= marker->flag;
|
||||||
|
deselect_markers(0, 0);
|
||||||
|
|
||||||
|
if (oldflag & SELECT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
else
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
|
|
||||||
/* vertex keys ? */
|
/* vertex keys ? */
|
||||||
@@ -1532,8 +1550,13 @@ void mouse_select_ipo(void)
|
|||||||
getmouseco_areawin(mval);
|
getmouseco_areawin(mval);
|
||||||
if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
|
if(abs(mval[0]-xo)+abs(mval[1]-yo) > 4) {
|
||||||
|
|
||||||
if(actkb) move_keys(OBACT);
|
if (marker) {
|
||||||
else transform_ipo('g');
|
transform_markers('g', 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if(actkb) move_keys(OBACT);
|
||||||
|
else transform_ipo('g');
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -3581,7 +3604,7 @@ void del_ipoCurve ( IpoCurve * icu )
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void del_ipo(void)
|
void del_ipo(int need_check)
|
||||||
{
|
{
|
||||||
EditIpo *ei;
|
EditIpo *ei;
|
||||||
BezTriple *bezt, *bezt1;
|
BezTriple *bezt, *bezt1;
|
||||||
@@ -3592,12 +3615,17 @@ void del_ipo(void)
|
|||||||
if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
|
if(G.sipo->ipo && G.sipo->ipo->id.lib) return;
|
||||||
|
|
||||||
if(totipo_edit==0 && totipo_sel==0 && totipo_vertsel==0) {
|
if(totipo_edit==0 && totipo_sel==0 && totipo_vertsel==0) {
|
||||||
if(okee("Erase selected keys"))
|
if (need_check) {
|
||||||
delete_key(OBACT);
|
if(okee("Erase selected keys"))
|
||||||
|
delete_key(OBACT);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
delete_key(OBACT);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( okee("Erase selected")==0 ) return;
|
if (need_check)
|
||||||
|
if( okee("Erase selected")==0 ) return;
|
||||||
|
|
||||||
// first round, can we delete entire parts?
|
// first round, can we delete entire parts?
|
||||||
ei= G.sipo->editipo;
|
ei= G.sipo->editipo;
|
||||||
|
|||||||
@@ -67,6 +67,7 @@
|
|||||||
#include "BSE_editipo.h"
|
#include "BSE_editipo.h"
|
||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_trans_types.h"
|
#include "BSE_trans_types.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "BDR_drawobject.h"
|
#include "BDR_drawobject.h"
|
||||||
|
|
||||||
@@ -771,7 +772,10 @@ void borderselect_ipo(void)
|
|||||||
mval[0]= rect.xmax;
|
mval[0]= rect.xmax;
|
||||||
mval[1]= rect.ymax;
|
mval[1]= rect.ymax;
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
|
/* do markers first */
|
||||||
|
borderselect_markers(rectf.xmin, rectf.xmax, val);
|
||||||
|
|
||||||
if(G.sipo->showkey) {
|
if(G.sipo->showkey) {
|
||||||
ik= G.sipo->ipokey.first;
|
ik= G.sipo->ipokey.first;
|
||||||
while(ik) {
|
while(ik) {
|
||||||
@@ -812,7 +816,11 @@ void borderselect_ipo(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIF_undo_push("Border select Ipo");
|
BIF_undo_push("Border select Ipo");
|
||||||
scrarea_queue_winredraw(curarea);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -81,6 +81,7 @@
|
|||||||
#include "BSE_filesel.h"
|
#include "BSE_filesel.h"
|
||||||
#include "BDR_editobject.h"
|
#include "BDR_editobject.h"
|
||||||
#include "BSE_drawnla.h"
|
#include "BSE_drawnla.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "blendef.h"
|
#include "blendef.h"
|
||||||
#include "mydevice.h"
|
#include "mydevice.h"
|
||||||
@@ -229,7 +230,7 @@ void reset_action_strips(int val)
|
|||||||
allqueue (REDRAWNLA, 0);
|
allqueue (REDRAWNLA, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
void snap_action_strips(void)
|
void snap_action_strips(int snap_mode)
|
||||||
{
|
{
|
||||||
Base *base;
|
Base *base;
|
||||||
bActionStrip *strip;
|
bActionStrip *strip;
|
||||||
@@ -237,8 +238,25 @@ void snap_action_strips(void)
|
|||||||
for (base=G.scene->base.first; base; base=base->next) {
|
for (base=G.scene->base.first; base; base=base->next) {
|
||||||
for (strip = base->object->nlastrips.last; strip; strip=strip->prev) {
|
for (strip = base->object->nlastrips.last; strip; strip=strip->prev) {
|
||||||
if (strip->flag & ACTSTRIP_SELECT) {
|
if (strip->flag & ACTSTRIP_SELECT) {
|
||||||
strip->start= floor(strip->start+0.5);
|
if (snap_mode==1) {
|
||||||
strip->end= floor(strip->end+0.5);
|
/* nearest frame */
|
||||||
|
strip->start= floor(strip->start+0.5);
|
||||||
|
strip->end= floor(strip->end+0.5);
|
||||||
|
}
|
||||||
|
else if (snap_mode==2) {
|
||||||
|
/* current frame */
|
||||||
|
float diff;
|
||||||
|
if (CFRA < strip->start) {
|
||||||
|
diff = (strip->start - CFRA);
|
||||||
|
strip->start -= diff;
|
||||||
|
strip->end -= diff;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
diff = (CFRA - strip->start);
|
||||||
|
strip->start += diff;
|
||||||
|
strip->end += diff;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -953,10 +971,7 @@ void delete_nlachannel_keys(void)
|
|||||||
bActionChannel *chan;
|
bActionChannel *chan;
|
||||||
bConstraintChannel *conchan;
|
bConstraintChannel *conchan;
|
||||||
bActionStrip *strip, *nextstrip;
|
bActionStrip *strip, *nextstrip;
|
||||||
|
|
||||||
if (!okee("Erase selected strips and/or keys"))
|
|
||||||
return;
|
|
||||||
|
|
||||||
for (base = G.scene->base.first; base; base=base->next){
|
for (base = G.scene->base.first; base; base=base->next){
|
||||||
|
|
||||||
/* Delete object ipos */
|
/* Delete object ipos */
|
||||||
@@ -1059,11 +1074,11 @@ void borderselect_nla(void)
|
|||||||
bConstraintChannel *conchan;
|
bConstraintChannel *conchan;
|
||||||
|
|
||||||
if ( (val = get_border (&rect, 3)) ){
|
if ( (val = get_border (&rect, 3)) ){
|
||||||
if (val == LEFTMOUSE)
|
if (val == LEFTMOUSE)
|
||||||
selectmode = SELECT_ADD;
|
selectmode = SELECT_ADD;
|
||||||
else
|
else
|
||||||
selectmode = SELECT_SUBTRACT;
|
selectmode = SELECT_SUBTRACT;
|
||||||
|
|
||||||
mval[0]= rect.xmin;
|
mval[0]= rect.xmin;
|
||||||
mval[1]= rect.ymin+2;
|
mval[1]= rect.ymin+2;
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
||||||
@@ -1071,6 +1086,9 @@ void borderselect_nla(void)
|
|||||||
mval[1]= rect.ymax-2;
|
mval[1]= rect.ymax-2;
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
|
/* do markers first */
|
||||||
|
borderselect_markers(rectf.xmin, rectf.xmax, selectmode);
|
||||||
|
|
||||||
ymax = count_nla_levels();
|
ymax = count_nla_levels();
|
||||||
ymax*= (NLACHANNELHEIGHT+NLACHANNELSKIP);
|
ymax*= (NLACHANNELHEIGHT+NLACHANNELSKIP);
|
||||||
ymax+= (NLACHANNELHEIGHT+NLACHANNELSKIP)/2;
|
ymax+= (NLACHANNELHEIGHT+NLACHANNELSKIP)/2;
|
||||||
@@ -1136,9 +1154,11 @@ void borderselect_nla(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
BIF_undo_push("Border select NLA");
|
BIF_undo_push("Border select NLA");
|
||||||
allqueue(REDRAWNLA, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWIPO, 0);
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1150,6 +1170,7 @@ static void mouse_nla(int selectmode)
|
|||||||
bActionChannel *chan;
|
bActionChannel *chan;
|
||||||
bActionStrip *rstrip;
|
bActionStrip *rstrip;
|
||||||
bConstraintChannel *conchan;
|
bConstraintChannel *conchan;
|
||||||
|
TimeMarker *marker;
|
||||||
float selx;
|
float selx;
|
||||||
short mval[2];
|
short mval[2];
|
||||||
short sel, isdone=0;
|
short sel, isdone=0;
|
||||||
@@ -1158,6 +1179,7 @@ static void mouse_nla(int selectmode)
|
|||||||
|
|
||||||
/* Try object ipo or ob-constraint ipo selection */
|
/* Try object ipo or ob-constraint ipo selection */
|
||||||
base= get_nearest_nlachannel_ob_key(&selx, &sel);
|
base= get_nearest_nlachannel_ob_key(&selx, &sel);
|
||||||
|
marker=find_nearest_marker(1);
|
||||||
if (base) {
|
if (base) {
|
||||||
isdone= 1;
|
isdone= 1;
|
||||||
|
|
||||||
@@ -1172,6 +1194,31 @@ static void mouse_nla(int selectmode)
|
|||||||
for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
|
for (conchan=base->object->constraintChannels.first; conchan; conchan=conchan->next)
|
||||||
select_ipo_key(conchan->ipo, selx, selectmode);
|
select_ipo_key(conchan->ipo, selx, selectmode);
|
||||||
}
|
}
|
||||||
|
else if (marker) {
|
||||||
|
/* marker */
|
||||||
|
if (selectmode == SELECT_REPLACE) {
|
||||||
|
deselect_markers(0, 0);
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
else if (selectmode == SELECT_INVERT) {
|
||||||
|
if (marker->flag & SELECT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
else
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
else if (selectmode == SELECT_ADD)
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
else if (selectmode == SELECT_SUBTRACT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
|
||||||
|
std_rmouse_transform(transform_markers);
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
/* Try action ipo selection */
|
/* Try action ipo selection */
|
||||||
act= get_nearest_nlachannel_ac_key(&selx, &sel);
|
act= get_nearest_nlachannel_ac_key(&selx, &sel);
|
||||||
@@ -1606,21 +1653,53 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case EQUALKEY:
|
case EQUALKEY:
|
||||||
case PAGEUPKEY:
|
|
||||||
shift_nlastrips_up();
|
shift_nlastrips_up();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAGEUPKEY:
|
||||||
|
if (G.qual & LR_CTRLKEY)
|
||||||
|
shift_nlastrips_up();
|
||||||
|
else {
|
||||||
|
nextprev_marker(1);
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case MINUSKEY:
|
case MINUSKEY:
|
||||||
case PAGEDOWNKEY:
|
|
||||||
shift_nlastrips_down();
|
shift_nlastrips_down();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAGEDOWNKEY:
|
||||||
|
if (G.qual & LR_CTRLKEY)
|
||||||
|
shift_nlastrips_down();
|
||||||
|
else {
|
||||||
|
nextprev_marker(-1);
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case AKEY:
|
case AKEY:
|
||||||
if (G.qual & LR_SHIFTKEY){
|
if (G.qual & LR_SHIFTKEY){
|
||||||
add_nlablock();
|
add_nlablock();
|
||||||
allqueue (REDRAWNLA, 0);
|
allqueue (REDRAWNLA, 0);
|
||||||
allqueue (REDRAWVIEW3D, 0);
|
allqueue (REDRAWVIEW3D, 0);
|
||||||
}
|
}
|
||||||
|
else if (G.qual & LR_CTRLKEY) {
|
||||||
|
deselect_markers(1, 0);
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
else{
|
else{
|
||||||
if (mval[0]>=NLAWIDTH)
|
if (mval[0]>=NLAWIDTH)
|
||||||
deselect_nlachannel_keys(1);
|
deselect_nlachannel_keys(1);
|
||||||
@@ -1656,18 +1735,48 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case DKEY:
|
case DKEY:
|
||||||
if (G.qual & LR_SHIFTKEY && mval[0]>=NLAWIDTH){
|
if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY) && mval[0]>=NLAWIDTH) {
|
||||||
|
duplicate_marker();
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
else if (G.qual & LR_SHIFTKEY && mval[0]>=NLAWIDTH){
|
||||||
duplicate_nlachannel_keys();
|
duplicate_nlachannel_keys();
|
||||||
update_for_newframe_muted();
|
update_for_newframe_muted();
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GKEY:
|
case GKEY:
|
||||||
if (mval[0]>=NLAWIDTH)
|
if (mval[0]>=NLAWIDTH) {
|
||||||
transform_nlachannel_keys ('g', 0);
|
if (G.qual & LR_SHIFTKEY) {
|
||||||
update_for_newframe_muted();
|
transform_markers('g', 0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
transform_nlachannel_keys ('g', 0);
|
||||||
|
update_for_newframe_muted();
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case MKEY:
|
||||||
|
/* marker operations */
|
||||||
|
if (G.qual == 0)
|
||||||
|
add_marker(CFRA);
|
||||||
|
else if (G.qual == LR_SHIFTKEY)
|
||||||
|
rename_marker();
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
case NKEY:
|
case NKEY:
|
||||||
if(G.qual==0) {
|
if(G.qual==0) {
|
||||||
toggle_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
toggle_blockhandler(curarea, NLA_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
||||||
@@ -1687,8 +1796,9 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
reset_action_strips(2);
|
reset_action_strips(2);
|
||||||
}
|
}
|
||||||
else if(G.qual & LR_SHIFTKEY) {
|
else if(G.qual & LR_SHIFTKEY) {
|
||||||
if(okee("Snap Strips to Frame"))
|
val= pupmenu("Snap To%t|Nearest Frame%x1|Current Frame%x2");
|
||||||
snap_action_strips();
|
if (val==1 || val==2)
|
||||||
|
snap_action_strips(val);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (mval[0]>=NLAWIDTH)
|
if (mval[0]>=NLAWIDTH)
|
||||||
@@ -1699,10 +1809,22 @@ void winqreadnlaspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
|
|
||||||
case DELKEY:
|
case DELKEY:
|
||||||
case XKEY:
|
case XKEY:
|
||||||
if (mval[0]>=NLAWIDTH)
|
if (mval[0]>=NLAWIDTH) {
|
||||||
delete_nlachannel_keys ();
|
val= pupmenu("Erase selected%t|Strips and/or Keys%x1|Markers%x2");
|
||||||
|
if (val==1) {
|
||||||
update_for_newframe_muted();
|
delete_nlachannel_keys();
|
||||||
|
update_for_newframe_muted();
|
||||||
|
}
|
||||||
|
else if (val==2) {
|
||||||
|
remove_marker();
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
|
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
|
||||||
|
|||||||
@@ -73,9 +73,13 @@
|
|||||||
#include "BIF_interface.h"
|
#include "BIF_interface.h"
|
||||||
#include "BIF_editsound.h"
|
#include "BIF_editsound.h"
|
||||||
#include "BIF_mywindow.h"
|
#include "BIF_mywindow.h"
|
||||||
|
#include "BIF_toolbox.h"
|
||||||
|
|
||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
|
#include "BDR_editobject.h"
|
||||||
|
|
||||||
#include "blendef.h"
|
#include "blendef.h"
|
||||||
|
|
||||||
@@ -163,14 +167,28 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
view2dmove(event); /* in drawipo.c */
|
view2dmove(event); /* in drawipo.c */
|
||||||
break;
|
break;
|
||||||
case RIGHTMOUSE:
|
case RIGHTMOUSE:
|
||||||
nr= pupmenu("Time value%t|Frames %x1|Seconds%x2");
|
{
|
||||||
if (nr>0) {
|
TimeMarker *marker;
|
||||||
if(nr==1) ssound->flag |= SND_DRAWFRAMES;
|
|
||||||
else ssound->flag &= ~SND_DRAWFRAMES;
|
getmouseco_areawin(mval);
|
||||||
doredraw= 1;
|
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
|
||||||
}
|
|
||||||
|
|
||||||
|
marker = find_nearest_marker(0);
|
||||||
|
if (marker) {
|
||||||
|
if ((G.qual & LR_SHIFTKEY)==0)
|
||||||
|
deselect_markers(0, 0);
|
||||||
|
|
||||||
|
if (marker->flag & SELECT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
else
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
|
||||||
|
force_draw(0);
|
||||||
|
std_rmouse_transform(transform_markers);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PADPLUSKEY:
|
case PADPLUSKEY:
|
||||||
dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin));
|
dx= (float)(0.1154*(G.v2d->cur.xmax-G.v2d->cur.xmin));
|
||||||
G.v2d->cur.xmin+= dx;
|
G.v2d->cur.xmin+= dx;
|
||||||
@@ -190,6 +208,85 @@ void winqreadsoundspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
case HOMEKEY:
|
case HOMEKEY:
|
||||||
do_sound_buttons(B_SOUNDHOME);
|
do_sound_buttons(B_SOUNDHOME);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case PAGEUPKEY: /* cfra to next marker */
|
||||||
|
nextprev_marker(1);
|
||||||
|
break;
|
||||||
|
case PAGEDOWNKEY: /* cfra to prev marker */
|
||||||
|
nextprev_marker(-1);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case AKEY: /* select/deselect all */
|
||||||
|
deselect_markers(1, 0);
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case BKEY: /* borderselect markers */
|
||||||
|
borderselect_timeline_markers();
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DKEY: /* duplicate selected marker(s) */
|
||||||
|
if (G.qual & LR_SHIFTKEY) {
|
||||||
|
duplicate_marker();
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case GKEY:
|
||||||
|
transform_markers('g', 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case MKEY: /* add marker or rename first selected */
|
||||||
|
if (G.qual & LR_SHIFTKEY)
|
||||||
|
rename_marker();
|
||||||
|
else
|
||||||
|
add_marker(CFRA);
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case TKEY: /* toggle time display */
|
||||||
|
nr= pupmenu("Time value%t|Frames %x1|Seconds%x2");
|
||||||
|
if (nr>0) {
|
||||||
|
if(nr==1) ssound->flag |= SND_DRAWFRAMES;
|
||||||
|
else ssound->flag &= ~SND_DRAWFRAMES;
|
||||||
|
doredraw= 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
break;
|
||||||
|
|
||||||
|
case DELKEY: /* delete selected markers */
|
||||||
|
case XKEY:
|
||||||
|
if (okee("Erase selected")) {
|
||||||
|
remove_marker();
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -63,8 +63,10 @@
|
|||||||
#include "BIF_interface.h"
|
#include "BIF_interface.h"
|
||||||
#include "BIF_toolbox.h"
|
#include "BIF_toolbox.h"
|
||||||
#include "BIF_mywindow.h"
|
#include "BIF_mywindow.h"
|
||||||
|
#include "BIF_editaction.h"
|
||||||
|
|
||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
|
#include "BSE_edit.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
#include "BSE_time.h"
|
#include "BSE_time.h"
|
||||||
|
|
||||||
@@ -79,10 +81,10 @@
|
|||||||
/* declarations */
|
/* declarations */
|
||||||
void winqreadtimespace(ScrArea *, void *, BWinEvent *);
|
void winqreadtimespace(ScrArea *, void *, BWinEvent *);
|
||||||
|
|
||||||
/* ************* Timeline marker code **************** */
|
/* ************* Marker API **************** */
|
||||||
|
|
||||||
/* add TimeMarker at curent frame */
|
/* add TimeMarker at curent frame */
|
||||||
void add_timeline_marker(int frame)
|
void add_marker(int frame)
|
||||||
{
|
{
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
|
|
||||||
@@ -98,29 +100,29 @@ void add_timeline_marker(int frame)
|
|||||||
marker->frame= frame;
|
marker->frame= frame;
|
||||||
BLI_addtail(&(G.scene->markers), marker);
|
BLI_addtail(&(G.scene->markers), marker);
|
||||||
|
|
||||||
BIF_undo_push("Add Timeline Marker");
|
BIF_undo_push("Add Marker");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* remove TimeMarker */
|
/* remove selected TimeMarkers */
|
||||||
void remove_timeline_marker(void)
|
void remove_marker(void)
|
||||||
{
|
{
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
|
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
if(marker->flag & SELECT){
|
if(marker->flag & SELECT){
|
||||||
BLI_freelinkN(&G.scene->markers, marker);
|
BLI_freelinkN(&(G.scene->markers), marker);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BIF_undo_push("Remove Timeline Marker");
|
BIF_undo_push("Remove Marker");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* rename first selected TimeMarker */
|
/* rename first selected TimeMarker */
|
||||||
void rename_timeline_marker(void)
|
void rename_marker(void)
|
||||||
{
|
{
|
||||||
TimeMarker *marker;
|
TimeMarker *marker;
|
||||||
char name[64];
|
char name[64];
|
||||||
|
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
if(marker->flag & SELECT) {
|
if(marker->flag & SELECT) {
|
||||||
sprintf(name, marker->name);
|
sprintf(name, marker->name);
|
||||||
@@ -130,14 +132,14 @@ void rename_timeline_marker(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
BIF_undo_push("Rename Timeline Marker");
|
BIF_undo_push("Rename Marker");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* duplicate selected TimeMarkers */
|
/* duplicate selected TimeMarkers */
|
||||||
void duplicate_timeline_marker(void)
|
void duplicate_marker(void)
|
||||||
{
|
{
|
||||||
TimeMarker *marker, *newmarker;
|
TimeMarker *marker, *newmarker;
|
||||||
|
|
||||||
/* go through the list of markers, duplicate selected markers and add duplicated copies
|
/* go through the list of markers, duplicate selected markers and add duplicated copies
|
||||||
* to the begining of the list (unselect original markers) */
|
* to the begining of the list (unselect original markers) */
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
@@ -154,12 +156,288 @@ void duplicate_timeline_marker(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
timeline_grab('g', 0);
|
transform_markers('g', 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void transform_markers(int mode, int smode) // mode and smode unused here, for callback
|
||||||
|
{
|
||||||
|
SpaceLink *slink= curarea->spacedata.first;
|
||||||
|
SpaceTime *stime= curarea->spacedata.first;
|
||||||
|
TimeMarker *marker, *selmarker=NULL;
|
||||||
|
float dx, fac;
|
||||||
|
int a, ret_val= 0, totmark=0, *oldframe, offs, firsttime=1;
|
||||||
|
unsigned short event;
|
||||||
|
short val, pmval[2], mval[2], mvalo[2];
|
||||||
|
char str[32];
|
||||||
|
|
||||||
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if(marker->flag & SELECT) totmark++;
|
||||||
|
}
|
||||||
|
if(totmark==0) return;
|
||||||
|
|
||||||
|
oldframe= MEM_mallocN(totmark*sizeof(int), "marker array");
|
||||||
|
for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if(marker->flag & SELECT) {
|
||||||
|
oldframe[a]= marker->frame;
|
||||||
|
selmarker= marker; // used for hederprint
|
||||||
|
a++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dx= G.v2d->mask.xmax-G.v2d->mask.xmin;
|
||||||
|
dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/dx;
|
||||||
|
|
||||||
|
getmouseco_areawin(pmval);
|
||||||
|
mvalo[0]= pmval[0];
|
||||||
|
|
||||||
|
while(ret_val == 0) {
|
||||||
|
|
||||||
|
getmouseco_areawin(mval);
|
||||||
|
|
||||||
|
if (mval[0] != mvalo[0] || firsttime) {
|
||||||
|
mvalo[0]= mval[0];
|
||||||
|
firsttime= 0;
|
||||||
|
|
||||||
|
fac= (((float)(mval[0] - pmval[0]))*dx);
|
||||||
|
|
||||||
|
if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND))
|
||||||
|
apply_keyb_grid(&fac, 0.0, (float)G.scene->r.frs_sec, 0.1*(float)G.scene->r.frs_sec, 0);
|
||||||
|
else
|
||||||
|
apply_keyb_grid(&fac, 0.0, 1.0, 0.1, U.flag & USER_AUTOGRABGRID);
|
||||||
|
offs= (int)fac;
|
||||||
|
|
||||||
|
for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if(marker->flag & SELECT) {
|
||||||
|
marker->frame= oldframe[a] + offs;
|
||||||
|
a++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(totmark==1) { // we print current marker value
|
||||||
|
if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) {
|
||||||
|
if(stime->flag & TIME_DRAWFRAMES)
|
||||||
|
sprintf(str, "Marker %d offset %d", selmarker->frame, offs);
|
||||||
|
else
|
||||||
|
sprintf(str, "Marker %.2f offset %.2f", (selmarker->frame/(float)G.scene->r.frs_sec), (offs/(float)G.scene->r.frs_sec));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf(str, "Marker %.2f offset %.2f", (double)(selmarker->frame), (double)(offs));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (ELEM(slink->spacetype, SPACE_TIME, SPACE_SOUND)) {
|
||||||
|
if(stime->flag & TIME_DRAWFRAMES)
|
||||||
|
sprintf(str, "Marker offset %d ", offs);
|
||||||
|
else
|
||||||
|
sprintf(str, "Marker offset %.2f ", (offs/(float)G.scene->r.frs_sec));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
sprintf(str, "Marker offset %.2f ", (double)(offs));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
headerprint(str);
|
||||||
|
|
||||||
|
force_draw(0); // areas identical to this, 0 = no header
|
||||||
|
}
|
||||||
|
else PIL_sleep_ms(10); // idle
|
||||||
|
|
||||||
|
/* emptying queue and reading events */
|
||||||
|
while( qtest() ) {
|
||||||
|
event= extern_qread(&val);
|
||||||
|
|
||||||
|
if(val) {
|
||||||
|
if(event==ESCKEY || event==RIGHTMOUSE) ret_val= 2;
|
||||||
|
else if(event==LEFTMOUSE || event==RETKEY || event==SPACEKEY) ret_val= 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* restore? */
|
||||||
|
if(ret_val==2) {
|
||||||
|
for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if(marker->flag & SELECT) {
|
||||||
|
marker->frame= oldframe[a];
|
||||||
|
a++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
BIF_undo_push("Move Markers");
|
||||||
|
}
|
||||||
|
MEM_freeN(oldframe);
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* select/deselect all TimeMarkers
|
||||||
|
* test - based on current selections?
|
||||||
|
* sel - selection status to set all markers to if blanket apply status
|
||||||
|
*/
|
||||||
|
void deselect_markers(short test, short sel)
|
||||||
|
{
|
||||||
|
TimeMarker *marker;
|
||||||
|
|
||||||
|
/* check if need to find out whether to how to select markers */
|
||||||
|
if (test) {
|
||||||
|
/* dependant on existing selection */
|
||||||
|
/* determine if select all or deselect all */
|
||||||
|
sel = 1;
|
||||||
|
for (marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if (marker->flag & SELECT) {
|
||||||
|
sel = 0;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/* do selection */
|
||||||
|
for (marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if (sel) {
|
||||||
|
if ((marker->flag & SELECT)==0)
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (marker->flag & SELECT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
/* not dependant on existing selection */
|
||||||
|
for (marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if (sel) {
|
||||||
|
if ((marker->flag & SELECT)==0)
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
if (marker->flag & SELECT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static int find_nearest_marker(float dx)
|
void borderselect_markers(float xmin, float xmax, int selectmode)
|
||||||
|
{
|
||||||
|
TimeMarker *marker;
|
||||||
|
|
||||||
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if ((marker->frame > xmin) && (marker->frame <= xmax)) {
|
||||||
|
switch (selectmode) {
|
||||||
|
case SELECT_ADD:
|
||||||
|
if ((marker->flag & SELECT) == 0)
|
||||||
|
marker->flag |= SELECT;
|
||||||
|
break;
|
||||||
|
case SELECT_SUBTRACT:
|
||||||
|
if (marker->flag & SELECT)
|
||||||
|
marker->flag &= ~SELECT;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void nextprev_marker(short dir)
|
||||||
|
{
|
||||||
|
TimeMarker *marker, *cur=NULL, *first, *last;
|
||||||
|
int mindist= MAXFRAME, dist;
|
||||||
|
|
||||||
|
first= last= G.scene->markers.first;
|
||||||
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
/* find closest to current frame first */
|
||||||
|
dist= (marker->frame/G.scene->r.framelen) - CFRA;
|
||||||
|
if(dir==1 && dist>0 && dist<mindist) {
|
||||||
|
mindist= dist;
|
||||||
|
cur= marker;
|
||||||
|
}
|
||||||
|
else if(dir==-1 && dist<0 && -dist<mindist) {
|
||||||
|
mindist= -dist;
|
||||||
|
cur= marker;
|
||||||
|
}
|
||||||
|
/* find first/last */
|
||||||
|
if(marker->frame > last->frame) last= marker;
|
||||||
|
if(marker->frame < first->frame) first= marker;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(cur==NULL) {
|
||||||
|
if(dir==1) cur= first;
|
||||||
|
else cur= last;
|
||||||
|
}
|
||||||
|
if(cur) {
|
||||||
|
CFRA= cur->frame/G.scene->r.framelen;
|
||||||
|
update_for_newframe();
|
||||||
|
allqueue(REDRAWALL, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
TimeMarker *find_nearest_marker(int clip_y)
|
||||||
|
{
|
||||||
|
TimeMarker *marker;
|
||||||
|
float xmin, xmax;
|
||||||
|
rctf rectf;
|
||||||
|
short mval[2];
|
||||||
|
|
||||||
|
getmouseco_areawin (mval);
|
||||||
|
|
||||||
|
/* first clip selection in Y */
|
||||||
|
if((clip_y) && (mval[1] > 30))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
mval[0]-=7;
|
||||||
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
||||||
|
mval[0]+=14;
|
||||||
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
|
xmin= rectf.xmin;
|
||||||
|
xmax= rectf.xmax;
|
||||||
|
|
||||||
|
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
||||||
|
if ((marker->frame > xmin) && (marker->frame <= xmax)) {
|
||||||
|
return marker;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* *********** End Markers - Markers API *************** */
|
||||||
|
|
||||||
|
/* border-select markers */
|
||||||
|
void borderselect_timeline_markers(void)
|
||||||
|
{
|
||||||
|
rcti rect;
|
||||||
|
rctf rectf;
|
||||||
|
int val, selectmode;
|
||||||
|
short mval[2];
|
||||||
|
|
||||||
|
if ( (val = get_border(&rect, 3)) ){
|
||||||
|
if (val == LEFTMOUSE)
|
||||||
|
selectmode = SELECT_ADD;
|
||||||
|
else
|
||||||
|
selectmode = SELECT_SUBTRACT;
|
||||||
|
|
||||||
|
mval[0]= rect.xmin;
|
||||||
|
mval[1]= rect.ymin+2;
|
||||||
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmin, &rectf.ymin);
|
||||||
|
mval[0]= rect.xmax;
|
||||||
|
mval[1]= rect.ymax-2;
|
||||||
|
areamouseco_to_ipoco(G.v2d, mval, &rectf.xmax, &rectf.ymax);
|
||||||
|
|
||||||
|
/* do markers */
|
||||||
|
borderselect_markers(rectf.xmin, rectf.xmax, selectmode);
|
||||||
|
|
||||||
|
BIF_undo_push("Border Select TimeLine");
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static int find_nearest_timeline_marker(float dx)
|
||||||
{
|
{
|
||||||
TimeMarker *marker, *nearest= NULL;
|
TimeMarker *marker, *nearest= NULL;
|
||||||
float dist, min_dist= 1000000;
|
float dist, min_dist= 1000000;
|
||||||
@@ -196,59 +474,7 @@ static void select_timeline_marker_frame(int frame, unsigned char shift)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* select/deselect all TimeMarkers */
|
/* *********** end Markers - TimeLine *************** */
|
||||||
void select_timeline_markers(void)
|
|
||||||
{
|
|
||||||
TimeMarker *marker;
|
|
||||||
char any_selected= 0;
|
|
||||||
|
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) any_selected= 1;
|
|
||||||
marker->flag &= ~SELECT;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* no TimeMarker selected, then select all TimeMarkers */
|
|
||||||
if(!any_selected){
|
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
marker->flag |= SELECT;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void nextprev_timeline_marker(short dir)
|
|
||||||
{
|
|
||||||
TimeMarker *marker, *cur=NULL, *first, *last;
|
|
||||||
int mindist= MAXFRAME, dist;
|
|
||||||
|
|
||||||
first= last= G.scene->markers.first;
|
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
/* find closest to current frame first */
|
|
||||||
dist= (marker->frame/G.scene->r.framelen) - CFRA;
|
|
||||||
if(dir==1 && dist>0 && dist<mindist) {
|
|
||||||
mindist= dist;
|
|
||||||
cur= marker;
|
|
||||||
}
|
|
||||||
else if(dir==-1 && dist<0 && -dist<mindist) {
|
|
||||||
mindist= -dist;
|
|
||||||
cur= marker;
|
|
||||||
}
|
|
||||||
/* find first/last */
|
|
||||||
if(marker->frame > last->frame) last= marker;
|
|
||||||
if(marker->frame < first->frame) first= marker;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(cur==NULL) {
|
|
||||||
if(dir==1) cur= first;
|
|
||||||
else cur= last;
|
|
||||||
}
|
|
||||||
if(cur) {
|
|
||||||
CFRA= cur->frame/G.scene->r.framelen;
|
|
||||||
update_for_newframe();
|
|
||||||
allqueue(REDRAWALL, 0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* *********** end Markers *************** */
|
|
||||||
|
|
||||||
static int float_to_frame(float frame)
|
static int float_to_frame(float frame)
|
||||||
{
|
{
|
||||||
@@ -359,102 +585,6 @@ void timeline_frame_to_center(void)
|
|||||||
scrarea_queue_winredraw(curarea);
|
scrarea_queue_winredraw(curarea);
|
||||||
}
|
}
|
||||||
|
|
||||||
void timeline_grab(int mode, int smode) // mode and smode unused here, for callback
|
|
||||||
{
|
|
||||||
SpaceTime *stime= curarea->spacedata.first;
|
|
||||||
TimeMarker *marker, *selmarker=NULL;
|
|
||||||
float dx, fac;
|
|
||||||
int a, ret_val= 0, totmark=0, *oldframe, offs, firsttime=1;
|
|
||||||
unsigned short event;
|
|
||||||
short val, pmval[2], mval[2], mvalo[2];
|
|
||||||
char str[32];
|
|
||||||
|
|
||||||
for(marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) totmark++;
|
|
||||||
}
|
|
||||||
if(totmark==0) return;
|
|
||||||
|
|
||||||
oldframe= MEM_mallocN(totmark*sizeof(int), "marker array");
|
|
||||||
for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
oldframe[a]= marker->frame;
|
|
||||||
selmarker= marker; // used for hederprint
|
|
||||||
a++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
dx= G.v2d->mask.xmax-G.v2d->mask.xmin;
|
|
||||||
dx= (G.v2d->cur.xmax-G.v2d->cur.xmin)/dx;
|
|
||||||
|
|
||||||
getmouseco_areawin(pmval);
|
|
||||||
mvalo[0]= pmval[0];
|
|
||||||
|
|
||||||
while(ret_val == 0) {
|
|
||||||
|
|
||||||
getmouseco_areawin(mval);
|
|
||||||
|
|
||||||
if (mval[0] != mvalo[0] || firsttime) {
|
|
||||||
mvalo[0]= mval[0];
|
|
||||||
firsttime= 0;
|
|
||||||
|
|
||||||
fac= (((float)(mval[0] - pmval[0]))*dx);
|
|
||||||
|
|
||||||
apply_keyb_grid(&fac, 0.0, (float)G.scene->r.frs_sec, 0.1*(float)G.scene->r.frs_sec, 0);
|
|
||||||
offs= (int)fac;
|
|
||||||
|
|
||||||
for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
marker->frame= oldframe[a] + offs;
|
|
||||||
a++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(totmark==1) { // we print current marker value
|
|
||||||
if(stime->flag & TIME_DRAWFRAMES)
|
|
||||||
sprintf(str, "Marker %d offset %d", selmarker->frame, offs);
|
|
||||||
else
|
|
||||||
sprintf(str, "Marker %.2f offset %.2f", (selmarker->frame/(float)G.scene->r.frs_sec), (offs/(float)G.scene->r.frs_sec));
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
if(stime->flag & TIME_DRAWFRAMES)
|
|
||||||
sprintf(str, "Marker offset %d ", offs);
|
|
||||||
else
|
|
||||||
sprintf(str, "Marker offset %.2f ", (offs/(float)G.scene->r.frs_sec));
|
|
||||||
}
|
|
||||||
headerprint(str);
|
|
||||||
|
|
||||||
force_draw(0); // areas identical to this, 0 = no header
|
|
||||||
}
|
|
||||||
else PIL_sleep_ms(10); // idle
|
|
||||||
|
|
||||||
/* emptying queue and reading events */
|
|
||||||
while( qtest() ) {
|
|
||||||
event= extern_qread(&val);
|
|
||||||
|
|
||||||
if(val) {
|
|
||||||
if(event==ESCKEY || event==RIGHTMOUSE) ret_val= 2;
|
|
||||||
else if(event==LEFTMOUSE || event==RETKEY || event==SPACEKEY) ret_val= 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* restore? */
|
|
||||||
if(ret_val==2) {
|
|
||||||
for(a=0, marker= G.scene->markers.first; marker; marker= marker->next) {
|
|
||||||
if(marker->flag & SELECT) {
|
|
||||||
marker->frame= oldframe[a];
|
|
||||||
a++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
BIF_undo_push("Move Markers");
|
|
||||||
}
|
|
||||||
MEM_freeN(oldframe);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* copy of this is actually in editscreen.c, but event based */
|
/* copy of this is actually in editscreen.c, but event based */
|
||||||
static void timeline_force_draw(short val)
|
static void timeline_force_draw(short val)
|
||||||
{
|
{
|
||||||
@@ -564,7 +694,7 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
getmouseco_areawin(mval);
|
getmouseco_areawin(mval);
|
||||||
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
|
areamouseco_to_ipoco(G.v2d, mval, &dx, &dy);
|
||||||
|
|
||||||
cfra= find_nearest_marker(dx);
|
cfra= find_nearest_timeline_marker(dx);
|
||||||
|
|
||||||
if (G.qual && LR_SHIFTKEY)
|
if (G.qual && LR_SHIFTKEY)
|
||||||
select_timeline_marker_frame(cfra, 1);
|
select_timeline_marker_frame(cfra, 1);
|
||||||
@@ -572,7 +702,7 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
select_timeline_marker_frame(cfra, 0);
|
select_timeline_marker_frame(cfra, 0);
|
||||||
|
|
||||||
force_draw(0);
|
force_draw(0);
|
||||||
std_rmouse_transform(timeline_grab);
|
std_rmouse_transform(transform_markers);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case MIDDLEMOUSE:
|
case MIDDLEMOUSE:
|
||||||
@@ -608,29 +738,37 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
if(G.qual==LR_CTRLKEY)
|
if(G.qual==LR_CTRLKEY)
|
||||||
nextprev_timeline_key(1);
|
nextprev_timeline_key(1);
|
||||||
else
|
else
|
||||||
nextprev_timeline_marker(1);
|
nextprev_marker(1);
|
||||||
break;
|
break;
|
||||||
case PAGEDOWNKEY: /* prev keyframe */
|
case PAGEDOWNKEY: /* prev keyframe */
|
||||||
if(G.qual==LR_CTRLKEY)
|
if(G.qual==LR_CTRLKEY)
|
||||||
nextprev_timeline_key(-1);
|
nextprev_timeline_key(-1);
|
||||||
else
|
else
|
||||||
nextprev_timeline_marker(-1);
|
nextprev_marker(-1);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case AKEY:
|
case AKEY:
|
||||||
/* deselect all TimeMarkers */
|
/* deselect all TimeMarkers */
|
||||||
select_timeline_markers();
|
deselect_markers(1, 0);
|
||||||
doredraw= 1;
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
break;
|
||||||
|
case BKEY:
|
||||||
|
/* borderselect markers */
|
||||||
|
borderselect_timeline_markers();
|
||||||
break;
|
break;
|
||||||
case DKEY:
|
case DKEY:
|
||||||
if(G.qual==LR_SHIFTKEY)
|
if(G.qual==LR_SHIFTKEY)
|
||||||
duplicate_timeline_marker();
|
duplicate_marker();
|
||||||
break;
|
break;
|
||||||
case CKEY:
|
case CKEY:
|
||||||
timeline_frame_to_center();
|
timeline_frame_to_center();
|
||||||
break;
|
break;
|
||||||
case GKEY: /* move marker */
|
case GKEY: /* move marker */
|
||||||
timeline_grab('g', 0);
|
transform_markers('g', 0);
|
||||||
break;
|
break;
|
||||||
case EKEY: /* set end frame */
|
case EKEY: /* set end frame */
|
||||||
G.scene->r.efra = CFRA;
|
G.scene->r.efra = CFRA;
|
||||||
@@ -638,12 +776,15 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
allqueue(REDRAWTIME, 1);
|
allqueue(REDRAWTIME, 1);
|
||||||
break;
|
break;
|
||||||
case MKEY: /* add, rename marker */
|
case MKEY: /* add, rename marker */
|
||||||
if (G.qual & LR_CTRLKEY)
|
if (G.qual & LR_SHIFTKEY)
|
||||||
rename_timeline_marker();
|
rename_marker();
|
||||||
else
|
else
|
||||||
add_timeline_marker(CFRA);
|
add_marker(CFRA);
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
break;
|
break;
|
||||||
case SKEY: /* set start frame */
|
case SKEY: /* set start frame */
|
||||||
G.scene->r.sfra = CFRA;
|
G.scene->r.sfra = CFRA;
|
||||||
@@ -662,9 +803,12 @@ void winqreadtimespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
case XKEY:
|
case XKEY:
|
||||||
if( okee("Erase selected")==0 ) break;
|
if( okee("Erase selected")==0 ) break;
|
||||||
|
|
||||||
remove_timeline_marker();
|
remove_marker();
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
|
|
||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "nla.h"
|
#include "nla.h"
|
||||||
|
|
||||||
@@ -84,6 +85,9 @@
|
|||||||
#define ACTMENU_VIEW_MAXIMIZE 5
|
#define ACTMENU_VIEW_MAXIMIZE 5
|
||||||
#define ACTMENU_VIEW_LOCK 6
|
#define ACTMENU_VIEW_LOCK 6
|
||||||
#define ACTMENU_VIEW_SLIDERS 7
|
#define ACTMENU_VIEW_SLIDERS 7
|
||||||
|
#define ACTMENU_VIEW_NEXTMARKER 8
|
||||||
|
#define ACTMENU_VIEW_PREVMARKER 9
|
||||||
|
|
||||||
|
|
||||||
#define ACTMENU_SEL_BORDER 0
|
#define ACTMENU_SEL_BORDER 0
|
||||||
#define ACTMENU_SEL_ALL_KEYS 1
|
#define ACTMENU_SEL_ALL_KEYS 1
|
||||||
@@ -96,8 +100,8 @@
|
|||||||
#define ACTMENU_KEY_DUPLICATE 0
|
#define ACTMENU_KEY_DUPLICATE 0
|
||||||
#define ACTMENU_KEY_DELETE 1
|
#define ACTMENU_KEY_DELETE 1
|
||||||
#define ACTMENU_KEY_BAKE 2
|
#define ACTMENU_KEY_BAKE 2
|
||||||
#define ACTMENU_KEY_SNAP 3
|
#define ACTMENU_KEY_CLEAN 3
|
||||||
#define ACTMENU_KEY_CLEAN 4
|
#define ACTMENU_KEY_MIRROR 4
|
||||||
|
|
||||||
#define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP 0
|
#define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_UP 0
|
||||||
#define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN 1
|
#define ACTMENU_KEY_CHANPOS_MOVE_CHANNEL_DOWN 1
|
||||||
@@ -122,6 +126,9 @@
|
|||||||
#define ACTMENU_KEY_EXTEND_CYCLIC 2
|
#define ACTMENU_KEY_EXTEND_CYCLIC 2
|
||||||
#define ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION 3
|
#define ACTMENU_KEY_EXTEND_CYCLICEXTRAPOLATION 3
|
||||||
|
|
||||||
|
#define ACTMENU_KEY_SNAP_NEARFRAME 0
|
||||||
|
#define ACTMENU_KEY_SNAP_CURFRAME 1
|
||||||
|
|
||||||
#define ACTMENU_MARKERS_ADD 0
|
#define ACTMENU_MARKERS_ADD 0
|
||||||
#define ACTMENU_MARKERS_DUPLICATE 1
|
#define ACTMENU_MARKERS_DUPLICATE 1
|
||||||
#define ACTMENU_MARKERS_DELETE 2
|
#define ACTMENU_MARKERS_DELETE 2
|
||||||
@@ -250,6 +257,12 @@ static void do_action_viewmenu(void *arg, int event)
|
|||||||
case ACTMENU_VIEW_MAXIMIZE: /* Maximize Window */
|
case ACTMENU_VIEW_MAXIMIZE: /* Maximize Window */
|
||||||
/* using event B_FULL */
|
/* using event B_FULL */
|
||||||
break;
|
break;
|
||||||
|
case ACTMENU_VIEW_NEXTMARKER: /* jump to next marker */
|
||||||
|
nextprev_marker(1);
|
||||||
|
break;
|
||||||
|
case ACTMENU_VIEW_PREVMARKER: /* jump to previous marker */
|
||||||
|
nextprev_marker(-1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
allqueue(REDRAWVIEW3D, 0);
|
allqueue(REDRAWVIEW3D, 0);
|
||||||
}
|
}
|
||||||
@@ -267,14 +280,6 @@ static uiBlock *action_viewmenu(void *arg_unused)
|
|||||||
"Center View to Current Frame|C", 0, yco-=20,
|
"Center View to Current Frame|C", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
||||||
ACTMENU_VIEW_CENTERVIEW, "");
|
ACTMENU_VIEW_CENTERVIEW, "");
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
|
||||||
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, BTST(G.saction->lock, 0)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
|
|
||||||
"Update Automatically|", 0, yco-=20,
|
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
|
||||||
ACTMENU_VIEW_AUTOUPDATE, "");
|
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
||||||
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
@@ -283,10 +288,30 @@ static uiBlock *action_viewmenu(void *arg_unused)
|
|||||||
"Show Sliders|", 0, yco-=20,
|
"Show Sliders|", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
||||||
ACTMENU_VIEW_SLIDERS, "");
|
ACTMENU_VIEW_SLIDERS, "");
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
|
||||||
|
"Lock Time to Other Windows|", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
||||||
|
ACTMENU_VIEW_LOCK, "");
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, BTST(G.saction->lock, 0)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
|
||||||
|
"Update Automatically|", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
||||||
|
ACTMENU_VIEW_AUTOUPDATE, "");
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
||||||
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
||||||
|
"Jump To Next Marker|PageUp", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_NEXTMARKER, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
||||||
|
"Jump To Prev Marker|PageDown", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_VIEW_PREVMARKER, "");
|
||||||
|
|
||||||
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
||||||
|
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
||||||
"Play Back Animation|Alt A", 0, yco-=20,
|
"Play Back Animation|Alt A", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
||||||
@@ -303,11 +328,6 @@ static uiBlock *action_viewmenu(void *arg_unused)
|
|||||||
"View All|Home", 0, yco-=20,
|
"View All|Home", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
||||||
ACTMENU_VIEW_ALL, "");
|
ACTMENU_VIEW_ALL, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, (G.v2d->flag & V2D_VIEWLOCK)?ICON_CHECKBOX_HLT:ICON_CHECKBOX_DEHLT,
|
|
||||||
"Lock Time to Other Windows|", 0, yco-=20,
|
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1,
|
|
||||||
ACTMENU_VIEW_LOCK, "");
|
|
||||||
|
|
||||||
if (!curarea->full)
|
if (!curarea->full)
|
||||||
uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1,
|
uiDefIconTextBut(block, BUTM, B_FULL, ICON_BLANK1,
|
||||||
@@ -338,7 +358,6 @@ static void do_action_selectmenu(void *arg, int event)
|
|||||||
SpaceAction *saction;
|
SpaceAction *saction;
|
||||||
bAction *act;
|
bAction *act;
|
||||||
Key *key;
|
Key *key;
|
||||||
ListBase *markers;
|
|
||||||
|
|
||||||
saction = curarea->spacedata.first;
|
saction = curarea->spacedata.first;
|
||||||
if (!saction)
|
if (!saction)
|
||||||
@@ -346,7 +365,6 @@ static void do_action_selectmenu(void *arg, int event)
|
|||||||
|
|
||||||
act = saction->action;
|
act = saction->action;
|
||||||
key = get_action_mesh_key();
|
key = get_action_mesh_key();
|
||||||
markers = get_saction_markers(saction);
|
|
||||||
|
|
||||||
switch(event)
|
switch(event)
|
||||||
{
|
{
|
||||||
@@ -383,11 +401,12 @@ static void do_action_selectmenu(void *arg, int event)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */
|
case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */
|
||||||
if (markers != NULL) {
|
deselect_markers(1, 0);
|
||||||
deselect_saction_markers(markers, 1, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
allqueue(REDRAWACTION, 0);
|
allqueue(REDRAWIPO, 0);
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWACTION, 0);
|
||||||
}
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ACTMENU_SEL_COLUMN: /* select column */
|
case ACTMENU_SEL_COLUMN: /* select column */
|
||||||
@@ -800,6 +819,45 @@ static uiBlock *action_keymenu_chanposmenu(void *arg_unused)
|
|||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void do_action_keymenu_snapmenu(void *arg, int event)
|
||||||
|
{
|
||||||
|
switch(event)
|
||||||
|
{
|
||||||
|
case ACTMENU_KEY_SNAP_NEARFRAME:
|
||||||
|
snap_keys_to_frame(1);
|
||||||
|
break;
|
||||||
|
case ACTMENU_KEY_SNAP_CURFRAME:
|
||||||
|
snap_keys_to_frame(2);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
scrarea_queue_winredraw(curarea);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uiBlock *action_keymenu_snapmenu(void *arg_unused)
|
||||||
|
{
|
||||||
|
uiBlock *block;
|
||||||
|
short yco= 0, menuwidth=120;
|
||||||
|
|
||||||
|
block= uiNewBlock(&curarea->uiblocks, "action_keymenu_snapmenu",
|
||||||
|
UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
||||||
|
uiBlockSetButmFunc(block, do_action_keymenu_snapmenu, NULL);
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
||||||
|
"Nearest Frame|Shift S, 1", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 0,
|
||||||
|
ACTMENU_KEY_SNAP_NEARFRAME, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
||||||
|
"Current Frame|Shift S, 2", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 0,
|
||||||
|
ACTMENU_KEY_SNAP_CURFRAME, "");
|
||||||
|
|
||||||
|
uiBlockSetDirection(block, UI_RIGHT);
|
||||||
|
uiTextBoundsBlock(block, 60);
|
||||||
|
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
static void do_action_keymenu(void *arg, int event)
|
static void do_action_keymenu(void *arg, int event)
|
||||||
{
|
{
|
||||||
SpaceAction *saction;
|
SpaceAction *saction;
|
||||||
@@ -836,9 +894,6 @@ static void do_action_keymenu(void *arg, int event)
|
|||||||
case ACTMENU_KEY_BAKE:
|
case ACTMENU_KEY_BAKE:
|
||||||
bake_action_with_client (G.saction->action, OBACT, 0.01);
|
bake_action_with_client (G.saction->action, OBACT, 0.01);
|
||||||
break;
|
break;
|
||||||
case ACTMENU_KEY_SNAP:
|
|
||||||
snap_keys_to_frame();
|
|
||||||
break;
|
|
||||||
case ACTMENU_KEY_CLEAN:
|
case ACTMENU_KEY_CLEAN:
|
||||||
if (key)
|
if (key)
|
||||||
clean_shapekeys(key);
|
clean_shapekeys(key);
|
||||||
@@ -860,9 +915,8 @@ static uiBlock *action_keymenu(void *arg_unused)
|
|||||||
uiDefIconTextBlockBut(block, action_keymenu_transformmenu,
|
uiDefIconTextBlockBut(block, action_keymenu_transformmenu,
|
||||||
NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
|
NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
|
uiDefIconTextBlockBut(block, action_keymenu_snapmenu,
|
||||||
"Snap to Frame|Shift S", 0, yco-=20,
|
NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 20, "");
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 0, ACTMENU_KEY_SNAP, "");
|
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
|
||||||
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
@@ -926,39 +980,30 @@ static uiBlock *action_keymenu(void *arg_unused)
|
|||||||
|
|
||||||
static void do_action_markermenu(void *arg, int event)
|
static void do_action_markermenu(void *arg, int event)
|
||||||
{
|
{
|
||||||
SpaceAction *saction;
|
|
||||||
ListBase *markers = NULL;
|
|
||||||
|
|
||||||
saction= curarea->spacedata.first;
|
|
||||||
if (!saction)
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* get set of markers */
|
|
||||||
markers= get_saction_markers(saction);
|
|
||||||
if (markers == NULL)
|
|
||||||
return;
|
|
||||||
|
|
||||||
switch(event)
|
switch(event)
|
||||||
{
|
{
|
||||||
case ACTMENU_MARKERS_ADD:
|
case ACTMENU_MARKERS_ADD:
|
||||||
add_saction_marker(markers, CFRA);
|
add_marker(CFRA);
|
||||||
break;
|
break;
|
||||||
case ACTMENU_MARKERS_DUPLICATE:
|
case ACTMENU_MARKERS_DUPLICATE:
|
||||||
duplicate_saction_markers(markers);
|
duplicate_marker();
|
||||||
break;
|
break;
|
||||||
case ACTMENU_MARKERS_DELETE:
|
case ACTMENU_MARKERS_DELETE:
|
||||||
remove_saction_markers(markers);
|
remove_marker();
|
||||||
break;
|
break;
|
||||||
case ACTMENU_MARKERS_NAME:
|
case ACTMENU_MARKERS_NAME:
|
||||||
rename_saction_markers(markers);
|
rename_marker();
|
||||||
break;
|
break;
|
||||||
case ACTMENU_MARKERS_MOVE:
|
case ACTMENU_MARKERS_MOVE:
|
||||||
transform_saction_markers('g', 0);
|
transform_markers('g', 0);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
allqueue(REDRAWACTION, 0);
|
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uiBlock *action_markermenu(void *arg_unused)
|
static uiBlock *action_markermenu(void *arg_unused)
|
||||||
@@ -972,16 +1017,16 @@ static uiBlock *action_markermenu(void *arg_unused)
|
|||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_ADD, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker(s)|Ctrl Shift M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DUPLICATE, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker(s)|Alt M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_DELETE, "");
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker(s)|Ctrl M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Shift M", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_NAME, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker(s)|Shift M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Shift G", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, ACTMENU_MARKERS_MOVE, "");
|
||||||
|
|
||||||
|
|
||||||
@@ -1069,19 +1114,16 @@ void action_buttons(void)
|
|||||||
uiDefPulldownBut(block, action_selectmenu, NULL,
|
uiDefPulldownBut(block, action_selectmenu, NULL,
|
||||||
"Select", xco, -2, xmax-3, 24, "");
|
"Select", xco, -2, xmax-3, 24, "");
|
||||||
xco+= xmax;
|
xco+= xmax;
|
||||||
|
|
||||||
|
xmax= GetButStringLength("Marker");
|
||||||
|
uiDefPulldownBut(block, action_markermenu, NULL,
|
||||||
|
"Marker", xco, -2, xmax-3, 24, "");
|
||||||
|
xco+= xmax;
|
||||||
|
|
||||||
xmax= GetButStringLength("Key");
|
xmax= GetButStringLength("Key");
|
||||||
uiDefPulldownBut(block, action_keymenu, NULL,
|
uiDefPulldownBut(block, action_keymenu, NULL,
|
||||||
"Key", xco, -2, xmax-3, 24, "");
|
"Key", xco, -2, xmax-3, 24, "");
|
||||||
xco+= xmax;
|
xco+= xmax;
|
||||||
|
|
||||||
//if ((G.saction->markert != SACTION_NOMARKERS) &&
|
|
||||||
// (G.saction->action != NULL)) {
|
|
||||||
xmax= GetButStringLength("Marker");
|
|
||||||
uiDefPulldownBut(block, action_markermenu, NULL,
|
|
||||||
"Marker", xco, -2, xmax-3, 24, "");
|
|
||||||
xco+= xmax;
|
|
||||||
//}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||||
|
|||||||
@@ -79,6 +79,7 @@
|
|||||||
#include "BSE_edit.h"
|
#include "BSE_edit.h"
|
||||||
#include "BSE_editipo.h"
|
#include "BSE_editipo.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "BIF_editaction.h"
|
#include "BIF_editaction.h"
|
||||||
#include "BIF_interface.h"
|
#include "BIF_interface.h"
|
||||||
@@ -336,9 +337,9 @@ static uiBlock *ipo_editmenu_mirrormenu(void *arg_unused)
|
|||||||
block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_mirrormenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
||||||
uiBlockSetButmFunc(block, do_ipo_editmenu_mirrormenu, NULL);
|
uiBlockSetButmFunc(block, do_ipo_editmenu_mirrormenu, NULL);
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Current Frame|M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Current Frame|Ctrl M, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Vertical Axis|M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Vertical Axis|Ctrl M, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Horizontal Axis|M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Over Horizontal Axis|Ctrl M, 3", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||||
|
|
||||||
uiBlockSetDirection(block, UI_RIGHT);
|
uiBlockSetDirection(block, UI_RIGHT);
|
||||||
uiTextBoundsBlock(block, 60);
|
uiTextBoundsBlock(block, 60);
|
||||||
@@ -555,7 +556,7 @@ static void do_ipo_editmenu(void *arg, int event)
|
|||||||
switch(event)
|
switch(event)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
del_ipo();
|
del_ipo(1);
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
add_duplicate_editipo();
|
add_duplicate_editipo();
|
||||||
@@ -813,6 +814,69 @@ static uiBlock *ipo_selectmenu(void *arg_unused)
|
|||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void do_ipo_markermenu(void *arg, int event)
|
||||||
|
{
|
||||||
|
switch(event)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
add_marker(CFRA);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
duplicate_marker();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
remove_marker();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
rename_marker();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
transform_markers('g', 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uiBlock *ipo_markermenu(void *arg_unused)
|
||||||
|
{
|
||||||
|
uiBlock *block;
|
||||||
|
short yco= 0, menuwidth=120;
|
||||||
|
|
||||||
|
block= uiNewBlock(&curarea->uiblocks, "ipo_markermenu",
|
||||||
|
UI_EMBOSSP, UI_HELV, curarea->headwin);
|
||||||
|
uiBlockSetButmFunc(block, do_ipo_markermenu, NULL);
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||||
|
|
||||||
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Shift M", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Shift G", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
||||||
|
|
||||||
|
if(curarea->headertype==HEADERTOP) {
|
||||||
|
uiBlockSetDirection(block, UI_DOWN);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uiBlockSetDirection(block, UI_TOP);
|
||||||
|
uiBlockFlipOrder(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
uiTextBoundsBlock(block, 50);
|
||||||
|
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
static char *ipo_modeselect_pup(void)
|
static char *ipo_modeselect_pup(void)
|
||||||
{
|
{
|
||||||
@@ -1113,7 +1177,11 @@ void ipo_buttons(void)
|
|||||||
xmax= GetButStringLength("Select");
|
xmax= GetButStringLength("Select");
|
||||||
uiDefPulldownBut(block,ipo_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
|
uiDefPulldownBut(block,ipo_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
|
||||||
xco+=xmax;
|
xco+=xmax;
|
||||||
|
|
||||||
|
xmax= GetButStringLength("Marker");
|
||||||
|
uiDefPulldownBut(block,ipo_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, "");
|
||||||
|
xco+=xmax;
|
||||||
|
|
||||||
if (G.sipo->showkey) {
|
if (G.sipo->showkey) {
|
||||||
xmax= GetButStringLength("Key");
|
xmax= GetButStringLength("Key");
|
||||||
uiDefPulldownBut(block,ipo_editmenu, NULL, "Key", xco, -2, xmax-3, 24, "");
|
uiDefPulldownBut(block,ipo_editmenu, NULL, "Key", xco, -2, xmax-3, 24, "");
|
||||||
@@ -1126,7 +1194,6 @@ void ipo_buttons(void)
|
|||||||
xmax= GetButStringLength("Curve");
|
xmax= GetButStringLength("Curve");
|
||||||
uiDefPulldownBut(block,ipo_editmenu, NULL, "Curve", xco, -2, xmax-3, 24, "");
|
uiDefPulldownBut(block,ipo_editmenu, NULL, "Curve", xco, -2, xmax-3, 24, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
xco+=xmax;
|
xco+=xmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,9 +58,12 @@
|
|||||||
#include "BIF_screen.h"
|
#include "BIF_screen.h"
|
||||||
#include "BIF_space.h"
|
#include "BIF_space.h"
|
||||||
#include "BIF_editnla.h"
|
#include "BIF_editnla.h"
|
||||||
|
#include "BIF_editaction.h"
|
||||||
|
#include "BIF_toolbox.h"
|
||||||
|
|
||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
//#include "nla.h"
|
//#include "nla.h"
|
||||||
|
|
||||||
@@ -180,6 +183,14 @@ static void do_nla_selectmenu(void *arg, int event)
|
|||||||
allqueue (REDRAWNLA, 0);
|
allqueue (REDRAWNLA, 0);
|
||||||
allqueue (REDRAWIPO, 0);
|
allqueue (REDRAWIPO, 0);
|
||||||
break;
|
break;
|
||||||
|
case 3: /* Select/Deselect All Markers */
|
||||||
|
deselect_markers(1, 0);
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -197,6 +208,7 @@ static uiBlock *nla_selectmenu(void *arg_unused)
|
|||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Keys|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Keys|A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Channels", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Channels", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Select/Deselect All Markers|Ctrl A", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
|
||||||
|
|
||||||
if(curarea->headertype==HEADERTOP) {
|
if(curarea->headertype==HEADERTOP) {
|
||||||
uiBlockSetDirection(block, UI_DOWN);
|
uiBlockSetDirection(block, UI_DOWN);
|
||||||
@@ -211,6 +223,31 @@ static uiBlock *nla_selectmenu(void *arg_unused)
|
|||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void do_nla_strip_snapmenu(void *arg, int event)
|
||||||
|
{
|
||||||
|
snap_action_strips(event);
|
||||||
|
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uiBlock *nla_strip_snapmenu(void *arg_unused)
|
||||||
|
{
|
||||||
|
uiBlock *block;
|
||||||
|
short yco = 20, menuwidth = 120;
|
||||||
|
|
||||||
|
block= uiNewBlock(&curarea->uiblocks, "nla_strip_snapmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
|
||||||
|
uiBlockSetButmFunc(block, do_nla_strip_snapmenu, NULL);
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Nearest Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Current Frame|Shift S, 2", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||||
|
|
||||||
|
uiBlockSetDirection(block, UI_RIGHT);
|
||||||
|
uiTextBoundsBlock(block, 60);
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
static void do_nla_strip_transformmenu(void *arg, int event)
|
static void do_nla_strip_transformmenu(void *arg, int event)
|
||||||
{
|
{
|
||||||
switch(event) {
|
switch(event) {
|
||||||
@@ -257,8 +294,10 @@ static void do_nla_stripmenu(void *arg, int event)
|
|||||||
update_for_newframe_muted();
|
update_for_newframe_muted();
|
||||||
break;
|
break;
|
||||||
case 3: /* Delete Strips */
|
case 3: /* Delete Strips */
|
||||||
delete_nlachannel_keys ();
|
if (okee("Erase selected strips and/or keys")) {
|
||||||
update_for_newframe_muted();
|
delete_nlachannel_keys ();
|
||||||
|
update_for_newframe_muted();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 5: /* Convert Action to NLA Strip */
|
case 5: /* Convert Action to NLA Strip */
|
||||||
break;
|
break;
|
||||||
@@ -274,9 +313,6 @@ static void do_nla_stripmenu(void *arg, int event)
|
|||||||
case 9: /* reset start/end of action */
|
case 9: /* reset start/end of action */
|
||||||
reset_action_strips(2);
|
reset_action_strips(2);
|
||||||
break;
|
break;
|
||||||
case 10: /* snap to frame */
|
|
||||||
snap_action_strips();
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -292,7 +328,7 @@ static uiBlock *nla_stripmenu(void *arg_unused)
|
|||||||
uiDefIconTextBlockBut(block, nla_strip_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
|
uiDefIconTextBlockBut(block, nla_strip_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Strip Size|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Strip Size|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 8, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Action Start/End|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Reset Action Start/End|Alt S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 9, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap to Frame|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 10, "");
|
uiDefIconTextBlockBut(block, nla_strip_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap To Frame", 0, yco-=20, 120, 20, "");
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
@@ -302,8 +338,8 @@ static uiBlock *nla_stripmenu(void *arg_unused)
|
|||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Down|Page Down", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Down|Ctrl Page Down", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Up|Page Up", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Move Up|Ctrl Page Up", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
|
||||||
|
|
||||||
// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Action to NLA Strip|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
|
// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Convert Action to NLA Strip|C", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
|
||||||
|
|
||||||
@@ -320,6 +356,70 @@ static uiBlock *nla_stripmenu(void *arg_unused)
|
|||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void do_nla_markermenu(void *arg, int event)
|
||||||
|
{
|
||||||
|
switch(event)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
add_marker(CFRA);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
duplicate_marker();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
remove_marker();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
rename_marker();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
transform_markers('g', 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uiBlock *nla_markermenu(void *arg_unused)
|
||||||
|
{
|
||||||
|
uiBlock *block;
|
||||||
|
short yco= 0, menuwidth=120;
|
||||||
|
|
||||||
|
block= uiNewBlock(&curarea->uiblocks, "nla_markermenu",
|
||||||
|
UI_EMBOSSP, UI_HELV, curarea->headwin);
|
||||||
|
uiBlockSetButmFunc(block, do_nla_markermenu, NULL);
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Ctrl Shift D", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||||
|
|
||||||
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Shift M", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|Shift G", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
||||||
|
|
||||||
|
if(curarea->headertype==HEADERTOP) {
|
||||||
|
uiBlockSetDirection(block, UI_DOWN);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uiBlockSetDirection(block, UI_TOP);
|
||||||
|
uiBlockFlipOrder(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
uiTextBoundsBlock(block, 50);
|
||||||
|
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
void nla_buttons(void)
|
void nla_buttons(void)
|
||||||
{
|
{
|
||||||
SpaceNla *snla;
|
SpaceNla *snla;
|
||||||
@@ -367,11 +467,16 @@ void nla_buttons(void)
|
|||||||
xmax= GetButStringLength("Select");
|
xmax= GetButStringLength("Select");
|
||||||
uiDefPulldownBut(block, nla_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
|
uiDefPulldownBut(block, nla_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
|
||||||
xco+= xmax;
|
xco+= xmax;
|
||||||
|
|
||||||
|
xmax= GetButStringLength("Marker");
|
||||||
|
uiDefPulldownBut(block, nla_markermenu, NULL, "Marker", xco, -2, xmax-3, 24, "");
|
||||||
|
xco+= xmax;
|
||||||
|
|
||||||
xmax= GetButStringLength("Strip");
|
xmax= GetButStringLength("Strip");
|
||||||
uiDefPulldownBut(block, nla_stripmenu, NULL, "Strip", xco, -2, xmax-3, 24, "");
|
uiDefPulldownBut(block, nla_stripmenu, NULL, "Strip", xco, -2, xmax-3, 24, "");
|
||||||
xco+= xmax;
|
xco+= xmax;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||||
|
|||||||
@@ -70,6 +70,7 @@
|
|||||||
#include "BSE_drawipo.h"
|
#include "BSE_drawipo.h"
|
||||||
#include "BSE_filesel.h"
|
#include "BSE_filesel.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "blendef.h"
|
#include "blendef.h"
|
||||||
#include "mydevice.h"
|
#include "mydevice.h"
|
||||||
@@ -186,6 +187,12 @@ static void do_sound_viewmenu(void *arg, int event)
|
|||||||
case 4: /* Maximize Window */
|
case 4: /* Maximize Window */
|
||||||
/* using event B_FULL */
|
/* using event B_FULL */
|
||||||
break;
|
break;
|
||||||
|
case 5: /* jump to next marker */
|
||||||
|
nextprev_marker(1);
|
||||||
|
break;
|
||||||
|
case 6: /* jump to previous marker */
|
||||||
|
nextprev_marker(-1);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
allqueue(REDRAWVIEW3D, 0);
|
allqueue(REDRAWVIEW3D, 0);
|
||||||
}
|
}
|
||||||
@@ -199,6 +206,13 @@ static uiBlock *sound_viewmenu(void *arg_unused)
|
|||||||
UI_EMBOSSP, UI_HELV, curarea->headwin);
|
UI_EMBOSSP, UI_HELV, curarea->headwin);
|
||||||
uiBlockSetButmFunc(block, do_sound_viewmenu, NULL);
|
uiBlockSetButmFunc(block, do_sound_viewmenu, NULL);
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Next Marker|PageUp", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 0, 5, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Jump To Prev Marker|PageDown", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 0, 6, "");
|
||||||
|
|
||||||
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation|Alt A", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Play Back Animation in 3D View|Alt Shift A", 0, yco-=20,
|
||||||
@@ -226,6 +240,72 @@ static uiBlock *sound_viewmenu(void *arg_unused)
|
|||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void do_sound_markermenu(void *arg, int event)
|
||||||
|
{
|
||||||
|
switch(event)
|
||||||
|
{
|
||||||
|
case 1:
|
||||||
|
add_marker(CFRA);
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
duplicate_marker();
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
remove_marker();
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
rename_marker();
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
transform_markers('g', 0);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
static uiBlock *sound_markermenu(void *arg_unused)
|
||||||
|
{
|
||||||
|
uiBlock *block;
|
||||||
|
short yco= 0, menuwidth=120;
|
||||||
|
|
||||||
|
block= uiNewBlock(&curarea->uiblocks, "sound_markermenu",
|
||||||
|
UI_EMBOSSP, UI_HELV, curarea->headwin);
|
||||||
|
uiBlockSetButmFunc(block, do_sound_markermenu, NULL);
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Shift D", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 2, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||||
|
|
||||||
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "(Re)Name Marker|Shift M", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
||||||
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20,
|
||||||
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
||||||
|
|
||||||
|
|
||||||
|
if(curarea->headertype==HEADERTOP) {
|
||||||
|
uiBlockSetDirection(block, UI_DOWN);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
uiBlockSetDirection(block, UI_TOP);
|
||||||
|
uiBlockFlipOrder(block);
|
||||||
|
}
|
||||||
|
|
||||||
|
uiTextBoundsBlock(block, 50);
|
||||||
|
|
||||||
|
return block;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void sound_buttons(void)
|
void sound_buttons(void)
|
||||||
{
|
{
|
||||||
uiBlock *block;
|
uiBlock *block;
|
||||||
@@ -278,6 +358,10 @@ void sound_buttons(void)
|
|||||||
"View", xco, -2, xmax-3, 24, "");
|
"View", xco, -2, xmax-3, 24, "");
|
||||||
xco+= xmax;
|
xco+= xmax;
|
||||||
|
|
||||||
|
xmax= GetButStringLength("Marker");
|
||||||
|
uiDefPulldownBut(block, sound_markermenu, NULL,
|
||||||
|
"Marker", xco, -2, xmax-3, 24, "");
|
||||||
|
xco+= xmax;
|
||||||
}
|
}
|
||||||
|
|
||||||
uiBlockSetEmboss(block, UI_EMBOSS);
|
uiBlockSetEmboss(block, UI_EMBOSS);
|
||||||
|
|||||||
@@ -203,10 +203,10 @@ static void do_time_viewmenu(void *arg, int event)
|
|||||||
stime->flag ^= TIME_DRAWFRAMES;
|
stime->flag ^= TIME_DRAWFRAMES;
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
nextprev_timeline_marker(1);
|
nextprev_marker(1);
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
nextprev_timeline_marker(-1);
|
nextprev_marker(-1);
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
nextprev_timeline_key(1);
|
nextprev_timeline_key(1);
|
||||||
@@ -290,22 +290,26 @@ static void do_time_framemenu(void *arg, int event)
|
|||||||
allqueue(REDRAWALL, 1);
|
allqueue(REDRAWALL, 1);
|
||||||
break;
|
break;
|
||||||
case 3: /* Add Marker */
|
case 3: /* Add Marker */
|
||||||
add_timeline_marker(CFRA);
|
add_marker(CFRA);
|
||||||
break;
|
break;
|
||||||
case 4: /* Remove Marker */
|
case 4: /* Remove Marker */
|
||||||
remove_timeline_marker();
|
remove_marker();
|
||||||
break;
|
break;
|
||||||
case 5: /* Rename Marker */
|
case 5: /* Rename Marker */
|
||||||
rename_timeline_marker();
|
rename_marker();
|
||||||
break;
|
break;
|
||||||
case 6: /* Grab Marker */
|
case 6: /* Grab Marker */
|
||||||
timeline_grab('g', 0);
|
transform_markers('g', 0);
|
||||||
break;
|
break;
|
||||||
case 7: /* duplicate marker */
|
case 7: /* duplicate marker */
|
||||||
duplicate_timeline_marker();
|
duplicate_marker();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
allqueue(REDRAWTIME, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
static uiBlock *time_framemenu(void *arg_unused)
|
static uiBlock *time_framemenu(void *arg_unused)
|
||||||
@@ -319,14 +323,14 @@ static uiBlock *time_framemenu(void *arg_unused)
|
|||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Add Marker|M", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 3, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Duplicate Marker|Shift D", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 7, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Delete Marker|X", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 4, "");
|
||||||
|
|
||||||
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
|
||||||
|
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Ctrl M", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Name Marker|Shift M", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 5, "");
|
||||||
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20,
|
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move Marker|G", 0, yco-=20,
|
||||||
menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
|
menuwidth, 19, NULL, 0.0, 0.0, 1, 6, "");
|
||||||
|
|||||||
@@ -135,6 +135,7 @@
|
|||||||
#include "BSE_filesel.h"
|
#include "BSE_filesel.h"
|
||||||
#include "BSE_headerbuttons.h"
|
#include "BSE_headerbuttons.h"
|
||||||
#include "BSE_editnla_types.h"
|
#include "BSE_editnla_types.h"
|
||||||
|
#include "BSE_time.h"
|
||||||
|
|
||||||
#include "BDR_vpaint.h"
|
#include "BDR_vpaint.h"
|
||||||
#include "BDR_editmball.h"
|
#include "BDR_editmball.h"
|
||||||
@@ -1871,9 +1872,14 @@ static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
selectrow_nurb();
|
selectrow_nurb();
|
||||||
}
|
}
|
||||||
else if(G.qual==LR_CTRLKEY) {
|
else if(G.qual==LR_CTRLKEY) {
|
||||||
if (G.obedit->type==OB_MESH)
|
if (G.obedit->type==OB_MESH) {
|
||||||
CutEdgeloop(1);
|
CutEdgeloop(1);
|
||||||
BIF_undo_push("Cut Edgeloop");
|
BIF_undo_push("Cut Edgeloop");
|
||||||
|
}
|
||||||
|
//else if (G.obedit->type==OB_ARMATURE) {
|
||||||
|
// initTransform(TFM_BONE_ROLL, CTX_NONE);
|
||||||
|
// Transform();
|
||||||
|
//}
|
||||||
}
|
}
|
||||||
else if((G.qual==0)) {
|
else if((G.qual==0)) {
|
||||||
initTransform(TFM_ROTATION, CTX_NONE);
|
initTransform(TFM_ROTATION, CTX_NONE);
|
||||||
@@ -2342,8 +2348,11 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
case RIGHTMOUSE:
|
case RIGHTMOUSE:
|
||||||
mouse_select_ipo();
|
mouse_select_ipo();
|
||||||
allqueue (REDRAWACTION, 0);
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
allqueue(REDRAWNLA, 0);
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
break;
|
break;
|
||||||
case MIDDLEMOUSE:
|
case MIDDLEMOUSE:
|
||||||
if(in_ipo_buttons()) {
|
if(in_ipo_buttons()) {
|
||||||
@@ -2364,16 +2373,20 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
doredraw= 1;
|
doredraw= 1;
|
||||||
break;
|
break;
|
||||||
case PAGEUPKEY:
|
case PAGEUPKEY:
|
||||||
if(G.qual==LR_CTRLKEY)
|
if(G.qual & LR_CTRLKEY)
|
||||||
movekey_ipo(1);
|
movekey_ipo(1);
|
||||||
else if((G.qual==0))
|
else if(G.qual & LR_SHIFTKEY)
|
||||||
nextkey_ipo(1);
|
nextkey_ipo(1);
|
||||||
|
else
|
||||||
|
nextprev_marker(1);
|
||||||
break;
|
break;
|
||||||
case PAGEDOWNKEY:
|
case PAGEDOWNKEY:
|
||||||
if(G.qual==LR_CTRLKEY)
|
if(G.qual & LR_CTRLKEY)
|
||||||
movekey_ipo(-1);
|
movekey_ipo(-1);
|
||||||
else if((G.qual==0))
|
else if(G.qual & LR_SHIFTKEY)
|
||||||
nextkey_ipo(-1);
|
nextkey_ipo(-1);
|
||||||
|
else
|
||||||
|
nextprev_marker(-1);
|
||||||
break;
|
break;
|
||||||
case HOMEKEY:
|
case HOMEKEY:
|
||||||
if((G.qual==0))
|
if((G.qual==0))
|
||||||
@@ -2381,7 +2394,15 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case AKEY:
|
case AKEY:
|
||||||
if((G.qual==0)) {
|
if (G.qual & LR_CTRLKEY) {
|
||||||
|
deselect_markers(1, 0);
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
|
else if (G.qual==0) {
|
||||||
if(in_ipo_buttons()) {
|
if(in_ipo_buttons()) {
|
||||||
swap_visible_editipo();
|
swap_visible_editipo();
|
||||||
}
|
}
|
||||||
@@ -2392,37 +2413,42 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
allqueue (REDRAWNLA, 0);
|
allqueue (REDRAWNLA, 0);
|
||||||
allqueue (REDRAWACTION, 0);
|
allqueue (REDRAWACTION, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
case BKEY:
|
case BKEY:
|
||||||
if((G.qual==0))
|
if (G.qual==0)
|
||||||
borderselect_ipo();
|
borderselect_ipo();
|
||||||
break;
|
break;
|
||||||
case CKEY:
|
case CKEY:
|
||||||
if((G.qual==0))
|
if (G.qual==0)
|
||||||
move_to_frame();
|
move_to_frame();
|
||||||
break;
|
break;
|
||||||
case DKEY:
|
case DKEY:
|
||||||
if((G.qual==LR_SHIFTKEY))
|
if (G.qual==LR_SHIFTKEY)
|
||||||
add_duplicate_editipo();
|
add_duplicate_editipo();
|
||||||
|
else if (G.qual == (LR_CTRLKEY|LR_SHIFTKEY))
|
||||||
|
duplicate_marker();
|
||||||
break;
|
break;
|
||||||
case GKEY:
|
case GKEY:
|
||||||
if((G.qual==0))
|
if (G.qual & LR_SHIFTKEY)
|
||||||
|
transform_markers('g', 0);
|
||||||
|
else if (G.qual==0)
|
||||||
transform_ipo('g');
|
transform_ipo('g');
|
||||||
break;
|
break;
|
||||||
case HKEY:
|
case HKEY:
|
||||||
if(G.qual==LR_ALTKEY)
|
if (G.qual==LR_ALTKEY)
|
||||||
sethandles_ipo(HD_AUTO_ANIM);
|
sethandles_ipo(HD_AUTO_ANIM);
|
||||||
if(G.qual==LR_SHIFTKEY)
|
if (G.qual==LR_SHIFTKEY)
|
||||||
sethandles_ipo(HD_AUTO);
|
sethandles_ipo(HD_AUTO);
|
||||||
else if(G.qual==0)
|
else if (G.qual==0)
|
||||||
sethandles_ipo(HD_ALIGN);
|
sethandles_ipo(HD_ALIGN);
|
||||||
break;
|
break;
|
||||||
case JKEY:
|
case JKEY:
|
||||||
if((G.qual==LR_CTRLKEY))
|
if (G.qual==LR_CTRLKEY)
|
||||||
join_ipo_menu();
|
join_ipo_menu();
|
||||||
break;
|
break;
|
||||||
case KKEY:
|
case KKEY:
|
||||||
if((G.qual==0)) {
|
if (G.qual==0) {
|
||||||
ipo_toggle_showkey();
|
ipo_toggle_showkey();
|
||||||
scrarea_queue_headredraw(curarea);
|
scrarea_queue_headredraw(curarea);
|
||||||
allqueue(REDRAWVIEW3D, 0);
|
allqueue(REDRAWVIEW3D, 0);
|
||||||
@@ -2430,40 +2456,64 @@ static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MKEY:
|
case MKEY:
|
||||||
if((G.qual==0))
|
if (G.qual==LR_CTRLKEY) {
|
||||||
ipo_mirror_menu();
|
ipo_mirror_menu();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (G.qual == 0)
|
||||||
|
add_marker(CFRA);
|
||||||
|
else if (G.qual == LR_SHIFTKEY)
|
||||||
|
rename_marker();
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
break;
|
break;
|
||||||
case NKEY:
|
case NKEY:
|
||||||
toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
||||||
doredraw= 1;
|
doredraw= 1;
|
||||||
break;
|
break;
|
||||||
case OKEY:
|
case OKEY:
|
||||||
if(G.qual==LR_SHIFTKEY)
|
if (G.qual==LR_SHIFTKEY)
|
||||||
smooth_ipo();
|
smooth_ipo();
|
||||||
else
|
else
|
||||||
clean_ipo(sipo->ipo, 1);
|
clean_ipo(sipo->ipo, 1);
|
||||||
break;
|
break;
|
||||||
case RKEY:
|
case RKEY:
|
||||||
if((G.qual==0))
|
if (G.qual==0)
|
||||||
ipo_record();
|
ipo_record();
|
||||||
break;
|
break;
|
||||||
case SKEY:
|
case SKEY:
|
||||||
if((G.qual==LR_SHIFTKEY)) {
|
if (G.qual==LR_SHIFTKEY) {
|
||||||
ipo_snap_menu();
|
ipo_snap_menu();
|
||||||
} else if((G.qual==0))
|
}
|
||||||
|
else if (G.qual==0)
|
||||||
transform_ipo('s');
|
transform_ipo('s');
|
||||||
break;
|
break;
|
||||||
case TKEY:
|
case TKEY:
|
||||||
if((G.qual==0))
|
if (G.qual==0)
|
||||||
set_ipotype();
|
set_ipotype();
|
||||||
break;
|
break;
|
||||||
case VKEY:
|
case VKEY:
|
||||||
if((G.qual==0))
|
if (G.qual==0)
|
||||||
sethandles_ipo(HD_VECT);
|
sethandles_ipo(HD_VECT);
|
||||||
break;
|
break;
|
||||||
case XKEY:
|
case XKEY:
|
||||||
case DELKEY:
|
case DELKEY:
|
||||||
del_ipo();
|
val= pupmenu("Erase selected%t|Keys %x1|Markers %x2");
|
||||||
|
if (val == 1)
|
||||||
|
del_ipo(0);
|
||||||
|
else if (val == 2) {
|
||||||
|
remove_marker();
|
||||||
|
allqueue(REDRAWTIME, 0);
|
||||||
|
allqueue(REDRAWIPO, 0);
|
||||||
|
allqueue(REDRAWACTION, 0);
|
||||||
|
allqueue(REDRAWNLA, 0);
|
||||||
|
allqueue(REDRAWSOUND, 0);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user