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>2012-10-08 09:57:52 +0400
committerJoshua Leung <aligorith@gmail.com>2012-10-08 09:57:52 +0400
commit565e7c8e3cbb4aee0c1b8f17b43f63055c4384f7 (patch)
treefc9fab37d9d68033f82c6291ff616ab1e36776e3 /source/blender/editors/space_action
parent718dea866588b13af6c362bed1bc6e33588fafe3 (diff)
Display enum descriptions in tooltips for operators using a "type" or "mode"
property Changes: This commit adds a second line to the tooltips (below the generic operator description) showing the appropriate description for each enum option. This brings it more into line enum properties in Blender which also show this sort of information. Rationale: Operators such as Snap and Mirror in the Action and Graph Editors use an enum to control their behaviour (respectively, "how to snap" or "what to use as the mirror line"). In the menus, these options are displayed using a submenu, but hovering over each of these items for more information from a tooltip only shows the (relatively unhelpful) generic operator tooltip/description. Another area where these descriptions are useful is for Keying Sets, where it's now possible to see the descriptions for what each Keying Set does/affects/requires. Again, this is more helpful than just the generic tooltip, which would be something like "Insert keyframes using a Keying Set".
Diffstat (limited to 'source/blender/editors/space_action')
-rw-r--r--source/blender/editors/space_action/action_edit.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/source/blender/editors/space_action/action_edit.c b/source/blender/editors/space_action/action_edit.c
index 7635f85a37e..3865234a25d 100644
--- a/source/blender/editors/space_action/action_edit.c
+++ b/source/blender/editors/space_action/action_edit.c
@@ -1369,10 +1369,14 @@ void ACTION_OT_frame_jump(wmOperatorType *ot)
/* defines for snap keyframes tool */
static EnumPropertyItem prop_actkeys_snap_types[] = {
- {ACTKEYS_SNAP_CFRA, "CFRA", 0, "Current frame", ""},
- {ACTKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame", ""}, // XXX as single entry?
- {ACTKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second", ""}, // XXX as single entry?
- {ACTKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker", ""},
+ {ACTKEYS_SNAP_CFRA, "CFRA", 0, "Current frame",
+ "Snap selected keyframes to the current frame"},
+ {ACTKEYS_SNAP_NEAREST_FRAME, "NEAREST_FRAME", 0, "Nearest Frame",
+ "Snap selected keyframes to the nearest (whole) frame. Use to fix accidental sub-frame offsets"},
+ {ACTKEYS_SNAP_NEAREST_SECOND, "NEAREST_SECOND", 0, "Nearest Second",
+ "Snap selected keyframes to the nearest second"},
+ {ACTKEYS_SNAP_NEAREST_MARKER, "NEAREST_MARKER", 0, "Nearest Marker",
+ "Snap selected keyframes to the nearest marker"},
{0, NULL, 0, NULL, NULL}
};
@@ -1473,9 +1477,12 @@ void ACTION_OT_snap(wmOperatorType *ot)
/* defines for mirror keyframes tool */
static EnumPropertyItem prop_actkeys_mirror_types[] = {
- {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current frame", ""},
- {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0", ""},
- {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker", ""},
+ {ACTKEYS_MIRROR_CFRA, "CFRA", 0, "By Times over Current frame",
+ "Flip times of selected keyframes using the current frame as the mirror line"},
+ {ACTKEYS_MIRROR_XAXIS, "XAXIS", 0, "By Values over Value=0",
+ "Flip values of selected keyframes (i.e. negative values become positive, and vica versa)"},
+ {ACTKEYS_MIRROR_MARKER, "MARKER", 0, "By Times over First Selected Marker",
+ "Flip times of selected keyframes using the first selected marker as the reference point"},
{0, NULL, 0, NULL, NULL}
};
@@ -1497,12 +1504,8 @@ static void mirror_action_keys(bAnimContext *ac, short mode)
/* for 'first selected marker' mode, need to find first selected marker first! */
// XXX should this be made into a helper func in the API?
if (mode == ACTKEYS_MIRROR_MARKER) {
- TimeMarker *marker = NULL;
+ TimeMarker *marker = ED_markers_get_first_selected(ac->markers);
- /* find first selected marker */
- marker = ED_markers_get_first_selected(ac->markers);
-
- /* store marker's time (if available) */
if (marker)
ked.f1 = (float)marker->frame;
else