Changeset View
Changeset View
Standalone View
Standalone View
source/blender/editors/interface/interface_anim.c
| Show First 20 Lines • Show All 174 Lines • ▼ Show 20 Lines | void ui_but_anim_decorate_update_from_flag(uiButDecorator *decorator_but) | ||||
| else { | else { | ||||
| but->icon = ICON_DECORATE; | but->icon = ICON_DECORATE; | ||||
| } | } | ||||
| const int flag_copy = (UI_BUT_DISABLED | UI_BUT_INACTIVE); | const int flag_copy = (UI_BUT_DISABLED | UI_BUT_INACTIVE); | ||||
| but->flag = (but->flag & ~flag_copy) | (flag & flag_copy); | but->flag = (but->flag & ~flag_copy) | (flag & flag_copy); | ||||
| } | } | ||||
| /** | |||||
| * \a str can be NULL to only perform check if \a but has an expression at all. | |||||
| * \return if button has an expression. | |||||
| */ | |||||
| bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen) | bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen) | ||||
| { | { | ||||
| FCurve *fcu; | FCurve *fcu; | ||||
| ChannelDriver *driver; | ChannelDriver *driver; | ||||
| bool driven, special; | bool driven, special; | ||||
| fcu = ui_but_get_fcurve(but, NULL, NULL, &driven, &special); | fcu = ui_but_get_fcurve(but, NULL, NULL, &driven, &special); | ||||
| ▲ Show 20 Lines • Show All 41 Lines • ▼ Show 20 Lines | if (driver && (driver->type == DRIVER_TYPE_PYTHON)) { | ||||
| return true; | return true; | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* create new expression for button (i.e. a "scripted driver"), if it can be created... */ | |||||
| bool ui_but_anim_expression_create(uiBut *but, const char *str) | bool ui_but_anim_expression_create(uiBut *but, const char *str) | ||||
| { | { | ||||
| bContext *C = but->block->evil_C; | bContext *C = but->block->evil_C; | ||||
| ID *id; | ID *id; | ||||
| FCurve *fcu; | FCurve *fcu; | ||||
| char *path; | char *path; | ||||
| bool ok = false; | bool ok = false; | ||||
| ▲ Show 20 Lines • Show All 115 Lines • Show Last 20 Lines | |||||