diff options
author | Joshua Leung <aligorith@gmail.com> | 2014-05-08 09:57:11 +0400 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2014-05-08 09:57:11 +0400 |
commit | 49cde5d8c10726907eaa6790e70b04f4158c4fe5 (patch) | |
tree | eb691d4cba378f88b5b697090d7c9cc46a7720b4 /source/blender/editors/interface | |
parent | d20c9e491c4f158330029c6cccfc50216843fbb5 (diff) |
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.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_anim.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index d44802803da..167c6ac51c3 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -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; } } |