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-08-16 06:21:43 +0400
committerJoshua Leung <aligorith@gmail.com>2009-08-16 06:21:43 +0400
commitb257acfed11e8d98eb7c86e0908acf80fb9e27af (patch)
treea1b197d8355a6f66df48939627ea814eebf16fdd /source/blender/editors/space_nla/nla_edit.c
parentebf1c5faca86286aa90ab5ab9fc4d3ddb1f51cdf (diff)
Animation Editors: Code Cleanups (for Channel Lists) Part 2
Now the mute/protect/expand/etc. toggles are drawn using UI widgets. This means that special event handling code to determine when they were clicked on is no longer needed, and also means that there can now be tooltips for these items too. Also, added visibility toggles for ID-block expanders, which will cause all the F-Curves in the linked datablock to not get drawn. The backend filtering code to make this work will come later...
Diffstat (limited to 'source/blender/editors/space_nla/nla_edit.c')
-rw-r--r--source/blender/editors/space_nla/nla_edit.c52
1 files changed, 52 insertions, 0 deletions
diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c
index d476852ef2d..763f4116416 100644
--- a/source/blender/editors/space_nla/nla_edit.c
+++ b/source/blender/editors/space_nla/nla_edit.c
@@ -919,6 +919,58 @@ void NLA_OT_split (wmOperatorType *ot)
ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
}
+/* ******************** Bake Strips Operator ***************************** */
+/* Bakes the NLA Strips for the active AnimData blocks */
+
+static int nlaedit_bake_exec (bContext *C, wmOperator *op)
+{
+ bAnimContext ac;
+
+ ListBase anim_data = {NULL, NULL};
+ bAnimListElem *ale;
+ int filter;
+
+ /* get editor data */
+ if (ANIM_animdata_get_context(C, &ac) == 0)
+ return OPERATOR_CANCELLED;
+
+ /* get a list of the editable tracks being shown in the NLA */
+ filter= (ANIMFILTER_VISIBLE | ANIMFILTER_ANIMDATA | ANIMFILTER_FOREDIT);
+ ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
+
+ /* for each AnimData block, bake strips to animdata... */
+ for (ale= anim_data.first; ale; ale= ale->next) {
+ // FIXME
+ }
+
+ /* free temp data */
+ BLI_freelistN(&anim_data);
+
+ /* refresh auto strip properties */
+ ED_nla_postop_refresh(&ac);
+
+ /* set notifier that things have changed */
+ WM_event_add_notifier(C, NC_ANIMATION|ND_NLA_EDIT, NULL);
+
+ /* done */
+ return OPERATOR_FINISHED;
+}
+
+void NLA_OT_bake (wmOperatorType *ot)
+{
+ /* identifiers */
+ ot->name= "Bake Strips";
+ ot->idname= "NLA_OT_bake";
+ ot->description= "Bake all strips of selected AnimData blocks.";
+
+ /* api callbacks */
+ ot->exec= nlaedit_bake_exec;
+ ot->poll= nlaop_poll_tweakmode_off;
+
+ /* flags */
+ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
+}
+
/* *********************************************** */
/* NLA Editing Operations (Modifying) */