Fix #116615: Store Blender bone lengths on USD Skeletons #126954

Merged
Jesse Yurkovich merged 2 commits from deadpin/blender:usd-bonelengths into main 2024-09-05 20:37:39 +02:00

USD Skeletons (armatures) are joint-based rather than bone-based in
construction. This means that there's no native bone concept nor is
there any bone lengths. Currently, Blender's USD import uses an
estimation, roughly corresponding to the average distance between
joints in the entire Skeleton, to set the bone length in situations
where it's not obvious that 2 joints are directly connected. This is
imperfect but shouldn't affect actual functioning of the rig.

For armatures coming from external software this is probably the best we
can do. However, for armatures originating from Blender, we can use a
custom primvar to store the bone lengths directly. This allows Blender
armatures to be exported and re-imported in much better fidelity.

This is superior to prior techniques, like those employed by FBX, which
alter the actual Skeleton, inserting extra joints where unnecessary. Not
only is this detrimental when using these files in external software,
but it's still imperfect when importing back into Blender too.


For testing I've so far only used rigify armatures, which can be found in the attached .blend

reference old export/import new export/import
ref roundtrip42 roundtrip43
USD Skeletons (armatures) are joint-based rather than bone-based in construction. This means that there's no native bone concept nor is there any bone lengths. Currently, Blender's USD import uses an estimation, roughly corresponding to the average distance between joints in the entire Skeleton, to set the bone length in situations where it's not obvious that 2 joints are directly connected. This is imperfect but shouldn't affect actual functioning of the rig. For armatures coming from external software this is probably the best we can do. However, for armatures originating from Blender, we can use a custom primvar to store the bone lengths directly. This allows Blender armatures to be exported and re-imported in much better fidelity. This is superior to prior techniques, like those employed by FBX, which alter the actual Skeleton, inserting extra joints where unnecessary. Not only is this detrimental when using these files in external software, but it's still imperfect when importing back into Blender too. ---- For testing I've so far only used rigify armatures, which can be found in the attached .blend | reference | old export/import | new export/import | | --- | --- | --- | | ![ref](/attachments/7265d4bf-c63c-438e-b22a-c3e216395423) | ![roundtrip42](/attachments/b816027e-230c-4a92-8a9e-ccd0a2b3ea6b) | ![roundtrip43](/attachments/e53fd39e-ee6d-46db-8fd7-7044b75b3652) |
Jesse Yurkovich added 1 commit 2024-08-29 23:56:36 +02:00
Fix #116615: Store Blender bone lengths on USD Skeletons
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
50cadd06db
Author
Member

@blender-bot build

@blender-bot build
Jesse Yurkovich added 1 commit 2024-08-30 00:38:23 +02:00
Trust the Bone length rather than do calculations like EditBone would do
All checks were successful
buildbot/vexp-code-patch-lint Build done.
buildbot/vexp-code-patch-linux-x86_64 Build done.
buildbot/vexp-code-patch-darwin-x86_64 Build done.
buildbot/vexp-code-patch-windows-amd64 Build done.
buildbot/vexp-code-patch-darwin-arm64 Build done.
buildbot/vexp-code-patch-coordinator Build done.
6ea31b3274
Bastien Montagne requested review from Michael Kowalski 2024-09-03 12:00:01 +02:00
Bastien Montagne approved these changes 2024-09-03 12:01:16 +02:00
Bastien Montagne left a comment
Owner

Code wise and feature wise LGTM.
Adding @makowalski to get a second USD-knowledgeable pair of eyes on this one. ;)

Code wise and feature wise LGTM. Adding @makowalski to get a second USD-knowledgeable pair of eyes on this one. ;)

@blender-bot build

@blender-bot build
Bastien Montagne added this to the USD project 2024-09-03 12:02:41 +02:00
Michael Kowalski approved these changes 2024-09-04 03:53:38 +02:00
Michael Kowalski left a comment
Member

Very nice solution! Thanks for the fix!

Very nice solution! Thanks for the fix!
Jesse Yurkovich merged commit 832d243249 into main 2024-09-05 20:37:39 +02:00
Jesse Yurkovich deleted branch usd-bonelengths 2024-09-05 20:37:42 +02:00
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
FBX
Interest
Freestyle
Interest
Geometry Nodes
Interest
glTF
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 & 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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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#126954
No description provided.