The conversion of roll to matrix breaks in some cases #82455
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
6 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#82455
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?
I refer to this function: source/blender/blenkernel/intern/armature.c :: vec_roll_to_mat3_normalized()
The conversion of roll to matrix breaks when a bone has very small values in x and z. In that case we get a division by very small numbers which can cause a broken bone roll matrix.
details:
As already mentioned in the comments:
I have found other situations where nor == (x, 0.99999994, z) with x and/or z very close to 0, but not exactly 0. However the test (nor- [x] || nor- [x]) can be true for tiny numbers. So further down in the function we see:
So when x and/or z are tiny numbers, then theta becomes tiny as well. And since we only check for (x or z != 0):
if (theta > THETA_SAFE || ((nor- [x] || nor- [x]) && theta > THETA_CRITICAL)) ...
You can see that theta can potentially drop below the THETA_THRESHOLD_NEGY_CLOSE if both nor- [x] and nor- [x] are very close to 0. And this finally leads to potentially very huge numbers for example here (division by almost zero):
Because of this i believe it is better to not only check (nor- [x] or nor- [x] != 0) but also to make sure that (nor- [x] * nor- [x] + nor- [x] * nor- [x]) is above THETA_THRESHOLD_NEGY_CLOSE.
Below is a python script that generates a rig that suffers from this bug. Run the script, then switch from edit mode to pose mode and see how "bad bone" disappears. Because its pose bone matrix is totally broken. The problem originates in the super small bone roll values which finally lead to the bug:
This is a follow up task of the refactoring handled in https://developer.blender.org/D9410
Changed status from 'Needs Triage' to: 'Confirmed'
Added subscribers: @GaiaClary, @dr.sybren, @mont29
#88581 was marked as duplicate of this issue
Added subscriber: @schampions
This may be set for Blender developers!
This would be due to the source code!
@schampions Welcome to developer.blender.org -- here, everything is for Blender developers. Useful feedback is appreciated, but do know that this is not just a forum. It's the central hub for Blender development.
This issue was referenced by
df445cc571
This issue was referenced by
16eafdadf6
Added subscribers: @scurest, @Azrael69, @lichtwerk, @JulienDuroure
Changed status from 'Confirmed' to: 'Resolved'