diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2021-12-26 18:09:19 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2022-01-18 16:24:54 +0300 |
commit | 0d7b3ed39c77e1cdd43815a65993afe179691672 (patch) | |
tree | 6440d7ec2e07800185898e0c9703e8f0901d3ce9 /source/blender/python | |
parent | 695222838699921865a1f5685c420c9155f27ca7 (diff) |
RNA: display exact integer values without fraction if step is integer.
Display exact integer values of a floating point fields without
a fraction if the step is also an exact integer. This is intended
for cases when the value can technically be fractional, but most
commonly is supposed to be integer.
This handling is not applied if the field has any unit except frames,
because integer values aren't special for quantities like length.
The fraction is discarded in the normal display mode and when copying
the value to clipboard, but not when editing to remind the user that
the field allows fractions.
Differential Revision: https://developer.blender.org/D13753
Diffstat (limited to 'source/blender/python')
-rw-r--r-- | source/blender/python/intern/bpy_props.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index ed9547ee13f..fe7183441d1 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -2609,7 +2609,9 @@ static int bpy_prop_arg_parse_tag_defines(PyObject *o, void *p) " :type step: int\n" #define BPY_PROPDEF_FLOAT_PREC_DOC \ - " :arg precision: Maximum number of decimal digits to display, in [0, 6].\n" \ + " :arg precision: Maximum number of decimal digits to display, in [0, 6]. Fraction is " \ + "automatically hidden for exact integer values of fields with unit 'NONE' or 'TIME' (frame " \ + "count) and step divisible by 100.\n" \ " :type precision: int\n" #define BPY_PROPDEF_UPDATE_DOC \ |