Maniphest T81302

Baking bones with visual keying produces incorrect result
Closed, Duplicate

Assigned To
None
Authored By
Jay Doshi (netricsa)
Sep 29 2020, 6:22 PM
Tags
  • BF Blender
  • Animation & Rigging
Subscribers
Jay Doshi (netricsa)
Richard Antalik (ISS)
Sybren A. Stüvel (sybren)

Description

System Information
Operating system: Windows-10-10.0.19041-SP0 64 Bits
Graphics card: GeForce GTX 970/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 451.48

Blender Version
Broken: version: 2.90.1, branch: master, commit date: 2020-09-23 06:43, hash: rB3e85bb34d0d7
Worked: Never (2.80+)

Short description of error
Baking bones with visual keying produces incorrect result. See following images:

Pose before baking:

Pose after baking:

There is slight difference in bone positions.

Brief description of rig itself:
First 3 layers are bones with no animation, only constraints. Layer 0 has bones where baking produces incorrect result. Layer 22 has control bones that are animated and control this whole rig.

Exact steps for others to reproduce the error

  1. Open T81302.blend
  2. Bake Action - check Visual Keying, Clear Constraints, Overwrite Current Action

Baked action will be incorrect

Here is fille with complete rig:

Event Timeline

Jay Doshi (netricsa) created this task.Sep 29 2020, 6:22 PM
Jay Doshi (netricsa) updated the task description.Sep 29 2020, 6:53 PM
Jay Doshi (netricsa) updated the task description.Sep 29 2020, 7:22 PM
Richard Antalik (ISS) changed the task status from Needs Triage to Needs Information from User.Oct 7 2020, 3:08 PM
Richard Antalik (ISS) added a subscriber: Richard Antalik (ISS).

I see quite a bit of errors when I open provided file. Such complex files may be quite time consuming to debug as well. Can you simplify file to maximum possible extent to demonstrate the issue? Or is this really problem only with complex files?

Jay Doshi (netricsa) added a comment.EditedOct 7 2020, 3:22 PM

This problem is persisting with complex ones i've noted other one time too...so for this there's 3 layers of dependency on parenting
1 - base which is deform (which is totally child constraint of target bones layer) - and no other constraints to keep it clean
2 - target bones which are affected by MCH
3 - MCH bones (involves IK) - which are affected by controllers

so when i bake the base deform only, it doesn't bake correctly only where the rig is affected by 3 layers i.e. on the tube attached to gun and back of the character.

but, if there are 2 layers on other parts of the body ( Deform < Target) baking works well

I was getting different results on deform of that tube bones when i parented it to "Palm" vs " spine" (none of which were correct)

If I'm not wrong, the baking should happen globally - as is on the bones?

Also, i think the error might be for stating missing plugins as everything in the file has been cleaned up (no orphan data as such)

Jay Doshi (netricsa) added a comment.Oct 7 2020, 3:58 PM

Apologies for this might seem confusing...I'll post with video and images with detailed explanation in some time

Jay Doshi (netricsa) added a comment.Oct 7 2020, 4:50 PM
This comment was removed by Jay Doshi (netricsa).
Richard Antalik (ISS) renamed this task from Unable to bake slight complex rig correctly to Unable to bake rig correctly.Oct 8 2020, 6:12 PM
Richard Antalik (ISS) changed the task status from Needs Information from User to Confirmed.
Richard Antalik (ISS) updated the task description.
Richard Antalik (ISS) added a project: Animation & Rigging.

I must have seen some different errors, perhaps even from different file, sorry for that. There are still 4 warnings, but resolving them doesn't help.

I was able to simplify this rig a bit after you explained how it works, but I wasn't able to identify the issue though.

Sybren A. Stüvel (sybren) closed this task as Archived.Oct 12 2020, 2:51 PM
Sybren A. Stüvel (sybren) claimed this task.
Sybren A. Stüvel (sybren) added a subscriber: Sybren A. Stüvel (sybren).

Thanks for the report. Unfortunately the scenario described is too time consuming for us to track down, we require the bug reporter to narrow down the problem.

Normally .blend files can be simplified by removing most objects and disabling settings, until the problem reveals itself more clearly.

If there are many steps to reproduce the problem, please attach a .blend file saved right before the bug occurs, so only a few steps are needed to trigger the bug.

Richard Antalik (ISS) renamed this task from Unable to bake rig correctly to Baking bones with visual keying produces incorrect result.Oct 12 2020, 4:35 PM
Richard Antalik (ISS) reopened this task as Confirmed.
Richard Antalik (ISS) removed Sybren A. Stüvel (sybren) as the assignee of this task.
Richard Antalik (ISS) updated the task description.
Jay Doshi (netricsa) added a comment.Oct 12 2020, 10:40 PM

Ah true true.. sorry will keep that in mind too.. i think the file is re-uploaded by Richard which is simplified .. will remove my previous comment which was kind of confusing

Jay Doshi (netricsa) added a comment.EditedOct 13 2020, 9:53 AM

So after some digging, I think the problem lies in the way it's baked :

It correctly removes the constraints on the Deform bones ("Copy Transforms"), but then parenting is followed i.e. it's affecting the scale of parent (in the hierarchy) on the child (even with offset)

After the baking, the bone scale and position should be absolute - It should counter the scale as per the visual transform

What worked but not the best solution: Remove parents from all deform bones and bake.

If there's some complex rig structure, flattening the hierarchy may not be the best thing with many bones.

Sybren A. Stüvel (sybren) added a comment.Oct 16 2020, 3:07 PM

Even the simplified example file is far from minimal. The existing animation is hidden in the dope sheet (by having "ctrl" in the channel search box), there are invalid animation channels, and there are bone groups that may or may not be relevant, and certain relevant bone layers are hidden. I think also half the bones can be deleted while still showing the problem. To illustrate, this is what the dependency graph of this file currently looks like:

It really helps when things are properly simplified ;-)

Having said that, Visual Keying is known to be problematic, especially in the context of inverse kinematics constraints. Also see T76791.