Matrix conversion can produce non-unit quaternion #107745

Closed
opened 2023-05-08 17:36:33 +02:00 by Bastien Montagne · 1 comment

System Information
Operating system: Any ?
Graphics card: Any

Blender Version
Broken: current main
Worked: unknown

Short description of error

When opening some of the Pets production files, an matrix-related assert is raised from the code evaluating bbones:

4  _BLI_assert_abort                                                                                                                                                           BLI_assert.c             46   0x2e3bfb46 
5  mat3_normalized_to_quat_fast                                                                                                                                                math_rotation.c          354  0x2e925690 
6  mat3_normalized_to_quat_with_checks                                                                                                                                         math_rotation.c          366  0x2e925720 
7  mat3_to_quat                                                                                                                                                                math_rotation.c          380  0x2e925924 
8  mat3_vec_to_roll                                                                                                                                                            armature.c               2079 0x119079ec 
9  BKE_pchan_bbone_handles_compute                                                                                                                                             armature.c               1227 0x118fe9b5 
10 BKE_pchan_bbone_spline_compute                                                                                                                                              armature.c               1368 0x11900625 
11 BKE_pchan_bbone_spline_setup                                                                                                                                                armature.c               1189 0x118fe077 
12 BKE_pchan_bbone_segments_cache_compute                                                                                                                                      armature.c               1504 0x11902fb7 
13 BKE_pose_eval_bbone_segments                                                                                                                                                armature_update.c        975  0x11930172 
14 operator()                                                                                                                                                                  deg_builder_nodes_rig.cc 242  0x1637f75e 
15 std::__invoke_impl<void, blender::deg::DepsgraphNodeBuilder::build_rig(Object *)::<lambda(Depsgraph *)>&, Depsgraph *>(std::__invoke_other, struct {...} &)                 invoke.h                 61   0x16389e13 
16 std::__invoke_r<void, blender::deg::DepsgraphNodeBuilder::build_rig(Object *)::<lambda(Depsgraph *)>&, Depsgraph *>(struct {...} &)                                         invoke.h                 111  0x16388887 
17 std::_Function_handler<void(Depsgraph *), blender::deg::DepsgraphNodeBuilder::build_rig(Object *)::<lambda(Depsgraph *)>>::_M_invoke(const std::_Any_data &, Depsgraph *&&) std_function.h           290  0x1638612a 
18 std::function<void (Depsgraph *)>::operator()(Depsgraph *) const                                                                                                            std_function.h           591  0x16494147 
19 blender::deg::(anonymous namespace)::evaluate_node                                                                                                                          deg_eval.cc              101  0x1648e86c 
20 blender::deg::(anonymous namespace)::deg_task_run_func                                                                                                                      deg_eval.cc              118  0x1648ec9e 

Exact steps for others to reproduce the error
Open e.g. pro/shots/050_improvise/050_0020/050_0020.anim.blend from pets project SVN r1356.

Note that this assert tends to come and go when SVN is updated, however with a specific version of a specific file (e.g. the one given above) it is 100% reproducible for me.

**System Information** Operating system: Any ? Graphics card: Any **Blender Version** Broken: current main Worked: unknown **Short description of error** When opening some of the Pets production files, an matrix-related assert is raised from the code evaluating bbones: ``` 4 _BLI_assert_abort BLI_assert.c 46 0x2e3bfb46 5 mat3_normalized_to_quat_fast math_rotation.c 354 0x2e925690 6 mat3_normalized_to_quat_with_checks math_rotation.c 366 0x2e925720 7 mat3_to_quat math_rotation.c 380 0x2e925924 8 mat3_vec_to_roll armature.c 2079 0x119079ec 9 BKE_pchan_bbone_handles_compute armature.c 1227 0x118fe9b5 10 BKE_pchan_bbone_spline_compute armature.c 1368 0x11900625 11 BKE_pchan_bbone_spline_setup armature.c 1189 0x118fe077 12 BKE_pchan_bbone_segments_cache_compute armature.c 1504 0x11902fb7 13 BKE_pose_eval_bbone_segments armature_update.c 975 0x11930172 14 operator() deg_builder_nodes_rig.cc 242 0x1637f75e 15 std::__invoke_impl<void, blender::deg::DepsgraphNodeBuilder::build_rig(Object *)::<lambda(Depsgraph *)>&, Depsgraph *>(std::__invoke_other, struct {...} &) invoke.h 61 0x16389e13 16 std::__invoke_r<void, blender::deg::DepsgraphNodeBuilder::build_rig(Object *)::<lambda(Depsgraph *)>&, Depsgraph *>(struct {...} &) invoke.h 111 0x16388887 17 std::_Function_handler<void(Depsgraph *), blender::deg::DepsgraphNodeBuilder::build_rig(Object *)::<lambda(Depsgraph *)>>::_M_invoke(const std::_Any_data &, Depsgraph *&&) std_function.h 290 0x1638612a 18 std::function<void (Depsgraph *)>::operator()(Depsgraph *) const std_function.h 591 0x16494147 19 blender::deg::(anonymous namespace)::evaluate_node deg_eval.cc 101 0x1648e86c 20 blender::deg::(anonymous namespace)::deg_task_run_func deg_eval.cc 118 0x1648ec9e ``` **Exact steps for others to reproduce the error** Open e.g. `pro/shots/050_improvise/050_0020/050_0020.anim.blend` from pets project SVN r1356. Note that this assert tends to come and go when SVN is updated, however with a specific version of a specific file (e.g. the one given above) it is 100% reproducible for me.
Sybren A. Stüvel added this to the Animation & Rigging project 2023-05-11 11:10:58 +02:00
Sybren A. Stüvel self-assigned this 2023-05-11 11:11:01 +02:00
Sybren A. Stüvel changed title from Assert in bbone evaluation code to Matrix conversion can produce non-unit quaternion 2023-05-11 12:18:36 +02:00

This was caused by 756538b4a1 which produced some almost-but-not-quite-normal quaternions. The crash was caused by [0.997199, -0.052740, 0.000000, -0.000000], which has length 0.9986 instead of 1.0.

This was caused by 756538b4a117cb51a15e848fa6170143b6aafcd8 which produced some almost-but-not-quite-normal quaternions. The crash was caused by `[0.997199, -0.052740, 0.000000, -0.000000]`, which has length `0.9986` instead of `1.0`.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-05-11 12:28:19 +02:00
Sybren A. Stüvel removed this from the Animation & Rigging project 2023-05-15 11:22:35 +02:00
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#107745
No description provided.