static void graph_panel_properties(const bContext *C, Panel *pa) { bAnimListElem *ale; FCurve *fcu; PointerRNA fcu_ptr; uiLayout *layout = pa->layout; uiLayout *col, *row, *sub; // uiBlock *block; // UNUSED char name[256]; int icon = 0; if (!graph_panel_context(C, &ale, &fcu)) return; // UNUSED // block = uiLayoutGetBlock(layout); // uiBlockSetHandleFunc(block, do_graph_region_buttons, NULL); /* F-Curve pointer */ RNA_pointer_create(ale->id, &RNA_FCurve, fcu, &fcu_ptr); /* user-friendly 'name' for F-Curve */ /* TODO: only show the path if this is invalid? */ col = uiLayoutColumn(layout, false); icon = getname_anim_fcurve(name, ale->id, fcu); uiItemL(col, name, icon); /* RNA-Path Editing - only really should be enabled when things aren't working */ col = uiLayoutColumn(layout, true); uiLayoutSetEnabled(col, (fcu->flag & FCURVE_DISABLED) != 0); uiItemR(col, &fcu_ptr, "data_path", 0, "", ICON_RNA); uiItemR(col, &fcu_ptr, "array_index", 0, NULL, ICON_NONE); /* color settings */ col = uiLayoutColumn(layout, true); uiItemL(col, IFACE_("Display Color:"), ICON_NONE); row = uiLayoutRow(col, true); uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); uiLayoutSetEnabled(sub, (fcu->color_mode == FCURVE_COLOR_CUSTOM)); uiItemR(sub, &fcu_ptr, "color", 0, "", ICON_NONE); MEM_freeN(ale); }
static void graph_panel_properties(const bContext *C, Panel *pa) { bAnimListElem *ale; FCurve *fcu; PointerRNA fcu_ptr; uiLayout *layout = pa->layout; uiLayout *col, *row, *sub; // uiBlock *block; // UNUSED char name[256]; int icon = 0; if (!graph_panel_context(C, &ale, &fcu)) return; // UNUSED // block = uiLayoutGetBlock(layout); // UI_block_func_handle_set(block, do_graph_region_buttons, NULL); /* F-Curve pointer */ RNA_pointer_create(ale->id, &RNA_FCurve, fcu, &fcu_ptr); /* user-friendly 'name' for F-Curve */ col = uiLayoutColumn(layout, false); if (ale->type == ANIMTYPE_FCURVE) { /* get user-friendly name for F-Curve */ icon = getname_anim_fcurve(name, ale->id, fcu); } else { /* NLA Control Curve, etc. */ const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale); /* get name */ if (acf && acf->name) { acf->name(ale, name); } else { strcpy(name, IFACE_("<invalid>")); icon = ICON_ERROR; } /* icon */ if (ale->type == ANIMTYPE_NLACURVE) icon = ICON_NLA; } uiItemL(col, name, icon); /* RNA-Path Editing - only really should be enabled when things aren't working */ col = uiLayoutColumn(layout, true); uiLayoutSetEnabled(col, (fcu->flag & FCURVE_DISABLED) != 0); uiItemR(col, &fcu_ptr, "data_path", 0, "", ICON_RNA); uiItemR(col, &fcu_ptr, "array_index", 0, NULL, ICON_NONE); /* color settings */ col = uiLayoutColumn(layout, true); uiItemL(col, IFACE_("Display Color:"), ICON_NONE); row = uiLayoutRow(col, true); uiItemR(row, &fcu_ptr, "color_mode", 0, "", ICON_NONE); sub = uiLayoutRow(row, true); uiLayoutSetEnabled(sub, (fcu->color_mode == FCURVE_COLOR_CUSTOM)); uiItemR(sub, &fcu_ptr, "color", 0, "", ICON_NONE); MEM_freeN(ale); }