Incorrect Custom Float Property Value Readout #49304
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#49304
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Windows 7 Enterprise 64 w/ NVIDIA Quadro K2100M
Blender Version
Broken: 2.77a
abf6f08
and 2.78 RC10e5089c
Worked: (optional)
Short description of error
Assigning custom float property values to objects stores incorrect values. I've tried by creating properties via the UI as well as with python code:
import bpy
ob = bpy.context.active_object
ob['property'] = 987654.321
Doing so (in both cases) the property is set to the correct value internally, but the UI reports the value as 987654.313.
Other numbers are also coming up with incorrect decimal parts of the value.
Exact steps for others to reproduce the error
Create a cube.
Add a new Custom Property using the UI or with the above code run via a text window.
Check property value via Python console (it'll be correct) and then look in the UI and see the incorrect value.
Changed status to: 'Open'
Added subscriber: @DarrenWaschow
Added subscriber: @BrendonMurphy
hi, tested this out & found the error occurs after more than 8 digits are added, less than 8 digits & there's no difference, more than 8 & there is wrong comparison.
Added subscriber: @mont29
Changed status from 'Open' to: 'Archived'
Thanks for the report, but no bug here, that’s merely well-known floating point precision issue, you only have about 7 digits usable on 32bit floats, nothing to be done here.
Bastien:
I'm not sure your explanation addresses what's actually happening here. The value stored in the object's property is correct. It's just the value that's shown in the UI under Custom Properties that's incorrect.
If you assign a floating point value of, say, 987654.321 to an object property, you can then query that value using ob['property'] in the Python console and it's correct. But the UI shows the value as 987654.313.
See the attached screen shot.
Thanks!
@DarrenWaschow That’s precisely the point - our UI code does not draw raw float values, for various reasons, so it ends up applying some transformations to it (see
UI_calc_float_precision
function in code), hence the float precision issue…