I have a script that is setting some custom properties on an object. The properties are being assigned just fine and can be accessed with the proper floating point value. But the Custom Properties UI display shows the decimal value incorrectly as x.000. (See image) Custom Properties Display Incorrect Float Values

How do I get the values to show up properly in the UI panel?

  • $\begingroup$ What's the code you Are using to define the property? $\endgroup$ – aliasguru Sep 8 '16 at 20:11
  • $\begingroup$ ob['property_name'] = 1234.5678901 $\endgroup$ – D. Waschow Sep 8 '16 at 20:22
  • 1
    $\begingroup$ When I run this code: import bpy ob = bpy.context.active_object ob['property'] = 987654.321 The Custom Properties shows the value as 987654.313. How is it getting that value? $\endgroup$ – D. Waschow Sep 8 '16 at 20:34
  • 2
    $\begingroup$ This looks like it might be a bug. Check the bug tracker and see if it's been reported. If not, it's probably a good candidate for reporting. Otherwise I think the next step is to post your complete code. $\endgroup$ – Matt Sep 8 '16 at 20:39
  • 1
    $\begingroup$ I logged a bug report, but it got closed citing floating point precision as the culprit. I disagree, as the value stored within the property is correct when accessed through the Python Console. It's only displayed incorrectly in the UI, as shown here: skwerm.com/public/Property2.png $\endgroup$ – D. Waschow Sep 9 '16 at 13:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.