Show FCurve modifier toggle widget as 'inactive' when there are no modifiers #106214

Merged
Sybren A. Stüvel merged 5 commits from dr.sybren/blender:anim/fcurve-modifier-toggle-visibility into main 2023-09-14 15:03:43 +02:00
1 changed files with 16 additions and 0 deletions

View File

@ -5374,6 +5374,22 @@ static void draw_setting_widget(bAnimContext *ac,
UI_but_disable(but, TIP_("Can't edit this property from a linked data-block"));
}
}
/* Post-button-creation modifications of the button. */
switch (setting) {
case ACHANNEL_SETTING_MOD_OFF:
/* Deactivate the button when there are no FCurve modifiers. */
if (ale->datatype == ALE_FCURVE) {
const FCurve *fcu = static_cast<const FCurve *>(ale->key_data);
if (BLI_listbase_is_empty(&fcu->modifiers)) {
UI_but_flag_enable(but, UI_BUT_INACTIVE);
}
}
break;
default:
break;
}
}
static void draw_grease_pencil_layer_widgets(bAnimListElem *ale,