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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-09-04 00:48:43 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2011-09-04 00:48:43 +0400
commit7db432d29dfa6610b2cce23a9769b232ac9ef02c (patch)
tree179280c8c3fe325e7bf07037cf804e0ccd846f67 /source/blender/editors/space_nla/nla_buttons.c
parent95d92095e1f4e462d8bef38a7741f9fc71a9af98 (diff)
parent812d5d2e5c4be0f646a29c436be68bcf4149bd13 (diff)
Merged changes in the trunk up to revision 39826.
Made a major amount of conflict resolution for code adaptation to the animation system updates introduced in the Pepper branch recently merged to the trunk. Resolved conflicts: source/blender/blenkernel/intern/anim_sys.c source/blender/blenkernel/intern/library.c source/blender/editors/animation/anim_channels_defines.c source/blender/editors/animation/anim_channels_edit.c source/blender/editors/animation/anim_filter.c source/blender/editors/animation/keyframes_draw.c source/blender/editors/animation/keyframes_edit.c source/blender/editors/include/ED_anim_api.h source/blender/editors/space_nla/nla_buttons.c source/blender/editors/space_nla/nla_channels.c source/blender/makesdna/DNA_action_types.h source/blender/makesdna/intern/makesdna.c source/blender/makesrna/intern/rna_main_api.c
Diffstat (limited to 'source/blender/editors/space_nla/nla_buttons.c')
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c86
1 files changed, 57 insertions, 29 deletions
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index 17cd7ae41bd..87c8a6d39a6 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -1,6 +1,4 @@
/*
- * $Id$
- *
* ***** BEGIN GPL LICENSE BLOCK *****
*
* This program is free software; you can redistribute it and/or
@@ -103,7 +101,8 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA
/* extract list of active channel(s), of which we should only take the first one
* - we need the channels flag to get the active AnimData block when there are no NLA Tracks
*/
- filter= (ANIMFILTER_VISIBLE|ANIMFILTER_ACTIVE|ANIMFILTER_CHANNELS);
+ // XXX: double-check active!
+ filter= (ANIMFILTER_DATA_VISIBLE|ANIMFILTER_LIST_VISIBLE|ANIMFILTER_ACTIVE|ANIMFILTER_LIST_CHANNELS);
ANIM_animdata_filter(&ac, &anim_data, filter, ac.data, ac.datatype);
for (ale= anim_data.first; ale; ale= ale->next) {
@@ -146,6 +145,7 @@ static int nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA
case ANIMTYPE_DSMBALL:
case ANIMTYPE_DSARM:
case ANIMTYPE_DSLINESTYLE:
+ case ANIMTYPE_DSSPK:
{
/* for these channels, we only do AnimData */
if (ale->id && ale->adt) {
@@ -212,6 +212,24 @@ static int nla_strip_actclip_panel_poll(const bContext *C, PanelType *UNUSED(pt)
return (strip->type == NLASTRIP_TYPE_CLIP);
}
+static int nla_strip_eval_panel_poll(const bContext *C, PanelType *UNUSED(pt))
+{
+ PointerRNA ptr;
+ NlaStrip *strip;
+
+ if (!nla_panel_context(C, NULL, NULL, &ptr))
+ return 0;
+ if (ptr.data == NULL)
+ return 0;
+
+ strip= ptr.data;
+
+ if (strip->type == NLASTRIP_TYPE_SOUND)
+ return 0;
+
+ return 1;
+}
+
/* -------------- */
/* active AnimData */
@@ -277,6 +295,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
uiLayout *layout= pa->layout;
uiLayout *column, *row, *subcol;
uiBlock *block;
+ short showEvalProps = 1;
if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
@@ -296,32 +315,41 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
uiItemR(column, &strip_ptr, "frame_start", 0, NULL, ICON_NONE);
uiItemR(column, &strip_ptr, "frame_end", 0, NULL, ICON_NONE);
- /* extrapolation */
- row= uiLayoutRow(layout, 1);
- uiItemR(row, &strip_ptr, "extrapolation", 0, NULL, ICON_NONE);
+ /* Evaluation-Related Strip Properties ------------------ */
- /* blending */
- row= uiLayoutRow(layout, 1);
- uiItemR(row, &strip_ptr, "blend_type", 0, NULL, ICON_NONE);
-
- /* blend in/out + autoblending
- * - blend in/out can only be set when autoblending is off
- */
- column= uiLayoutColumn(layout, 1);
- uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0);
- uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle?
-
- subcol= uiLayoutColumn(column, 1);
- uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0);
- uiItemR(subcol, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
- uiItemR(subcol, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
+ /* sound properties strips don't have these settings */
+ if (RNA_enum_get(&strip_ptr, "type") == NLASTRIP_TYPE_SOUND)
+ showEvalProps = 0;
+
+ /* only show if allowed to... */
+ if (showEvalProps) {
+ /* extrapolation */
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, &strip_ptr, "extrapolation", 0, NULL, ICON_NONE);
- /* settings */
- column= uiLayoutColumn(layout, 1);
- uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "use_animated_influence") || RNA_boolean_get(&strip_ptr, "use_animated_time")));
- uiItemL(column, "Playback Settings:", ICON_NONE);
- uiItemR(column, &strip_ptr, "mute", 0, NULL, ICON_NONE);
- uiItemR(column, &strip_ptr, "use_reverse", 0, NULL, ICON_NONE);
+ /* blending */
+ row= uiLayoutRow(layout, 1);
+ uiItemR(row, &strip_ptr, "blend_type", 0, NULL, ICON_NONE);
+
+ /* blend in/out + autoblending
+ * - blend in/out can only be set when autoblending is off
+ */
+ column= uiLayoutColumn(layout, 1);
+ uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_influence")==0);
+ uiItemR(column, &strip_ptr, "use_auto_blend", 0, NULL, ICON_NONE); // XXX as toggle?
+
+ subcol= uiLayoutColumn(column, 1);
+ uiLayoutSetActive(subcol, RNA_boolean_get(&strip_ptr, "use_auto_blend")==0);
+ uiItemR(subcol, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
+ uiItemR(subcol, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
+
+ /* settings */
+ column= uiLayoutColumn(layout, 1);
+ uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "use_animated_influence") || RNA_boolean_get(&strip_ptr, "use_animated_time")));
+ uiItemL(column, "Playback Settings:", ICON_NONE);
+ uiItemR(column, &strip_ptr, "mute", 0, NULL, ICON_NONE);
+ uiItemR(column, &strip_ptr, "use_reverse", 0, NULL, ICON_NONE);
+ }
}
@@ -475,14 +503,14 @@ void nla_buttons_register(ARegionType *art)
strcpy(pt->idname, "NLA_PT_evaluation");
strcpy(pt->label, "Evaluation");
pt->draw= nla_panel_evaluation;
- pt->poll= nla_strip_panel_poll;
+ pt->poll= nla_strip_eval_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_strip_panel_poll;
+ pt->poll= nla_strip_eval_panel_poll;
BLI_addtail(&art->paneltypes, pt);
}