in pose mode a .pose.bones.tail vector may suffer from an error due to floating point precision #41681

Closed
opened 2014-09-01 18:17:20 +02:00 by Dean Nelson · 7 comments

System Information
Apple iMac running OS X version 10.9.3
AMD Radeon HD 6970M

Blender Version
Broken: 2.69.0 r60991, 2.70a f93bc76, 2.71 9337574

Short description of error
In Pose Mode, displaying a bpy.context.object.pose.bones["..."].tail vector appears to reflect a difference compared to displaying a bpy.data.armatures["Armature"].bones["..."].tail_local vector with regard to the same bone. The latter one being correct to my way of thinking. This difference appears to be due to an error in floating point math precision (from the finite number of bits in a CPU's registers or floating point type (float vs double) or something other?).

There are no differences when only one axis (X, Y or Z) of the bone's tail is non-zero. But if two or three axises are non-zero, there are differences. For example, in the attached .blend file, pose-bone-tail-bug.blend, one sees a 0.9999999403953552 instead of a 1.0 in the output from the included python script when it's run.

Exact steps for others to reproduce the error

  1. Start blender from a console and open the attached .blend file.
  2. Click on the 'Run Script' button in the Text Editor window containing the python script.
  3. Look at the output on the console, and note where tail vectors for the pose.bones["..."] differ from those for armatures["Armature"].bones["..."].
**System Information** Apple iMac running OS X version 10.9.3 AMD Radeon HD 6970M **Blender Version** Broken: 2.69.0 r60991, 2.70a f93bc76, 2.71 9337574 **Short description of error** In Pose Mode, displaying a bpy.context.object.pose.bones["..."].tail vector appears to reflect a difference compared to displaying a bpy.data.armatures["Armature"].bones["..."].tail_local vector with regard to the same bone. The latter one being correct to my way of thinking. This difference appears to be due to an error in floating point math precision (from the finite number of bits in a CPU's registers or floating point type (float vs double) or something other?). There are no differences when only one axis (X, Y or Z) of the bone's tail is non-zero. But if two or three axises are non-zero, there are differences. For example, in the attached .blend file, [pose-bone-tail-bug.blend](https://archive.blender.org/developer/F107905/pose-bone-tail-bug.blend), one sees a 0.9999999403953552 instead of a 1.0 in the output from the included python script when it's run. **Exact steps for others to reproduce the error** 1. Start blender from a console and open the attached .blend file. 2. Click on the 'Run Script' button in the Text Editor window containing the python script. 3. Look at the output on the console, and note where tail vectors for the pose.bones["..."] differ from those for armatures["Armature"].bones["..."].
Author

Changed status to: 'Open'

Changed status to: 'Open'
Author

Added subscriber: @DeanNelson

Added subscriber: @DeanNelson
Author

To be a bit more precise, step 3 should probably have read...

3. Look at the output on the console, and note where pose.bones["..."].tail differs from those for armatures["Armature"].bones["..."].tail_local.
To be a bit more precise, step 3 should probably have read... 3. Look at the output on the console, and note where pose.bones["..."].tail differs from those for armatures["Armature"].bones["..."].tail_local.
Author

Sigh. It's closer but still not right. How about...

3. Look at the output on the console, and note where vectors for pose.bones["..."].tail differ from those for armatures["Armature"].bones["..."].tail_local with regard to the same bone.
Sigh. It's closer but still not right. How about... 3. Look at the output on the console, and note where vectors for pose.bones["..."].tail differ from those for armatures["Armature"].bones["..."].tail_local with regard to the same bone.

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Bastien Montagne self-assigned this 2014-09-01 19:32:20 +02:00

Well, as you say it yourself, this is mere floating precision issue, not considered a bug, rather a (big) TODO for later (to switch to doubles everywhere). Thanks for the report anyway.

Well, as you say it yourself, this is mere floating precision issue, not considered a bug, rather a (big) TODO for later (to switch to doubles everywhere). Thanks for the report anyway.
Author

Sorry for thinking it a bug. I wasn't sure. The python script I'm working on, started misbehaving when it was run repeatedly against the same bone because of the lack of precision. But I can definitely accept your judgment that it's not a bug, but something that is a TODO. I hope that it does get done one day. :-)

Thanks for for looking at the report.

Sorry for thinking it a bug. I wasn't sure. The python script I'm working on, started misbehaving when it was run repeatedly against the same bone because of the lack of precision. But I can definitely accept your judgment that it's not a bug, but something that is a TODO. I hope that it does get done one day. :-) Thanks for for looking at the report.
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
2 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#41681
No description provided.