Blender 3.5 returns identity instead of real value for matrix_basis, 3.4 works ok #106340

Closed
opened 2023-03-30 21:47:32 +02:00 by TVP · 4 comments

System Information
Operating system: Linux 5.15.0-67-generic #74~20.04.1-Ubuntu SMP Wed Feb 22 14:52:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux

Graphics card: 00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07)

Blender Version
Broken: 3.5.0, build hash: 1be25cfff1, build date: 2023-03-29
Worked: 3.4.1, build hash: 55485cb379, build date: 2022-12-20

Short description of error
Blender 3.5 returns identity instead of real value for matrix_basis, 3.4 works ok. Seems to happen only to certain bones controlled by IK

Exact steps for others to reproduce the error

run matrix_basis_test.sh, the output should be

Blender 3.4.1 (hash 55485cb379f7 built 2022-12-20 00:46:45)
Read prefs: /home/tv/.config/blender/3.4/config/userpref.blend
Reloading external rigs...
Reloading external metarigs...
Read blend: /tmp/matrix_basis_3.4.blend
pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=0
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9355, x=-0.3533, y=0.0000, z=0.0000)> frame=10
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9977, x=-0.0674, y=0.0000, z=0.0000)> frame=20
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9876, x=0.1572, y=0.0000, z=0.0000)> frame=30
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9705, x=-0.2410, y=0.0000, z=0.0000)> frame=40
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9355, x=-0.3533, y=0.0000, z=0.0000)> frame=50

Blender quit
Blender 3.5.0 (hash 1be25cfff18b built 2023-03-29 06:35:04)
Read prefs: /home/tv/.config/blender/3.5/config/userpref.blend
Reloading external rigs...
Reloading external metarigs...
Read blend: /tmp/matrix_basis_3.5.blend
pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=0
pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=10
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9977, x=-0.0674, y=0.0000, z=0.0000)> frame=20
pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=30
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9705, x=-0.2410, y=0.0000, z=0.0000)> frame=40
pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9355, x=-0.3533, y=0.0000, z=0.0000)> frame=50
Blender quit

notice difference for frame 30,
blender 3.5 prints Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)
blender 3.4 prints Quaternion (w=0.9876, x=0.1572, y=0.0000, z=0.0000)

**System Information** Operating system: Linux 5.15.0-67-generic #74~20.04.1-Ubuntu SMP Wed Feb 22 14:52:34 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux Graphics card: 00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07) **Blender Version** Broken: 3.5.0, build hash: 1be25cfff18b, build date: 2023-03-29 Worked: 3.4.1, build hash: 55485cb379f7, build date: 2022-12-20 **Short description of error** Blender 3.5 returns identity instead of real value for matrix_basis, 3.4 works ok. Seems to happen only to certain bones controlled by IK **Exact steps for others to reproduce the error** run matrix_basis_test.sh, the output should be ``` Blender 3.4.1 (hash 55485cb379f7 built 2022-12-20 00:46:45) Read prefs: /home/tv/.config/blender/3.4/config/userpref.blend Reloading external rigs... Reloading external metarigs... Read blend: /tmp/matrix_basis_3.4.blend pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=0 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9355, x=-0.3533, y=0.0000, z=0.0000)> frame=10 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9977, x=-0.0674, y=0.0000, z=0.0000)> frame=20 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9876, x=0.1572, y=0.0000, z=0.0000)> frame=30 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9705, x=-0.2410, y=0.0000, z=0.0000)> frame=40 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9355, x=-0.3533, y=0.0000, z=0.0000)> frame=50 Blender quit Blender 3.5.0 (hash 1be25cfff18b built 2023-03-29 06:35:04) Read prefs: /home/tv/.config/blender/3.5/config/userpref.blend Reloading external rigs... Reloading external metarigs... Read blend: /tmp/matrix_basis_3.5.blend pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=0 pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=10 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9977, x=-0.0674, y=0.0000, z=0.0000)> frame=20 pbone=thigh.L matrix_basis_q=<Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000)> frame=30 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9705, x=-0.2410, y=0.0000, z=0.0000)> frame=40 pbone=thigh.L matrix_basis_q=<Quaternion (w=0.9355, x=-0.3533, y=0.0000, z=0.0000)> frame=50 Blender quit ``` notice difference for frame 30, blender 3.5 prints Quaternion (w=1.0000, x=0.0000, y=0.0000, z=0.0000) blender 3.4 prints Quaternion (w=0.9876, x=0.1572, y=0.0000, z=0.0000)
TVP added the
Priority
Normal
Status
Needs Triage
Type
Report
labels 2023-03-30 21:47:32 +02:00
Richard Antalik added
Status
Confirmed
Module
Animation & Rigging
and removed
Status
Needs Triage
labels 2023-03-31 20:41:48 +02:00

Will bisect.

Will bisect.

I wasn't able to bisect this. Release build of 9cb061f4f0 gives bad result, but debug build seems to be fine. I guess there is some thread race condition going on.

I wasn't able to bisect this. Release build of 9cb061f4f011 gives bad result, but debug build seems to be fine. I guess there is some thread race condition going on.
Nathan Vegdahl self-assigned this 2023-05-05 12:56:40 +02:00
Member

TLDR; turns out this is a duplicate of #106708, and has already been fixed in 85ed2e8c36

Longer explanation:

So, it turns out the actual underlying issue here is the same as the bug reported in #106708: when baking to actions that already have animation in them, the existing keys would (erroneously) remain, resulting in two keys on the same frame but with different values (one from the original action, and one from the bake). It looks like this:

overlapping_keys.jpg

So when you ask for matrix_basis on a frame like that, it might be computed from the old original key or the new baked key. And in the case of at least Blender 3.5, it would choose the first of the two keys, resulting in the reported identity matrix behavior.

The actual bug (the double keys, which isn't supposed to be allowed) was fixed in 85ed2e8c36 and will be in the next Blender release.

TLDR; turns out this is a duplicate of #106708, and has already been fixed in 85ed2e8c368bb624166d5082df79faa9d983573e Longer explanation: So, it turns out the actual underlying issue here is the same as the bug reported in #106708: when baking to actions that already have animation in them, the existing keys would (erroneously) remain, resulting in two keys on the same frame but with different values (one from the original action, and one from the bake). It looks like this: ![overlapping_keys.jpg](/attachments/8c66010c-8149-413e-b3f3-5571c0570867) So when you ask for `matrix_basis` on a frame like that, it might be computed from the old original key or the new baked key. And in the case of at least Blender 3.5, it would choose the first of the two keys, resulting in the reported identity matrix behavior. The actual bug (the double keys, which isn't supposed to be allowed) was fixed in 85ed2e8c368bb624166d5082df79faa9d983573e and will be in the next Blender release.
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-05-05 14:47:06 +02:00
Nathan Vegdahl added
Status
Duplicate
and removed
Status
Archived
labels 2023-05-05 14:47:15 +02:00
Author

many thanks for detailed explanation!

many thanks for detailed explanation!
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#106340
No description provided.