Baking bones with visual keying produces incorrect result #81302

Closed
opened 2020-09-29 18:22:36 +02:00 by Jay Doshi · 17 comments

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: 3e85bb34d0
Worked: Never (2.80+)

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

Pose before baking:
untitled.png

Pose after baking:
untitled2.png

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

#81302.blend

  • Open #81302.blend
  • Bake Action - check Visual Keying, Clear Constraints, Overwrite Current Action
    Baked action will be incorrect

Here is fille with complete rig:
Rig_Export_Error_Blend File.zip

**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: `3e85bb34d0` Worked: Never (2.80+) **Short description of error** Baking bones with visual keying produces incorrect result. See following images: Pose before baking: ![untitled.png](https://archive.blender.org/developer/F8982723/untitled.png) Pose after baking: ![untitled2.png](https://archive.blender.org/developer/F8982726/untitled2.png) 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** [#81302.blend](https://archive.blender.org/developer/F8982755/T81302.blend) - Open `#81302.blend` - Bake Action - check Visual Keying, Clear Constraints, Overwrite Current Action Baked action will be incorrect Here is fille with complete rig: [Rig_Export_Error_Blend File.zip](https://archive.blender.org/developer/F8936628/Rig_Export_Error_Blend_File.zip)
Author

Added subscriber: @netricsa

Added subscriber: @netricsa

Added subscriber: @iss

Added subscriber: @iss

Changed status from 'Needs Triage' to: 'Needs User Info'

Changed status from 'Needs Triage' to: 'Needs User Info'

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?

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?
Author

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)

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)
Author

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

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

This comment was removed by @netricsa

*This comment was removed by @netricsa*
Richard Antalik changed title from Unable to bake slight complex rig correctly to Unable to bake rig correctly 2020-10-08 18:12:22 +02:00

Changed status from 'Needs User Info' to: 'Confirmed'

Changed status from 'Needs User Info' to: 'Confirmed'

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.

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.

Added subscriber: @dr.sybren

Added subscriber: @dr.sybren

Changed status from 'Confirmed' to: 'Archived'

Changed status from 'Confirmed' to: 'Archived'
Sybren A. Stüvel self-assigned this 2020-10-12 14:51:21 +02:00

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.

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 changed title from Unable to bake rig correctly to Baking bones with visual keying produces incorrect result 2020-10-12 16:35:32 +02:00
Sybren A. Stüvel was unassigned by Richard Antalik 2020-10-12 16:35:32 +02:00

Changed status from 'Archived' to: 'Confirmed'

Changed status from 'Archived' to: 'Confirmed'
Author

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

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
Author

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.

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.

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:

depsgraph.png

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 #76791.

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: ![depsgraph.png](https://archive.blender.org/developer/F8999591/depsgraph.png) 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 #76791.

Closed as duplicate of #76791

Closed as duplicate of #76791
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#81302
No description provided.