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>2009-10-13 15:21:02 +0400
committerJoshua Leung <aligorith@gmail.com>2009-10-13 15:21:02 +0400
commitde818dace53343a1fcbb03d8e535a77617c037fa (patch)
treeea7fb3911d8d3409488577fe0c89e3d89b527471 /source/blender/editors/animation/anim_channels_defines.c
parentf4d29269866a3bc4f9346bf24753d72da2456fc9 (diff)
DopeSheet: DopeSheet Summary Channel
Added a summary channel that appears as the first channel in the DopeSheet. For now, this is disabled by default, but can be enabled using the 'Summary' toggle in the header between the mode selector and the standard filtering options. This has been done, since there is a possibility that it will make the DopeSheet run a bit slower. In this channel you can do everything that you can normally do with DopeSheet channels (i.e. select, transform, edit, etc). It might be worth noting though that care probably needs to be taken when trying to use Copy/Paste, since that is still a bit fidgety... In the process, I've fixed a few bugs, mostly with selection: - Selecting keyframes in scene summaries wouldn't work - Border select only worked in F-Curve and Group channels
Diffstat (limited to 'source/blender/editors/animation/anim_channels_defines.c')
-rw-r--r--source/blender/editors/animation/anim_channels_defines.c54
1 files changed, 54 insertions, 0 deletions
diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c
index 427fa47923f..a4423d43339 100644
--- a/source/blender/editors/animation/anim_channels_defines.c
+++ b/source/blender/editors/animation/anim_channels_defines.c
@@ -280,6 +280,12 @@ static void acf_generic_idblock_name(bAnimListElem *ale, char *name)
/* Settings ------------------------------------------- */
+/* channel type has no settings */
+static short acf_generic_none_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
+{
+ return 0;
+}
+
/* check if some setting exists for this object-based data-expander (category only) */
static short acf_generic_dsexpand_setting_valid(bAnimContext *ac, bAnimListElem *ale, int setting)
{
@@ -335,6 +341,52 @@ static short acf_generic_dataexpand_setting_valid(bAnimContext *ac, bAnimListEle
/* *********************************************** */
/* Type Specific Functions + Defines */
+/* Animation Summary ----------------------------------- */
+
+/* backdrop for summary widget */
+static void acf_summary_backdrop(bAnimContext *ac, bAnimListElem *ale, float yminc, float ymaxc)
+{
+ View2D *v2d= &ac->ar->v2d;
+
+ // FIXME: hardcoded color - same as the 'action' line in NLA
+ glColor3f(0.8f, 0.2f, 0.0f); // reddish color
+
+ /* rounded corners on LHS only
+ * - top and bottom
+ * - special hack: make the top a bit higher, since we are first...
+ */
+ uiSetRoundBox((1|8));
+ gl_round_box(GL_POLYGON, 0, yminc-2, v2d->cur.xmax+EXTRA_SCROLL_PAD, ymaxc, 8);
+}
+
+/* name for summary entries */
+static void acf_summary_name(bAnimListElem *ale, char *name)
+{
+ if (name)
+ strcpy(name, "DopeSheet Summary");
+}
+
+// TODO: this is really a temp icon I think
+static int acf_summary_icon(bAnimListElem *ale)
+{
+ return ICON_BORDERMOVE;
+}
+
+/* all animation summary (DopeSheet only) type define */
+static bAnimChannelType ACF_SUMMARY =
+{
+ acf_summary_backdrop, /* backdrop */
+ acf_generic_indention_0, /* indent level */
+ NULL, /* offset */
+
+ acf_summary_name, /* name */
+ acf_summary_icon, /* icon */
+
+ acf_generic_none_setting_valid, /* has setting */
+ NULL, /* flag for setting */
+ NULL /* pointer for setting */
+};
+
/* Scene ------------------------------------------- */
// TODO: just get this from RNA?
@@ -1803,6 +1855,8 @@ void ANIM_init_channel_typeinfo_data (void)
animchannelTypeInfo[type++]= NULL; /* AnimData */
animchannelTypeInfo[type++]= NULL; /* Special */
+ animchannelTypeInfo[type++]= &ACF_SUMMARY; /* Motion Summary */
+
animchannelTypeInfo[type++]= &ACF_SCENE; /* Scene */
animchannelTypeInfo[type++]= &ACF_OBJECT; /* Object */
animchannelTypeInfo[type++]= &ACF_GROUP; /* Group */