Child object rotates after parenting with 'Keep Transform Without Inverse' #109790
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#109790
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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
Operating system: macOS-13.4.1-arm64-arm-64bit 64 Bits
Graphics card: Apple M1 Max Apple 4.1 Metal - 83.1
Blender Version
Broken: version: 3.6.0, branch: blender-v3.6-release, commit date: 2023-06-27 08:08, hash:
c7fc78b81ecb
Worked: introduced with 'Keep Transform Without Inverse' in 3.2
Short description of error
After parenting with 'Keep Transform Without Inverse' the child object is slightly rotated and even the location can be off in relation to the parent object.
Please see the attached video and the blend file.
Note, that the scene units in the blend file are set to centimetres. Working with smaller units pronounces the effect of the location values. But for the rotation the scene units have no effect.
The problem seems to be related to rounding errors in the transform matrix multiplication code.
Other observations:
The problem is not directly noticable, other than fractional values are introduced to the rotation as well as the location. But when the object is large the far-away edges will get shifted in a more visible way.
Exact steps for others to reproduce the error
Parent an object to another which has rotation values. The resulting offset is small and therefore is only pronounced when zooming in at a larger distance from the origin.
This indeed appears to be due to floating point rounding error in Blender's transform matrix math routines. Specifically, when I change both of the following functions in
math_matrix.c
to use double precision internally for their computations, the error is significantly reduced:mul_m4_m4m4()
invert_m4_m4()
So in short, this isn't a bug per se, but rather is a limitation of floating point math. Nevertheless, there are some potential ways to address this:
invert_m4_m4_high_precision()
to be used at the call sites that have the most impact on user-visible precision issues.Both of these would have negative performance implications, however. And regardless would need to be discussed with the wider Blender project, since it impacts more than just the animation/rigging module.
Some further investigation:
I think this means that the real issue is that very specific rotations result in matrices that have catastrophic cancellation in one or more subsequent operations. Which is also why moving those operations to double precision more-or-less resolves the issue.
I opened a discussion on devtalk about moving transforms generally to double precision. That would certainly address this issue (along with many others). However, that looks to be a more long-term thing, and will be a significant effort.
Since switching just
mul_m4_m4m4()
andinvert_m4_m4()
to double precision seems to resolve (or at least significantly mitigate) this particular issue, I think that would be a good way forward for the time being.@brecht Do you have any opinions on this?
If we switch something specific for parent to use doubles that seems reasonable. Changing all matrix multiplication and inversion in Blender and continuously converting between floats and doubles I do not think is acceptable.
Sounds good. I'll investigate making changes to narrowly affect just the parenting-related code.