Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/blender/include/BIF_editaction.h2
-rw-r--r--source/blender/include/BIF_editnla.h1
-rw-r--r--source/blender/include/BIF_editseq.h3
-rw-r--r--source/blender/src/editaction.c6
-rw-r--r--source/blender/src/editnla.c3
-rw-r--r--source/blender/src/editseq.c16
-rw-r--r--source/blender/src/header_action.c72
-rw-r--r--source/blender/src/header_image.c3
-rw-r--r--source/blender/src/header_ipo.c33
-rw-r--r--source/blender/src/header_nla.c32
-rw-r--r--source/blender/src/header_oops.c41
-rw-r--r--source/blender/src/header_seq.c13
-rw-r--r--source/blender/src/space.c2
13 files changed, 203 insertions, 24 deletions
diff --git a/source/blender/include/BIF_editaction.h b/source/blender/include/BIF_editaction.h
index 0e56a2464d2..e0e1d3cc6c6 100644
--- a/source/blender/include/BIF_editaction.h
+++ b/source/blender/include/BIF_editaction.h
@@ -43,6 +43,8 @@ void delete_meshchannel_keys(struct Key *key);
void delete_actionchannel_keys(void);
void duplicate_meshchannel_keys(struct Key *key);
void duplicate_actionchannel_keys(void);
+void transform_actionchannel_keys(char mode);
+void transform_meshchannel_keys(char mode, Key *key);
/* Handles */
void sethandles_meshchannel_keys(int code, struct Key *key);
diff --git a/source/blender/include/BIF_editnla.h b/source/blender/include/BIF_editnla.h
index 8661e8f98e5..cf4e4b2d755 100644
--- a/source/blender/include/BIF_editnla.h
+++ b/source/blender/include/BIF_editnla.h
@@ -39,6 +39,7 @@ void clever_numbuts_nla(void);
void delete_nlachannel_keys(void);
void delete_nlachannels(void);
void duplicate_nlachannel_keys(void);
+void transform_nlachannel_keys(char mode);
/* Select */
void borderselect_nla(void);
diff --git a/source/blender/include/BIF_editseq.h b/source/blender/include/BIF_editseq.h
index afdcb42f812..cf0d9ca26d3 100644
--- a/source/blender/include/BIF_editseq.h
+++ b/source/blender/include/BIF_editseq.h
@@ -50,7 +50,8 @@ int insert_gap(int gap, int cfra);
void make_meta(void);
void mouse_select_seq(void);
void no_gaps(void);
-void seq_snapmenu(void);
+void seq_snap(short event);
+void seq_snap_menu(void);
void set_filter_seq(void);
void swap_select_seq(void);
void touch_seq_files(void);
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index 7917815ff52..beb5a521589 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -113,8 +113,6 @@ static void mouse_action(int selectmode);
static void mouse_mesh_action(int selectmode, Key *key);
static bActionChannel *get_nearest_actionchannel_key (float *index, short *sel, bConstraintChannel **conchan);
static void delete_actionchannels(void);
-static void transform_actionchannel_keys(char mode);
-static void transform_meshchannel_keys(char mode, Key *key);
static void select_poseelement_by_name (char *name, int select);
static void hilight_channel (bAction *act, bActionChannel *chan, short hilight);
static void set_action_key_time (bAction *act, bPoseChannel *chan, int adrcode, short makecurve, float time);
@@ -1108,7 +1106,7 @@ bAction *add_empty_action(void)
return act;
}
-static void transform_actionchannel_keys(char mode)
+void transform_actionchannel_keys(char mode)
{
bAction *act;
TransVert *tv;
@@ -1282,7 +1280,7 @@ static void transform_actionchannel_keys(char mode)
MEM_freeN (tv);
}
-static void transform_meshchannel_keys(char mode, Key *key)
+void transform_meshchannel_keys(char mode, Key *key)
{
/* this is the function that determines what happens
* to those little blocky rvk key things you have selected
diff --git a/source/blender/src/editnla.c b/source/blender/src/editnla.c
index f6ba41a6c9f..c4f85c1ef5d 100644
--- a/source/blender/src/editnla.c
+++ b/source/blender/src/editnla.c
@@ -90,7 +90,6 @@
/* Note: A lot of these pretty much duplicate the behaviour of the
action windows. The functions should be shared, not copy-pasted */
-static void transform_nlachannel_keys(char mode);
static void mouse_nla(int selectmode);
static Base *get_nearest_nlachannel_ob_key (float *index, short *sel);
static bAction *get_nearest_nlachannel_ac_key (float *index, short *sel);
@@ -720,7 +719,7 @@ void deselect_nlachannel_keys (int test)
}
-static void transform_nlachannel_keys(char mode)
+void transform_nlachannel_keys(char mode)
{
Base *base;
TransVert *tv;
diff --git a/source/blender/src/editseq.c b/source/blender/src/editseq.c
index 0256217a1ef..0731d671ead 100644
--- a/source/blender/src/editseq.c
+++ b/source/blender/src/editseq.c
@@ -1994,7 +1994,17 @@ void clever_numbuts_seq(void)
}
}
-void seq_snapmenu(void)
+void seq_snap_menu(void)
+{
+ short event;
+
+ event= pupmenu("Snap %t|To Current Frame%x1");
+ if(event < 1) return;
+
+ seq_snap(event);
+}
+
+void seq_snap(short event)
{
Editing *ed;
Sequence *seq;
@@ -2002,10 +2012,6 @@ void seq_snapmenu(void)
ed= G.scene->ed;
if(ed==0) return;
-
- event= pupmenu("Snap %t|Seq to frame%x1");
-
- if(event<1) return;
/* problem: contents of meta's are all shifted to the same position... */
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index f79bb2da7b5..1581f22be8f 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -99,6 +99,9 @@
#define ACTMENU_KEY_DELETE 1
#define ACTMENU_KEY_BAKE 2
+#define ACTMENU_KEY_TRANSFORM_MOVE 0
+#define ACTMENU_KEY_TRANSFORM_SCALE 1
+
#define ACTMENU_KEY_HANDLE_AUTO 0
#define ACTMENU_KEY_HANDLE_ALIGN 1
#define ACTMENU_KEY_HANDLE_FREE 2
@@ -378,6 +381,56 @@ static uiBlock *action_selectmenu(void *arg_unused)
return block;
}
+static void do_action_keymenu_transformmenu(void *arg, int event)
+{
+ Key *key;
+ key = get_action_mesh_key();
+
+ switch(event)
+ {
+ case ACTMENU_KEY_TRANSFORM_MOVE:
+ if (key) {
+ transform_meshchannel_keys('g', key);
+ } else {
+ transform_actionchannel_keys ('g');
+ }
+ break;
+ case ACTMENU_KEY_TRANSFORM_SCALE:
+ if (key) {
+ transform_meshchannel_keys('s', key);
+ } else {
+ transform_actionchannel_keys ('s');
+ }
+ break;
+ }
+
+ scrarea_queue_winredraw(curarea);
+}
+
+static uiBlock *action_keymenu_transformmenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiNewBlock(&curarea->uiblocks, "action_keymenu_transformmenu",
+ UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_action_keymenu_transformmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Grab/Move|G", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_TRANSFORM_MOVE, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Scale|S", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_TRANSFORM_SCALE, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+
+ return block;
+}
+
static void do_action_keymenu_handlemenu(void *arg, int event)
{
Key *key;
@@ -561,15 +614,22 @@ static uiBlock *action_keymenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "action_keymenu",
UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetButmFunc(block, do_action_keymenu, NULL);
+
+ uiDefIconTextBlockBut(block, action_keymenu_transformmenu,
+ NULL, ICON_RIGHTARROW_THIN,
+ "Transform", 0, yco-=20, 120, 20, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6,
+ menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Duplicate|Shift D", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_DUPLICATE, "");
+ "Duplicate|Shift D", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_DUPLICATE, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
- "Delete|X", 0, yco-=20,
- menuwidth, 19, NULL, 0.0, 0.0, 0,
- ACTMENU_KEY_DELETE, "");
+ "Delete|X", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_KEY_DELETE, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/header_image.c b/source/blender/src/header_image.c
index 3a29dbbf1b4..03a0901c8c7 100644
--- a/source/blender/src/header_image.c
+++ b/source/blender/src/header_image.c
@@ -801,6 +801,9 @@ static uiBlock *image_uvs_transformmenu(void *arg_unused)
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Rotate|R", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 2, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Weld/Align|W", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 3, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Mirror...|M", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
diff --git a/source/blender/src/header_ipo.c b/source/blender/src/header_ipo.c
index 1bce54c4065..3c34cde2764 100644
--- a/source/blender/src/header_ipo.c
+++ b/source/blender/src/header_ipo.c
@@ -88,6 +88,36 @@ static int viewmovetemp = 0;
extern int totipo_edit, totipo_sel;
+static void do_ipo_editmenu_transformmenu(void *arg, int event)
+{
+ switch(event)
+ {
+ case 0: /* grab/move */
+ transform_ipo('g');
+ break;
+ case 1: /* scale */
+ transform_ipo('s');
+ break;
+ }
+}
+
+static uiBlock *ipo_editmenu_transformmenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiNewBlock(&curarea->uiblocks, "ipo_editmenu_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_ipo_editmenu_transformmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+
+ return block;
+}
+
static void do_ipo_editmenu_snapmenu(void *arg, int event)
{
switch(event) {
@@ -370,6 +400,9 @@ static uiBlock *ipo_editmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_ipo_editmenu, NULL);
uiDefIconTextBut(block, BUTM, 1, ICON_MENU_PANEL, "Transform Properties|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 4, "");
+
+ uiDefIconTextBlockBut(block, ipo_editmenu_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 19, "");
+
uiDefIconTextBlockBut(block, ipo_editmenu_snapmenu, NULL, ICON_RIGHTARROW_THIN, "Snap", 0, yco-=20, 120, 19, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/header_nla.c b/source/blender/src/header_nla.c
index 77abc897542..8260607e5de 100644
--- a/source/blender/src/header_nla.c
+++ b/source/blender/src/header_nla.c
@@ -237,6 +237,37 @@ static void do_nla_stripmenu(void *arg, int event)
}
}
+static void do_nla_strip_transformmenu(void *arg, int event)
+{
+ switch(event) {
+ case 0: /* grab/move */
+ transform_nlachannel_keys ('g');
+ update_for_newframe_muted();
+ break;
+ case 1: /* scale */
+ transform_nlachannel_keys ('s');
+ update_for_newframe_muted();
+ break;
+ }
+ allqueue(REDRAWVIEW3D, 0);
+}
+
+static uiBlock *nla_strip_transformmenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco = 20, menuwidth = 120;
+
+ block= uiNewBlock(&curarea->uiblocks, "nla_strip_transformmenu", UI_EMBOSSP, UI_HELV, G.curscreen->mainwin);
+ uiBlockSetButmFunc(block, do_nla_strip_transformmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 1, "");
+
+ uiBlockSetDirection(block, UI_RIGHT);
+ uiTextBoundsBlock(block, 60);
+ return block;
+}
+
static uiBlock *nla_stripmenu(void *arg_unused)
{
uiBlock *block;
@@ -246,6 +277,7 @@ static uiBlock *nla_stripmenu(void *arg_unused)
uiBlockSetButmFunc(block, do_nla_stripmenu, NULL);
// uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Strip Properties...|N", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBlockBut(block, nla_strip_transformmenu, NULL, ICON_RIGHTARROW_THIN, "Transform", 0, yco-=20, 120, 20, "");
// uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/header_oops.c b/source/blender/src/header_oops.c
index 8729af904f8..84a1d1008ab 100644
--- a/source/blender/src/header_oops.c
+++ b/source/blender/src/header_oops.c
@@ -206,6 +206,43 @@ static uiBlock *oops_selectmenu(void *arg_unused)
return block;
}
+static void do_oops_blockmenu(void *arg, int event)
+{
+ switch(event)
+ {
+ case 0: /* grab/move */
+ transform_oops('g');
+ break;
+ case 1: /* scale */
+ transform_oops('s');
+ break;
+ }
+}
+
+static uiBlock *oops_blockmenu(void *arg_unused)
+{
+ uiBlock *block;
+ short yco= 0, menuwidth=120;
+
+ block= uiNewBlock(&curarea->uiblocks, "oops_blockmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
+ uiBlockSetButmFunc(block, do_oops_blockmenu, NULL);
+
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 0, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Scale|S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 1, "");
+
+ if(curarea->headertype==HEADERTOP) {
+ uiBlockSetDirection(block, UI_DOWN);
+ }
+ else {
+ uiBlockSetDirection(block, UI_TOP);
+ uiBlockFlipOrder(block);
+ }
+
+ uiTextBoundsBlock(block, 50);
+
+ return block;
+}
+
void oops_buttons(void)
{
@@ -255,6 +292,10 @@ void oops_buttons(void)
xmax= GetButStringLength("Select");
uiDefBlockBut(block, oops_selectmenu, NULL, "Select", xco, -2, xmax-3, 24, "");
xco+= xmax;
+
+ xmax= GetButStringLength("Block");
+ uiDefBlockBut(block, oops_blockmenu, NULL, "Block", xco, -2, xmax-3, 24, "");
+ xco+= xmax;
}
diff --git a/source/blender/src/header_seq.c b/source/blender/src/header_seq.c
index 211782f4481..a86cb4d4e4d 100644
--- a/source/blender/src/header_seq.c
+++ b/source/blender/src/header_seq.c
@@ -284,7 +284,6 @@ static uiBlock *seq_addmenu(void *arg_unused)
return block;
}
-
static void do_seq_editmenu(void *arg, int event)
{
SpaceSeq *sseq;
@@ -311,9 +310,6 @@ static void do_seq_editmenu(void *arg, int event)
case 6: /* Delete */
del_seq();
break;
- case 7: /* Snap menu */
- seq_snapmenu();
- break;
case 8:
set_filter_seq();
break;
@@ -323,6 +319,12 @@ static void do_seq_editmenu(void *arg, int event)
case 10:
exit_meta();
break;
+ case 11: /* grab/move */
+ transform_seq('g');
+ break;
+ case 12: /* Snap to Current Frame */
+ seq_snap(event);
+ break;
}
}
@@ -337,7 +339,8 @@ static uiBlock *seq_editmenu(void *arg_unused)
block= uiNewBlock(&curarea->uiblocks, "seq_editmenu", UI_EMBOSSP, UI_HELV, curarea->headwin);
uiBlockSetButmFunc(block, do_seq_editmenu, NULL);
- uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap...|Shift S", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 7, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Grab/Move|G", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 0, 11, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1, "Snap to Current Frame|Shift S, 1", 0, yco-=20, menuwidth, 19, NULL, 0.0, 0.0, 1, 12, "");
uiDefBut(block, SEPR, 0, "", 0, yco-=6, menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
diff --git a/source/blender/src/space.c b/source/blender/src/space.c
index 458dabc1cda..040de8e66bf 100644
--- a/source/blender/src/space.c
+++ b/source/blender/src/space.c
@@ -2993,7 +2993,7 @@ void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
break;
case SKEY:
if((G.qual==LR_SHIFTKEY))
- seq_snapmenu();
+ seq_snap_menu();
break;
case TKEY:
if((G.qual==0))