Pose Library: crash when using partially-keyed quaternions #104591

Closed
opened 2023-05-08 04:53:10 +02:00 by Isiac Dagraca · 8 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.61

Blender Version
Broken: version: 3.3.6, branch: master, commit date: 2023-04-17 14:03, hash: 948f8298b982
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Pose Library (2, 0)
Author: Sybren A. Stüvel

Short description of error
Pose Library seems to confuse certain values if you're using locked values with quaternion. That or it just crashes

Exact steps for others to reproduce the error
Load below file, and configure folder as asset library
in "ApplyPose" file, right click the action in the asset library "FootRotate" and click "Apply Pose" in my case this crashes. But in my other projects this issue causes corrupted looking poses, or a crash.

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3090/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 531.61 **Blender Version** Broken: version: 3.3.6, branch: master, commit date: 2023-04-17 14:03, hash: `948f8298b982` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: Pose Library (2, 0) Author: Sybren A. Stüvel **Short description of error** Pose Library seems to confuse certain values if you're using locked values with quaternion. That or it just crashes **Exact steps for others to reproduce the error** Load below file, and configure folder as asset library in "ApplyPose" file, right click the action in the asset library "FootRotate" and click "Apply Pose" in my case this crashes. But in my other projects this issue causes corrupted looking poses, or a crash.
Isiac Dagraca added the
Type
Report
Priority
Normal
Status
Needs Triage
labels 2023-05-08 04:53:10 +02:00
Author

Tagging @dr.sybren since this seems to be their asset.

Tagging @dr.sybren since this seems to be their asset.
Sybren A. Stüvel added the
Interest
Animation & Rigging
label 2023-05-08 11:49:56 +02:00
Sybren A. Stüvel self-assigned this 2023-05-08 11:50:03 +02:00
Sybren A. Stüvel changed title from Pose Library: Incorrect/corrupted pose or crash when using quaternions with locked axis to Pose Library: crash when using partially-keyed quaternions 2023-05-08 12:38:34 +02:00
Sybren A. Stüvel added
Status
Confirmed
and removed
Status
Needs Triage
labels 2023-05-08 12:38:42 +02:00

The pose library assumes that when quaternions are keyed, all their channels are keyed to form a complete quaternion. The locking of the channels doesn't matter.

In this case the crash can be resolved by simply keying all channels (so also W, Y, and Z) instead of only the X-component of the quaternion. This will likely result in a more reliable pose as well, as the foot will rotate around the expected axis, and the applied quaternion will also be scaled correctly.

Still it'll be good if Blender doesn't crash on these.

The pose library assumes that when quaternions are keyed, all their channels are keyed to form a complete quaternion. The locking of the channels doesn't matter. In this case the crash can be resolved by simply keying all channels (so also W, Y, and Z) instead of only the X-component of the quaternion. This will likely result in a more reliable pose as well, as the foot will rotate around the expected axis, and the applied quaternion will also be scaled correctly. Still it'll be good if Blender doesn't crash on these.
Blender Bot added
Status
Resolved
and removed
Status
Confirmed
labels 2023-05-08 14:01:55 +02:00
Author

Then is this a fault of the way blender applies keys?

I would try to key all channels but as long as the lock is present the keys don't apply.

Then is this a fault of the way blender applies keys? I would try to key all channels but as long as the lock is present the keys don't apply.
Author

No I see the issue, it's that the method of keying I used doesn't do it.

"Whole Character (Selected bones Only)"

Also doesn't do it with "Available"

image

No I see the issue, it's that the method of keying I used doesn't do it. "Whole Character (Selected bones Only)" Also doesn't do it with "Available" ![image](/attachments/9fc7cf92-3117-4b10-a06c-ef9d366132f1)
129 KiB
Author

I don't believe this issue is solved, in my original project I went through every action and made sure the quaternion keyframes were complete and the pose corruption issue still occured.

So i decided to return to the example project and apply the keyframes for the whole quaternion.

And it's mixing the W and X values on the toe.

Before applying the pose
image

After applying the pose.
image

I don't believe this issue is solved, in my original project I went through every action and made sure the quaternion keyframes were complete and the pose corruption issue still occured. So i decided to return to the example project and apply the keyframes for the whole quaternion. And it's mixing the W and X values on the toe. Before applying the pose ![image](/attachments/46e6adbd-6135-4fa2-992d-a28c706451ea) After applying the pose. ![image](/attachments/a80129f4-76e1-4210-b3e8-4a28fce0db63)
8.6 KiB
6.4 KiB
Blender Bot added
Status
Needs Triage
and removed
Status
Resolved
labels 2023-05-09 05:40:08 +02:00

When working with quaternions, it doesn't make much sense to only key them partially. By changing only the X-component, you not only change the angle, but also the rotation axis itself. If you want to limit the rotation to a single axis, and want to only put that axis in the pose asset, I would strongly recommend using Euler angles instead.

Blender's pose library assumes that quaternions are keyed in order, which is what would happen when you use the "Create Pose Asset" button. I've just pushed a fix for this (5532d05622), so that the FCurves can be in any order (as long as they follow each other without other FCurves in between).

When working with quaternions, it doesn't make much sense to only key them partially. By changing only the X-component, you not only change the angle, but also the rotation axis itself. If you want to limit the rotation to a single axis, and want to only put that axis in the pose asset, I would strongly recommend using Euler angles instead. Blender's pose library assumes that quaternions are keyed in order, which is what would happen when you use the "Create Pose Asset" button. I've just pushed a fix for this (https://projects.blender.org/blender/blender/commit/5532d05622655f8b3ca30b1b252c16f228b13d98), so that the FCurves can be in any order (as long as they follow each other without other FCurves in between).
Blender Bot added
Status
Archived
and removed
Status
Needs Triage
labels 2023-05-09 11:29:42 +02:00
Author

When working with quaternions, it doesn't make much sense to only key them partially. By changing only the X-component, you not only change the angle, but also the rotation axis itself. If you want to limit the rotation to a single axis, and want to only put that axis in the pose asset, I would strongly recommend using Euler angles instead.

Yes I realize this error, the model is old and the project too far along to fix this reasonably. But we can ensure the mistake is not repeated.

And thanks to your fix and explanation if it happens accidentally in the future, it won't cause such sweeping issues!

> When working with quaternions, it doesn't make much sense to only key them partially. By changing only the X-component, you not only change the angle, but also the rotation axis itself. If you want to limit the rotation to a single axis, and want to only put that axis in the pose asset, I would strongly recommend using Euler angles instead. > Yes I realize this error, the model is old and the project too far along to fix this reasonably. But we can ensure the mistake is not repeated. And thanks to your fix and explanation if it happens accidentally in the future, it won't cause such sweeping issues!

Well, thanks for the report, it made it clear something had to be fixed ;-)

Well, thanks for the report, it made it clear something had to be fixed ;-)
Howard Trickey referenced this issue from a commit 2023-05-29 02:51:41 +02:00
Sign in to join this conversation.
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-addons#104591
No description provided.