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-06-19 08:45:56 +0400
committerJoshua Leung <aligorith@gmail.com>2009-06-19 08:45:56 +0400
commita87bc73d321f5bddc17fb5c6332637738bfb7fa6 (patch)
treef65a863896bd6402a217ebb679e2872adedd1578 /source/blender/editors/space_nla/nla_buttons.c
parent74884754d221a97c487d4c3630ceb4412b726863 (diff)
NLA SoC: Transition Strips + Strip Adding Operators + Bugfixes
== Transitions == Transition strips are now able to be created + evaluated. Transitions allow for interpolation between the endpoints of two adjacent strips in the same track (i.e. two strips which occur in the same track one after the other, but with a gap between them). - The current behaviour when only one endpoint affects some setting is non-optimal, since it appears somewhat inconsistently extend/replace values... - Transform code needs a few fixes still to deal with these == Strip Adding Operators == * New strips referencing Actions can be added using the Shift-A hotkey while in the strips-area. You must have a track selected first though. The new strip will get added, starting from the current frame, in the selected track(s) only if there is enough space to do so. Otherwise, the new strip gets added at the top of the stack in a new track. * New transition strips can be added with the Shift-T hotkey while in the strips area. You must have two adjacent strips selected for this to work. == New Backend Methods == * Recoded the strip/track adding API to be more flexible * Added a new method for testing whether F-Curve has any modifiers of with certain attributes. Will be used in a later bugfix... == Bugfixes == - Fixed bug with strip-blending which caused the blending modes to be useless. - NLA buttons now use proper poll callbacks instead of defining checks - Commented out missing operator in menus, silencing warnings in console - Removed obsolete/incorrect comments
Diffstat (limited to 'source/blender/editors/space_nla/nla_buttons.c')
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c65
1 files changed, 51 insertions, 14 deletions
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index cb21dd66934..cb76f7fc735 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -144,11 +144,38 @@ static int nla_panel_context(const bContext *C, PointerRNA *nlt_ptr, PointerRNA
return found;
}
+#if 0
static int nla_panel_poll(const bContext *C, PanelType *pt)
{
return nla_panel_context(C, NULL, NULL);
}
+#endif
+static int nla_track_panel_poll(const bContext *C, PanelType *pt)
+{
+ PointerRNA ptr;
+ return (nla_panel_context(C, &ptr, NULL) && (ptr.data != NULL));
+}
+
+static int nla_strip_panel_poll(const bContext *C, PanelType *pt)
+{
+ PointerRNA ptr;
+ return (nla_panel_context(C, NULL, &ptr) && (ptr.data != NULL));
+}
+
+static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *pt)
+{
+ PointerRNA ptr;
+ NlaStrip *strip;
+
+ if (!nla_panel_context(C, NULL, &ptr))
+ return 0;
+ if (ptr.data == NULL)
+ return 0;
+
+ strip= ptr.data;
+ return (strip->type == NLASTRIP_TYPE_CLIP);
+}
/* -------------- */
@@ -163,8 +190,6 @@ static void nla_panel_track (const bContext *C, Panel *pa)
/* check context and also validity of pointer */
if (!nla_panel_context(C, &nlt_ptr, NULL))
return;
- if (nlt_ptr.data == NULL)
- return;
block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
@@ -185,8 +210,6 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
/* check context and also validity of pointer */
if (!nla_panel_context(C, NULL, &strip_ptr))
return;
- if (strip_ptr.data == NULL)
- return;
block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
@@ -239,8 +262,6 @@ static void nla_panel_actclip(const bContext *C, Panel *pa)
/* check context and also validity of pointer */
if (!nla_panel_context(C, NULL, &strip_ptr))
return;
- if (strip_ptr.data == NULL)
- return;
// XXX FIXME: move this check into a poll callback
if (RNA_enum_get(&strip_ptr, "type") != NLASTRIP_TYPE_CLIP)
@@ -279,8 +300,6 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
/* check context and also validity of pointer */
if (!nla_panel_context(C, NULL, &strip_ptr))
return;
- if (strip_ptr.data == NULL)
- return;
block= uiLayoutGetBlock(layout);
uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
@@ -291,6 +310,24 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
// animated_time
}
+/* F-Modifiers for active NLA-Strip */
+static void nla_panel_modifiers(const bContext *C, Panel *pa)
+{
+ PointerRNA strip_ptr;
+ uiLayout *layout= pa->layout;
+ //uiLayout *column, *row, *subcol;
+ uiBlock *block;
+
+ /* check context and also validity of pointer */
+ if (!nla_panel_context(C, NULL, &strip_ptr))
+ return;
+
+ block= uiLayoutGetBlock(layout);
+ uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL);
+
+ // TODO...
+}
+
/* ******************* general ******************************** */
@@ -302,35 +339,35 @@ void nla_buttons_register(ARegionType *art)
strcpy(pt->idname, "NLA_PT_track");
strcpy(pt->label, "Active Track");
pt->draw= nla_panel_track;
- pt->poll= nla_panel_poll;
+ pt->poll= nla_track_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties");
strcpy(pt->idname, "NLA_PT_properties");
strcpy(pt->label, "Active Strip");
pt->draw= nla_panel_properties;
- pt->poll= nla_panel_poll;
+ pt->poll= nla_strip_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel properties");
strcpy(pt->idname, "NLA_PT_actionclip");
strcpy(pt->label, "Action Clip");
pt->draw= nla_panel_actclip;
- pt->poll= nla_panel_poll; // XXX need a special one to check for 'action clip' types only
+ pt->poll= nla_strip_actclip_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel evaluation");
strcpy(pt->idname, "NLA_PT_evaluation");
strcpy(pt->label, "Evaluation");
pt->draw= nla_panel_evaluation;
- pt->poll= nla_panel_poll;
+ pt->poll= nla_strip_panel_poll;
BLI_addtail(&art->paneltypes, pt);
pt= MEM_callocN(sizeof(PanelType), "spacetype nla panel modifiers");
strcpy(pt->idname, "NLA_PT_modifiers");
strcpy(pt->label, "Modifiers");
- //pt->draw= nla_panel_modifiers;
- pt->poll= nla_panel_poll;
+ pt->draw= nla_panel_modifiers;
+ pt->poll= nla_strip_panel_poll;
BLI_addtail(&art->paneltypes, pt);
}