diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2016-11-18 15:37:04 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2016-11-18 15:38:46 +0300 |
commit | 3fb11061bad7c76ea53925ed599ee155b0d4222f (patch) | |
tree | 5f345e795e98732f0e4757f5325b3959f1aae77b /source/blender/editors/interface/interface_anim.c | |
parent | fffb1a4cfbd25cccc5df2a113907b6aa29d0f204 (diff) |
Fix T50063: Editing driver's expression eliminates "Zero" number
Disables trimming of trailing zeros in case button contains an expression.
Diffstat (limited to 'source/blender/editors/interface/interface_anim.c')
-rw-r--r-- | source/blender/editors/interface/interface_anim.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c index 991cd54fecf..5da294302e9 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -99,6 +99,10 @@ void ui_but_anim_flag(uiBut *but, float cfra) } } +/** + * \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) { FCurve *fcu; @@ -111,7 +115,9 @@ bool ui_but_anim_expression_get(uiBut *but, char *str, size_t maxlen) driver = fcu->driver; if (driver && driver->type == DRIVER_TYPE_PYTHON) { - BLI_strncpy(str, driver->expression, maxlen); + if (str) { + BLI_strncpy(str, driver->expression, maxlen); + } return true; } } |