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

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2006-11-16 07:01:01 +0300
committerJoshua Leung <aligorith@gmail.com>2006-11-16 07:01:01 +0300
commit1b3f368e84b0fba04c1a6ebf1e4b5d724d3fa8cf (patch)
treea2d564a1f5452fb1d88f605f213409d8c85504d8 /source/blender/src
parent0ddd910189f1a7fcf798f76b4c4a1aed9df4d8cd (diff)
== Action Editor Makers ==
* There is now a feature to (de)select all markers. Can be found in menu or via the hotkey Ctrl A * The 'Markers' menu is now not drawn when marker set is 'None' * Some other minor code cleanups Additional Notes: * I'm still trying to track down the cause of a bug which means that you can't select more than one marker (with RMB clicks) at once. For now, just use borderselect
Diffstat (limited to 'source/blender/src')
-rw-r--r--source/blender/src/editaction.c79
-rw-r--r--source/blender/src/header_action.c31
2 files changed, 89 insertions, 21 deletions
diff --git a/source/blender/src/editaction.c b/source/blender/src/editaction.c
index 81f21211916..03dfdc66e84 100644
--- a/source/blender/src/editaction.c
+++ b/source/blender/src/editaction.c
@@ -648,9 +648,13 @@ static void mouse_action(int selectmode)
if (selectmode == SELECT_REPLACE) {
selectmode = SELECT_ADD;
- deselect_saction_markers(markers, 0);
+ deselect_saction_markers(markers, 0, 0);
marker->flag |= SELECT;
}
+ else if (selectmode == SELECT_ADD)
+ marker->flag |= SELECT;
+ else if (selectmode == SELECT_SUBTRACT)
+ marker->flag &= ~SELECT;
std_rmouse_transform(transform_saction_markers);
@@ -2457,26 +2461,40 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
if (mval[0]<ACTWIDTH){
/* to do ??? */
}
- else{
- deselect_meshchannel_keys(key, 1);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWIPO, 0);
+ else {
+ if (G.qual == LR_CTRLKEY) {
+ deselect_saction_markers(markers, 1, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWTIME, 0);
+ }
+ else {
+ deselect_meshchannel_keys(key, 1);
+ allqueue (REDRAWACTION, 0);
+ allqueue(REDRAWNLA, 0);
+ allqueue (REDRAWIPO, 0);
+ }
}
}
else {
- if (mval[0]<NAMEWIDTH){
+ if (mval[0]<NAMEWIDTH) {
deselect_actionchannels (act, 1);
allqueue (REDRAWVIEW3D, 0);
allqueue (REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
allqueue (REDRAWIPO, 0);
}
- else if (mval[0]>ACTWIDTH){
- deselect_actionchannel_keys (act, 1);
- allqueue (REDRAWACTION, 0);
- allqueue(REDRAWNLA, 0);
- allqueue (REDRAWIPO, 0);
+ else if (mval[0]>ACTWIDTH) {
+ if (G.qual == LR_CTRLKEY) {
+ deselect_saction_markers(markers, 1, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWTIME, 0);
+ }
+ else {
+ deselect_actionchannel_keys (act, 1);
+ allqueue (REDRAWACTION, 0);
+ allqueue(REDRAWNLA, 0);
+ allqueue (REDRAWIPO, 0);
+ }
}
}
break;
@@ -2773,7 +2791,7 @@ void winqreadactionspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
}
/* Clicking in the main area of the action window
- * selects keys
+ * selects keys and markers
*/
else {
if (key) {
@@ -3085,19 +3103,46 @@ TimeMarker *find_nearest_saction_marker(ListBase *markers)
}
/* select/deselect all TimeMarkers */
-void deselect_saction_markers(ListBase *markers, int test)
+void deselect_saction_markers(ListBase *markers, int test, int sel)
{
TimeMarker *marker;
- for (marker = markers->first; marker; marker= marker->next) {
- if (test) {
- if ((marker->flag & SELECT)==0)
+ /* 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 = 0;
+ for (marker= markers->first; marker; marker= marker->next) {
+ if ((marker->flag & SELECT)==0) {
+ sel = 1;
+ 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;
+ }
+ }
}
}
diff --git a/source/blender/src/header_action.c b/source/blender/src/header_action.c
index 0bb18014b4e..4cb3dc27bd2 100644
--- a/source/blender/src/header_action.c
+++ b/source/blender/src/header_action.c
@@ -89,6 +89,7 @@
#define ACTMENU_SEL_ALL_KEYS 1
#define ACTMENU_SEL_ALL_CHAN 2
#define ACTMENU_SEL_COLUMN 3
+#define ACTMENU_SEL_ALL_MARKERS 4
#define ACTMENU_KEY_DUPLICATE 0
#define ACTMENU_KEY_DELETE 1
@@ -335,6 +336,7 @@ static void do_action_selectmenu(void *arg, int event)
SpaceAction *saction;
bAction *act;
Key *key;
+ ListBase *markers;
saction = curarea->spacedata.first;
if (!saction)
@@ -342,6 +344,7 @@ static void do_action_selectmenu(void *arg, int event)
act = saction->action;
key = get_action_mesh_key();
+ markers = get_saction_markers(saction);
switch(event)
{
@@ -380,6 +383,14 @@ static void do_action_selectmenu(void *arg, int event)
case ACTMENU_SEL_COLUMN:
addqueue (curarea->win, KKEY, 1);
break;
+
+ case ACTMENU_SEL_ALL_MARKERS: /* select/deselect all markers */
+ if (markers != NULL) {
+ deselect_saction_markers(markers, 1, 0);
+ allqueue(REDRAWACTION, 0);
+ allqueue(REDRAWTIME, 0);
+ }
+ break;
}
}
@@ -396,16 +407,26 @@ static uiBlock *action_selectmenu(void *arg_unused)
"Border Select|B", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 0,
ACTMENU_SEL_BORDER, "");
+
uiDefBut(block, SEPR, 0, "", 0, yco-=6,
menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
"Select/Deselect All Keys|A", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 0,
ACTMENU_SEL_ALL_KEYS, "");
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
+ "Select/Deselect All Markers|Ctrl A", 0, yco-=20,
+ menuwidth, 19, NULL, 0.0, 0.0, 0,
+ ACTMENU_SEL_ALL_MARKERS, "");
+ uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
"Select/Deselect All Channels", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 0,
ACTMENU_SEL_ALL_CHAN, "");
+
+ uiDefBut(block, SEPR, 0, "", 0, yco-=6,
+ menuwidth, 6, NULL, 0.0, 0.0, 0, 0, "");
+
uiDefIconTextBut(block, BUTM, 1, ICON_BLANK1,
"Select Column|K", 0, yco-=20,
menuwidth, 19, NULL, 0.0, 0.0, 0,
@@ -1035,10 +1056,12 @@ void action_buttons(void)
"Key", xco, -2, xmax-3, 24, "");
xco+= xmax;
- xmax= GetButStringLength("Marker");
- uiDefPulldownBut(block, action_markermenu, NULL,
- "Marker", xco, -2, xmax-3, 24, "");
- xco+= xmax;
+ if (G.saction->markert != SACTION_NOMARKERS) {
+ xmax= GetButStringLength("Marker");
+ uiDefPulldownBut(block, action_markermenu, NULL,
+ "Marker", xco, -2, xmax-3, 24, "");
+ xco+= xmax;
+ }
}
uiBlockSetEmboss(block, UI_EMBOSS);