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:
Diffstat (limited to 'source/blender/editors/space_nla/nla_buttons.c')
-rw-r--r--source/blender/editors/space_nla/nla_buttons.c126
1 files changed, 63 insertions, 63 deletions
diff --git a/source/blender/editors/space_nla/nla_buttons.c b/source/blender/editors/space_nla/nla_buttons.c
index c173aac1a26..a26e6b0280e 100644
--- a/source/blender/editors/space_nla/nla_buttons.c
+++ b/source/blender/editors/space_nla/nla_buttons.c
@@ -87,27 +87,27 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
ListBase anim_data = {NULL, NULL};
short found = 0; /* not bool, since we need to indicate "found but not ideal" status */
int filter;
-
- /* for now, only draw if we could init the anim-context info (necessary for all animation-related tools)
+
+ /* for now, only draw if we could init the anim-context info (necessary for all animation-related tools)
* to work correctly is able to be correctly retrieved. There's no point showing empty panels?
*/
- if (ANIM_animdata_get_context(C, &ac) == 0)
+ if (ANIM_animdata_get_context(C, &ac) == 0)
return false;
-
- /* extract list of active channel(s), of which we should only take the first one
+
+ /* 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
*/
// 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) {
switch (ale->type) {
case ANIMTYPE_NLATRACK: /* NLA Track - The primary data type which should get caught */
{
NlaTrack *nlt = (NlaTrack *)ale->data;
AnimData *adt = ale->adt;
-
+
/* found it, now set the pointers */
if (adt_ptr) {
/* AnimData pointer */
@@ -122,7 +122,7 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
NlaStrip *strip = BKE_nlastrip_find_active(nlt);
RNA_pointer_create(ale->id, &RNA_NlaStrip, strip, strip_ptr);
}
-
+
found = 1;
break;
}
@@ -149,7 +149,7 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
/* for these channels, we only do AnimData */
if (ale->adt && adt_ptr) {
ID *id;
-
+
if ((ale->data == NULL) || (ale->type == ANIMTYPE_OBJECT)) {
/* ale->data is not an ID block! */
id = ale->id;
@@ -158,13 +158,13 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
/* ale->data is always the proper ID block we need, but ale->id may not be (i.e. for textures) */
id = (ID *)ale->data;
}
-
+
/* AnimData pointer */
if (adt_ptr) {
RNA_pointer_create(id, &RNA_AnimData, ale->adt, adt_ptr);
}
-
- /* set found status to -1, since setting to 1 would break the loop
+
+ /* set found status to -1, since setting to 1 would break the loop
* and potentially skip an active NLA-Track in some cases...
*/
found = -1;
@@ -172,14 +172,14 @@ bool nla_panel_context(const bContext *C, PointerRNA *adt_ptr, PointerRNA *nlt_p
break;
}
}
-
+
if (found > 0)
break;
}
-
+
/* free temp data */
ANIM_animdata_freelist(&anim_data);
-
+
return (found != 0);
}
@@ -212,12 +212,12 @@ static int nla_strip_actclip_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;
return (strip->type == NLASTRIP_TYPE_CLIP);
}
@@ -226,17 +226,17 @@ 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;
}
@@ -250,53 +250,53 @@ static void nla_panel_animdata(const bContext *C, Panel *pa)
uiLayout *layout = pa->layout;
uiLayout *row;
uiBlock *block;
-
+
/* check context and also validity of pointer */
if (!nla_panel_context(C, &adt_ptr, NULL, NULL))
return;
/* adt = adt_ptr.data; */
-
+
block = uiLayoutGetBlock(layout);
UI_block_func_handle_set(block, do_nla_region_buttons, NULL);
-
+
/* AnimData Source Properties ----------------------------------- */
-
- /* icon + id-block name of block where AnimData came from to prevent
+
+ /* icon + id-block name of block where AnimData came from to prevent
* accidentally changing the properties of the wrong action
*/
if (adt_ptr.id.data) {
ID *id = adt_ptr.id.data;
PointerRNA id_ptr;
-
+
RNA_id_pointer_create(id, &id_ptr);
-
+
/* ID-block name > AnimData */
row = uiLayoutRow(layout, true);
uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_LEFT);
-
+
uiItemL(row, id->name + 2, RNA_struct_ui_icon(id_ptr.type)); /* id-block (src) */
uiItemL(row, "", VICO_SMALL_TRI_RIGHT_VEC); /* expander */
uiItemL(row, IFACE_("Animation Data"), ICON_ANIM_DATA); /* animdata */
-
+
uiItemS(layout);
}
-
+
/* Active Action Properties ------------------------------------- */
/* action */
row = uiLayoutRow(layout, true);
uiTemplateID(
row, (bContext *)C, &adt_ptr, "action",
"ACTION_OT_new", NULL, "NLA_OT_action_unlink", UI_TEMPLATE_ID_FILTER_ALL);
-
+
/* extrapolation */
row = uiLayoutRow(layout, true);
uiItemR(row, &adt_ptr, "action_extrapolation", 0, NULL, ICON_NONE);
-
+
/* blending */
row = uiLayoutRow(layout, true);
uiItemR(row, &adt_ptr, "action_blend_type", 0, NULL, ICON_NONE);
-
+
/* influence */
row = uiLayoutRow(layout, true);
uiItemR(row, &adt_ptr, "action_influence", 0, NULL, ICON_NONE);
@@ -309,14 +309,14 @@ static void nla_panel_track(const bContext *C, Panel *pa)
uiLayout *layout = pa->layout;
uiLayout *row;
uiBlock *block;
-
+
/* check context and also validity of pointer */
if (!nla_panel_context(C, NULL, &nlt_ptr, NULL))
return;
-
+
block = uiLayoutGetBlock(layout);
UI_block_func_handle_set(block, do_nla_region_buttons, NULL);
-
+
/* Info - Active NLA-Context:Track ---------------------- */
row = uiLayoutRow(layout, true);
uiItemR(row, &nlt_ptr, "name", 0, NULL, ICON_NLA);
@@ -330,41 +330,41 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
uiLayout *column, *row, *sub;
uiBlock *block;
short showEvalProps = 1;
-
+
if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
-
+
block = uiLayoutGetBlock(layout);
UI_block_func_handle_set(block, do_nla_region_buttons, NULL);
-
+
/* Strip Properties ------------------------------------- */
/* strip type */
row = uiLayoutColumn(layout, true);
uiItemR(row, &strip_ptr, "name", 0, NULL, ICON_NLA); // XXX icon?
uiItemR(row, &strip_ptr, "type", 0, NULL, ICON_NONE);
-
+
/* strip extents */
column = uiLayoutColumn(layout, true);
uiItemL(column, IFACE_("Strip Extents:"), ICON_NONE);
uiItemR(column, &strip_ptr, "frame_start", 0, NULL, ICON_NONE);
uiItemR(column, &strip_ptr, "frame_end", 0, NULL, ICON_NONE);
-
+
/* Evaluation-Related Strip Properties ------------------ */
-
+
/* 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, true);
uiItemR(row, &strip_ptr, "extrapolation", 0, NULL, ICON_NONE);
-
+
/* blending */
row = uiLayoutRow(layout, true);
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
*/
@@ -376,7 +376,7 @@ static void nla_panel_properties(const bContext *C, Panel *pa)
uiLayoutSetActive(sub, RNA_boolean_get(&strip_ptr, "use_auto_blend") == false);
uiItemR(sub, &strip_ptr, "blend_in", 0, NULL, ICON_NONE);
uiItemR(sub, &strip_ptr, "blend_out", 0, NULL, ICON_NONE);
-
+
/* settings */
column = uiLayoutColumn(layout, true);
uiLayoutSetActive(column, !(RNA_boolean_get(&strip_ptr, "use_animated_influence") || RNA_boolean_get(&strip_ptr, "use_animated_time")));
@@ -398,27 +398,27 @@ static void nla_panel_actclip(const bContext *C, Panel *pa)
/* check context and also validity of pointer */
if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
-
+
block = uiLayoutGetBlock(layout);
UI_block_func_handle_set(block, do_nla_region_buttons, NULL);
-
+
/* Strip Properties ------------------------------------- */
/* action pointer */
row = uiLayoutRow(layout, true);
uiItemR(row, &strip_ptr, "action", 0, NULL, ICON_ACTION);
-
+
/* action extents */
// XXX custom names were used here (to avoid the prefixes)... probably not necessary in future?
column = uiLayoutColumn(layout, true);
uiItemL(column, IFACE_("Action Extents:"), ICON_NONE);
uiItemR(column, &strip_ptr, "action_frame_start", 0, IFACE_("Start Frame"), ICON_NONE);
uiItemR(column, &strip_ptr, "action_frame_end", 0, IFACE_("End Frame"), ICON_NONE);
-
+
// XXX: this layout may actually be too abstract and confusing, and may be better using standard column layout
row = uiLayoutRow(layout, false);
uiItemR(row, &strip_ptr, "use_sync_length", 0, IFACE_("Sync Length"), ICON_NONE);
uiItemO(row, IFACE_("Now"), ICON_FILE_REFRESH, "NLA_OT_action_sync_length");
-
+
/* action usage */
column = uiLayoutColumn(layout, true);
uiLayoutSetActive(column, RNA_boolean_get(&strip_ptr, "use_animated_time") == false);
@@ -438,13 +438,13 @@ static void nla_panel_evaluation(const bContext *C, Panel *pa)
/* check context and also validity of pointer */
if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
-
+
block = uiLayoutGetBlock(layout);
UI_block_func_handle_set(block, do_nla_region_buttons, NULL);
-
+
col = uiLayoutColumn(layout, true);
uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE);
-
+
sub = uiLayoutColumn(col, true);
uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_influence"));
uiItemR(sub, &strip_ptr, "influence", 0, NULL, ICON_NONE);
@@ -472,28 +472,28 @@ static void nla_panel_modifiers(const bContext *C, Panel *pa)
if (!nla_panel_context(C, NULL, NULL, &strip_ptr))
return;
strip = strip_ptr.data;
-
+
block = uiLayoutGetBlock(pa->layout);
UI_block_func_handle_set(block, do_nla_region_buttons, NULL);
-
+
/* 'add modifier' button at top of panel */
{
row = uiLayoutRow(pa->layout, false);
block = uiLayoutGetBlock(row);
-
+
// FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected)
uiItemMenuEnumO(row, (bContext *)C, "NLA_OT_fmodifier_add", "type", IFACE_("Add Modifier"), ICON_NONE);
-
+
/* copy/paste (as sub-row) */
row = uiLayoutRow(row, true);
uiItemO(row, "", ICON_COPYDOWN, "NLA_OT_fmodifier_copy");
uiItemO(row, "", ICON_PASTEDOWN, "NLA_OT_fmodifier_paste");
}
-
+
/* draw each modifier */
for (fcm = strip->modifiers.first; fcm; fcm = fcm->next) {
col = uiLayoutColumn(pa->layout, true);
-
+
ANIM_uiTemplate_fmodifier_draw(col, strip_ptr.id.data, &strip->modifiers, fcm);
}
}
@@ -565,7 +565,7 @@ static int nla_properties_toggle_exec(bContext *C, wmOperator *UNUSED(op))
{
ScrArea *sa = CTX_wm_area(C);
ARegion *ar = nla_has_buttons_region(sa);
-
+
if (ar)
ED_region_toggle_hidden(C, ar);
@@ -577,7 +577,7 @@ void NLA_OT_properties(wmOperatorType *ot)
ot->name = "Properties";
ot->idname = "NLA_OT_properties";
ot->description = "Toggle the properties region visibility";
-
+
ot->exec = nla_properties_toggle_exec;
ot->poll = ED_operator_nla_active;