UI destroys float precision #39861

Closed
opened 2014-04-23 17:48:28 +02:00 by Michael Siffi · 11 comments

System Information
Windows 7

Blender Version
Broken: 2.70

Short description of error
UI displays float with lowered precision, BUT also overwrites real value

Exact steps for others to reproduce the error

  1. create object
  2. go to the N Panel, enter 90 as Rotation X. It is saved as 1.5708 internally.
  3. switch to Radians. Its still 1.5708 internally.
  4. click inside the Rotation X menu again, don't change anything.
  5. Click somehwere else. The internal value now changed to 1.571.
  6. Broken

The rounding is off. It seems to be based on what is displayed in that field, not what the actual value was internally.

**System Information** Windows 7 **Blender Version** Broken: 2.70 **Short description of error** UI displays float with lowered precision, BUT also overwrites real value **Exact steps for others to reproduce the error** 1. create object 2. go to the N Panel, enter 90 as Rotation X. It is saved as 1.5708 internally. 3. switch to Radians. Its still 1.5708 internally. 4. click inside the Rotation X menu again, don't change anything. 5. Click somehwere else. The internal value now changed to 1.571. 6. Broken The rounding is off. It seems to be based on what is displayed in that field, not what the actual value was internally.
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @miksi

Added subscriber: @miksi

Added subscribers: @ideasman42, @mont29

Added subscribers: @ideasman42, @mont29

Well, clicking outside of controls validates the edit, you have to use escape to quit without validating. Summoning Campbell here, but imho this is not a bug at all?

Well, clicking outside of controls **validates** the edit, you have to use escape to quit without validating. Summoning Campbell here, but imho this is not a bug at all?
Author

I disagree. This is unexpected behavior to an extent where it is a bug. You can't even Tab through the values without messing all values up. Either make a option for "float precision display" or don't force value change if nothing changed.

I disagree. This is unexpected behavior to an extent where it is a bug. You can't even Tab through the values without messing all values up. Either make a option for "float precision display" or don't force value change if nothing changed.

Not sure its useful to quibble about this being a bug or not.

Lets say its something that could be improved... (Maybe a TODO?)

Theres a few issues here...

  • Blender number buttons intentionally reduce precision (otherwise we get lots of floating point issues with display).
  • Common angles in radians don't show as round numbers.
  • To click somewhere else when editing a button is the same as pressing Enter.

Some possible solutions.

  • Display radians with 1 extra precision, this seems reasonable that an angle like 90deg should be editable without truncating useful precision. (Though this is also a bit of a workaround, IMHO its an acceptable one)
  • Attempt to be clever about precision. (I rather not do this... will explain below).

We could try to workaround this by storing the lost precision in a number button and apply it back after,

possible solution:

  • internal: 1.00001
  • display: 1.0
  • edit the button: stores the delta: 0.00001
  • user enters value (2 for example).
  • delta is applied back to the result
  • new internal: 2.00001
  • new display: 2.0

This means at least if you make minor adjustments precision won't be lost, however it can backfire if you enter 2 and really want 2.0 not 2.00001.

So, prefer just make radians show higher precision.

Not sure its useful to quibble about this being a bug or not. Lets say its something that could be improved... (Maybe a TODO?) Theres a few issues here... - Blender number buttons intentionally reduce precision (otherwise we get lots of floating point issues with display). - Common angles in radians don't show as round numbers. - To **click somewhere else** when editing a button is the same as pressing **Enter**. Some possible solutions. - Display radians with 1 extra precision, this seems reasonable that an angle like 90deg should be editable without truncating useful precision. *(Though this is also a bit of a workaround, IMHO its an acceptable one)* - Attempt to be clever about precision. *(I rather not do this... will explain below)*. We could try to workaround this by storing the lost precision in a number button and apply it back after, possible solution: - internal: `1.00001` - display: `1.0` - edit the button: *stores the delta:* `0.00001` - user enters value (2 for example). - delta is applied back to the result - new internal: `2.00001` - new display: `2.0` This means at least if you make minor adjustments precision won't be lost, however it can backfire if you enter `2` and really want `2.0` **not** `2.00001`. So, prefer just make radians show higher precision.
Bastien Montagne self-assigned this 2014-04-24 10:19:22 +02:00

Talked with Campbell, we’ll simply add more precision to radians here… Doing otherwise would lead to too much troubles. :)

Talked with Campbell, we’ll simply add more precision to radians here… Doing otherwise would lead to too much troubles. :)

This issue was referenced by blender/blender-addons-contrib@d12ceec401

This issue was referenced by blender/blender-addons-contrib@d12ceec40146f98b6d584a6ea276ab77834d816e

This issue was referenced by d12ceec401

This issue was referenced by d12ceec40146f98b6d584a6ea276ab77834d816e

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'

Closed by commit d12ceec401.

Closed by commit d12ceec401.
Sign in to join this conversation.
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
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#39861
No description provided.