Drivers: When editing expressions from UI buttons, "invalid" flags now get cleared from the drivers
With this change, there should hopefully be less need to hit "Update Dependencies" on drivers so often.
This commit is contained in:
parent
d20c9e491c
commit
49cde5d8c1
|
@ -117,10 +117,19 @@ bool ui_but_anim_expression_set(uiBut *but, const char *str)
|
|||
if (fcu && driven) {
|
||||
driver = fcu->driver;
|
||||
|
||||
if (driver && driver->type == DRIVER_TYPE_PYTHON) {
|
||||
if (driver && (driver->type == DRIVER_TYPE_PYTHON)) {
|
||||
BLI_strncpy_utf8(driver->expression, str, sizeof(driver->expression));
|
||||
|
||||
/* tag driver as needing to be recompiled */
|
||||
driver->flag |= DRIVER_FLAG_RECOMPILE;
|
||||
|
||||
/* clear invalid flags which may prevent this from working */
|
||||
driver->flag &= ~DRIVER_FLAG_INVALID;
|
||||
fcu->flag & ~FCURVE_DISABLED;
|
||||
|
||||
/* this notifier should update the Graph Editor and trigger depsgraph refresh? */
|
||||
WM_event_add_notifier(but->block->evil_C, NC_ANIMATION | ND_KEYFRAME, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -144,7 +144,11 @@ static void rna_ChannelDriver_update_data(Main *bmain, Scene *scene, PointerRNA
|
|||
static void rna_ChannelDriver_update_expr(Main *bmain, Scene *scene, PointerRNA *ptr)
|
||||
{
|
||||
ChannelDriver *driver = ptr->data;
|
||||
|
||||
/* tag driver as needing to be recompiled */
|
||||
driver->flag |= DRIVER_FLAG_RECOMPILE;
|
||||
|
||||
/* update_data() clears invalid flag and schedules for updates */
|
||||
rna_ChannelDriver_update_data(bmain, scene, ptr);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue