Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/space_nla/nla_buttons.c
| Show First 20 Lines • Show All 248 Lines • ▼ Show 20 Lines | static void nla_panel_animdata(const bContext *C, Panel *pa) | ||||
| /* check context and also validity of pointer */ | /* check context and also validity of pointer */ | ||||
| if (!nla_panel_context(C, &adt_ptr, NULL, NULL)) | if (!nla_panel_context(C, &adt_ptr, NULL, NULL)) | ||||
| return; | return; | ||||
| /* adt = adt_ptr.data; */ | /* adt = adt_ptr.data; */ | ||||
| block = uiLayoutGetBlock(layout); | block = uiLayoutGetBlock(layout); | ||||
| uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); | UI_block_func_handle_set(block, do_nla_region_buttons, NULL); | ||||
| /* AnimData Source Properties ----------------------------------- */ | /* 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 | * accidentally changing the properties of the wrong action | ||||
| */ | */ | ||||
| if (adt_ptr.id.data) { | if (adt_ptr.id.data) { | ||||
| ID *id = adt_ptr.id.data; | ID *id = adt_ptr.id.data; | ||||
| Show All 38 Lines | static void nla_panel_track(const bContext *C, Panel *pa) | ||||
| uiLayout *row; | uiLayout *row; | ||||
| uiBlock *block; | uiBlock *block; | ||||
| /* check context and also validity of pointer */ | /* check context and also validity of pointer */ | ||||
| if (!nla_panel_context(C, NULL, &nlt_ptr, NULL)) | if (!nla_panel_context(C, NULL, &nlt_ptr, NULL)) | ||||
| return; | return; | ||||
| block = uiLayoutGetBlock(layout); | block = uiLayoutGetBlock(layout); | ||||
| uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); | UI_block_func_handle_set(block, do_nla_region_buttons, NULL); | ||||
| /* Info - Active NLA-Context:Track ---------------------- */ | /* Info - Active NLA-Context:Track ---------------------- */ | ||||
| row = uiLayoutRow(layout, true); | row = uiLayoutRow(layout, true); | ||||
| uiItemR(row, &nlt_ptr, "name", 0, NULL, ICON_NLA); | uiItemR(row, &nlt_ptr, "name", 0, NULL, ICON_NLA); | ||||
| } | } | ||||
| /* generic settings for active NLA-Strip */ | /* generic settings for active NLA-Strip */ | ||||
| static void nla_panel_properties(const bContext *C, Panel *pa) | static void nla_panel_properties(const bContext *C, Panel *pa) | ||||
| { | { | ||||
| PointerRNA strip_ptr; | PointerRNA strip_ptr; | ||||
| uiLayout *layout = pa->layout; | uiLayout *layout = pa->layout; | ||||
| uiLayout *column, *row, *sub; | uiLayout *column, *row, *sub; | ||||
| uiBlock *block; | uiBlock *block; | ||||
| short showEvalProps = 1; | short showEvalProps = 1; | ||||
| if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | ||||
| return; | return; | ||||
| block = uiLayoutGetBlock(layout); | block = uiLayoutGetBlock(layout); | ||||
| uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); | UI_block_func_handle_set(block, do_nla_region_buttons, NULL); | ||||
| /* Strip Properties ------------------------------------- */ | /* Strip Properties ------------------------------------- */ | ||||
| /* strip type */ | /* strip type */ | ||||
| row = uiLayoutColumn(layout, true); | row = uiLayoutColumn(layout, true); | ||||
| uiItemR(row, &strip_ptr, "name", 0, NULL, ICON_NLA); // XXX icon? | uiItemR(row, &strip_ptr, "name", 0, NULL, ICON_NLA); // XXX icon? | ||||
| uiItemR(row, &strip_ptr, "type", 0, NULL, ICON_NONE); | uiItemR(row, &strip_ptr, "type", 0, NULL, ICON_NONE); | ||||
| /* strip extents */ | /* strip extents */ | ||||
| ▲ Show 20 Lines • Show All 48 Lines • ▼ Show 20 Lines | static void nla_panel_actclip(const bContext *C, Panel *pa) | ||||
| uiLayout *column, *row; | uiLayout *column, *row; | ||||
| uiBlock *block; | uiBlock *block; | ||||
| /* check context and also validity of pointer */ | /* check context and also validity of pointer */ | ||||
| if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | ||||
| return; | return; | ||||
| block = uiLayoutGetBlock(layout); | block = uiLayoutGetBlock(layout); | ||||
| uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); | UI_block_func_handle_set(block, do_nla_region_buttons, NULL); | ||||
| /* Strip Properties ------------------------------------- */ | /* Strip Properties ------------------------------------- */ | ||||
| /* action pointer */ | /* action pointer */ | ||||
| row = uiLayoutRow(layout, true); | row = uiLayoutRow(layout, true); | ||||
| uiItemR(row, &strip_ptr, "action", 0, NULL, ICON_ACTION); | uiItemR(row, &strip_ptr, "action", 0, NULL, ICON_ACTION); | ||||
| /* action extents */ | /* action extents */ | ||||
| // XXX custom names were used here (to avoid the prefixes)... probably not necessary in future? | // XXX custom names were used here (to avoid the prefixes)... probably not necessary in future? | ||||
| Show All 23 Lines | static void nla_panel_evaluation(const bContext *C, Panel *pa) | ||||
| uiLayout *col, *sub; | uiLayout *col, *sub; | ||||
| uiBlock *block; | uiBlock *block; | ||||
| /* check context and also validity of pointer */ | /* check context and also validity of pointer */ | ||||
| if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | ||||
| return; | return; | ||||
| block = uiLayoutGetBlock(layout); | block = uiLayoutGetBlock(layout); | ||||
| uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); | UI_block_func_handle_set(block, do_nla_region_buttons, NULL); | ||||
| col = uiLayoutColumn(layout, true); | col = uiLayoutColumn(layout, true); | ||||
| uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE); | uiItemR(col, &strip_ptr, "use_animated_influence", 0, NULL, ICON_NONE); | ||||
| sub = uiLayoutColumn(col, true); | sub = uiLayoutColumn(col, true); | ||||
| uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_influence")); | uiLayoutSetEnabled(sub, RNA_boolean_get(&strip_ptr, "use_animated_influence")); | ||||
| uiItemR(sub, &strip_ptr, "influence", 0, NULL, ICON_NONE); | uiItemR(sub, &strip_ptr, "influence", 0, NULL, ICON_NONE); | ||||
| Show All 17 Lines | static void nla_panel_modifiers(const bContext *C, Panel *pa) | ||||
| uiBlock *block; | uiBlock *block; | ||||
| /* check context and also validity of pointer */ | /* check context and also validity of pointer */ | ||||
| if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | if (!nla_panel_context(C, NULL, NULL, &strip_ptr)) | ||||
| return; | return; | ||||
| strip = strip_ptr.data; | strip = strip_ptr.data; | ||||
| block = uiLayoutGetBlock(pa->layout); | block = uiLayoutGetBlock(pa->layout); | ||||
| uiBlockSetHandleFunc(block, do_nla_region_buttons, NULL); | UI_block_func_handle_set(block, do_nla_region_buttons, NULL); | ||||
| /* 'add modifier' button at top of panel */ | /* 'add modifier' button at top of panel */ | ||||
| { | { | ||||
| row = uiLayoutRow(pa->layout, false); | row = uiLayoutRow(pa->layout, false); | ||||
| block = uiLayoutGetBlock(row); | block = uiLayoutGetBlock(row); | ||||
| // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator | // XXX for now, this will be a operator button which calls a temporary 'add modifier' operator | ||||
| // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) | // FIXME: we need to set the only-active property so that this will only add modifiers for the active strip (not all selected) | ||||
| uiDefButO(block, BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20, | uiDefButO(block, UI_BTYPE_BUT, "NLA_OT_fmodifier_add", WM_OP_INVOKE_REGION_WIN, IFACE_("Add Modifier"), 10, 0, 150, 20, | ||||
| TIP_("Adds a new F-Modifier for the active NLA Strip")); | TIP_("Adds a new F-Modifier for the active NLA Strip")); | ||||
| /* copy/paste (as sub-row)*/ | /* copy/paste (as sub-row)*/ | ||||
| row = uiLayoutRow(row, true); | row = uiLayoutRow(row, true); | ||||
| uiItemO(row, "", ICON_COPYDOWN, "NLA_OT_fmodifier_copy"); | uiItemO(row, "", ICON_COPYDOWN, "NLA_OT_fmodifier_copy"); | ||||
| uiItemO(row, "", ICON_PASTEDOWN, "NLA_OT_fmodifier_paste"); | uiItemO(row, "", ICON_PASTEDOWN, "NLA_OT_fmodifier_paste"); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 88 Lines • Show Last 20 Lines | |||||