blender return wrong value for matrix #59726

Closed
opened 2018-12-21 16:47:15 +01:00 by Francisco Javier Martinez Palmer · 10 comments

System Information
Operating system: windows
Graphics card: nvidia quadro

Blender Version
Broken: 2.79b release

Short description of error
blender is providing wrong values for the pose matrix when getting them.
The top bone is rotated 60 degrees on x and y axis, and moved up around 20 units.
The matrix for that bone is correct as its displayed in the matrix (check the python code provided in the scene)
When trying to retrieve the values from the matrix, some values are wrong. In this case one specifically (check the code as mentioned to know more)

Exact steps for others to reproduce the error
checkout the provided scene.
Steps to reproduce:

  • Select the box mesh (is very distorted)
  • Run the script Text.001

Now check the script code and the output in the console. No mather if deepcopy or anything else is used blender always returns different values than the ones stored in the matrix.repo_cube.blend

**System Information** Operating system: windows Graphics card: nvidia quadro **Blender Version** Broken: 2.79b release **Short description of error** blender is providing wrong values for the pose matrix when getting them. The top bone is rotated 60 degrees on x and y axis, and moved up around 20 units. The matrix for that bone is correct as its displayed in the matrix (check the python code provided in the scene) When trying to retrieve the values from the matrix, some values are wrong. In this case one specifically (check the code as mentioned to know more) **Exact steps for others to reproduce the error** checkout the provided scene. Steps to reproduce: - Select the box mesh (is very distorted) - Run the script Text.001 Now check the script code and the output in the console. No mather if deepcopy or anything else is used blender always returns different values than the ones stored in the matrix.[repo_cube.blend](https://archive.blender.org/developer/F6026620/repo_cube.blend)

Added subscriber: @matheboy

Added subscriber: @matheboy

Added subscriber: @ZedDB

Added subscriber: @ZedDB

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'
Sebastian Parborg self-assigned this 2018-12-21 17:52:25 +01:00

The values are correct as the matrix print does not print out the whole float value. The later prints outputs the actual value.

IE if the matrix value is less than 0.0001, it will print it as 0.0000. However, that doesn't mean that the actual floating point value is 0

The values are correct as the matrix print does not print out the whole float value. The later prints outputs the actual value. IE if the matrix value is less than 0.0001, it will print it as 0.0000. However, that doesn't mean that the actual floating point value is 0

Changed status from 'Archived' to: 'Open'

Changed status from 'Archived' to: 'Open'

This are the lines you should be looking at (starting at 36 in the script):

      print (aux[0]) # here the vector is : <Vector (0.5000, -0.0000, -0.8660, 0.0000)>
      aux3 = copy.deepcopy(aux[0])
      print(aux3)
      print(aux3[0],aux3[1])
      print (aux[0].y) # why here then returns -1.3461173509199398e-08 ???? it should be -0.0000 !!!!!!

Do you think the difference between 0.0 (in the matrix) and -1.34 (when getting the value out) is acceptable?

If you look closer this happens later again with the other matrix, it doesnt look acceptable to me

This are the lines you should be looking at (starting at 36 in the script): ``` print (aux[0]) # here the vector is : <Vector (0.5000, -0.0000, -0.8660, 0.0000)> aux3 = copy.deepcopy(aux[0]) print(aux3) print(aux3[0],aux3[1]) print (aux[0].y) # why here then returns -1.3461173509199398e-08 ???? it should be -0.0000 !!!!!! ``` Do you think the difference between 0.0 (in the matrix) and -1.34 (when getting the value out) is acceptable? If you look closer this happens later again with the other matrix, it doesnt look acceptable to me

Added subscriber: @StephenSwaney

Added subscriber: @StephenSwaney

Do you think the difference between 0.0 (in the matrix) and -1.34 (when getting the value out) is acceptable?

If I may...
The return value is not -1.34, but -1.3461173509199398e-08.
Printed in non-scientific notation it looks like -0.00000001.346 (rounded).
Mathematically speaking, this is DNZ - Damn Near Zero.

Internally, calculations are done with the full floating point values, when printed they get rounded

> Do you think the difference between 0.0 (in the matrix) and -1.34 (when getting the value out) is acceptable? If I may... The return value is not -1.34, but -1.3461173509199398e-08. Printed in non-scientific notation it looks like -0.00000001.346 (rounded). Mathematically speaking, this is DNZ - Damn Near Zero. Internally, calculations are done with the full floating point values, when printed they get rounded

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

@StephenSwaney Thanks for the explaination

@matheboy In the future, do not reopen issues just because you do not understand the answer. You are of course free to ask for a clarification. I incorrectly assumed that you knew the standard scientific notations and thought you were confused about floating point numbers. (IE why is it near zero when it should be zero?)

https://en.wikipedia.org/wiki/Scientific_notation#E-notation

@StephenSwaney Thanks for the explaination @matheboy In the future, do not reopen issues just because you do not understand the answer. You are of course free to ask for a clarification. I incorrectly assumed that you knew the standard scientific notations and thought you were confused about floating point numbers. (IE why is it near zero when it should be zero?) https://en.wikipedia.org/wiki/Scientific_notation#E-notation
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
3 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#59726
No description provided.