[Bf-blender-cvs] [c7ae7ccfb8d] blender2.8: Driver: trailing zeros from expression

Campbell Barton noreply at git.blender.org
Sun Jun 17 14:52:13 CEST 2018


Commit: c7ae7ccfb8d735f05083edadc2b49dd2e11b78b6
Author: Campbell Barton
Date:   Sun Jun 17 14:50:42 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBc7ae7ccfb8d735f05083edadc2b49dd2e11b78b6

Driver: trailing zeros from expression

===================================================================

M	source/blender/editors/animation/drivers.c

===================================================================

diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 294cff43c56..f303be0dd76 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -449,6 +449,7 @@ int ANIM_add_driver(ReportList *reports, ID *id, const char rna_path[], int arra
 					else fval = RNA_property_float_get_index(&ptr, prop, array_index);
 
 					BLI_snprintf(expression, maxlen, "%s%.3f", dvar_prefix, fval);
+					BLI_str_rstrip_float_zero(expression, '\0');
 				}
 				else if (flag & CREATEDRIVER_WITH_DEFAULT_DVAR) {
 					BLI_strncpy(expression, "var", maxlen);



More information about the Bf-blender-cvs mailing list