Improve Bind Pose Support in Blender #50412

Closed
opened 2017-01-11 00:30:16 +01:00 by Gaia Clary · 14 comments
Member

This task is directly related to the task #38660

Back in Blender 2.70 we had a nasty problem with exporting data from Blender to Secondlife. The problem was that we necessarily needed to support the Bind Pose feature. That is:

  • The Restpose is where all pose matrices are neutral have no influence on the skeleton and the meshes
  • The Bindpose is an arbitrary pose that is treated as if it where the restpose.

But Blender does not have a bind pose, or better said, In Blender the Bindpose and the Restpose are always identical.

Back in 2.70 this issue was solved in a very ugly way:

we added a custom transformation to each bone which contains a scale, a rotation and a translation:

  restpose_scale_x (default = 1.0)
  restpose_scale_y (default = 1.0)
  restpose_scale_z (default = 1.0)
  restpose_rot_x (default = 0.0)
  restpose_rot_y (default = 0.0)
  restpose_rot_z (default = 0.0)
  restpose_loc_x (default = 0.0)
  restpose_loc_y (default = 0.0)
  restpose_loc_z (default = 0.0)

So if any of those value sets exists then the Blender collada exporter will use the found data (the bindpose) to define the "inverse bind matrix of the bone"

So far so well, now we have the opposite issue. We must preserve the bind pose data when a skeleton is imported into Blender. But currently Blender just takes the bindpose that comes with Collada and creates a restpose out of it. So it actually "applies the current pose as new restpose" and so all bindpose information goes away and can not be recoveres.

So my idea is:

Let the Collada Importer fill in the bindpose matrices into the custom properties. And make it so compatible with what we already have (use the custom properties restpose_scale_x/y/z etc as we have already for the exporter)

I believe this addition can be easily implemented and it would make the Importer able to import bindpose information and keep it for later reuse (for whichever purpose, not only for later export).

Implementing this would be straight forward. The bind pose data is available in the function where the restpose is calculated from the Collada data. At this point it is easy to also generate the customproperties. It should be a matter of a couple of hours to get this basically working. Well, ok maybe 2 days for me :).

But maybe this can be made more general and useful, it even could be used to implement a true Bind Pose support in Blender (just like Maya has for example and just like Collada supports it).

Please let me know how to proceed from here.

cheers,
Gaia

This task is directly related to the task #38660 Back in Blender 2.70 we had a nasty problem with exporting data from Blender to Secondlife. The problem was that we necessarily needed to support the Bind Pose feature. That is: * The Restpose is where all pose matrices are neutral have no influence on the skeleton and the meshes * The Bindpose is an arbitrary pose that is treated as if it where the restpose. But Blender does not have a bind pose, or better said, In Blender the Bindpose and the Restpose are always identical. Back in 2.70 this issue was solved in a very ugly way: we added a custom transformation to each bone which contains a scale, a rotation and a translation: ``` restpose_scale_x (default = 1.0) restpose_scale_y (default = 1.0) restpose_scale_z (default = 1.0) ``` ``` restpose_rot_x (default = 0.0) restpose_rot_y (default = 0.0) restpose_rot_z (default = 0.0) ``` ``` restpose_loc_x (default = 0.0) restpose_loc_y (default = 0.0) restpose_loc_z (default = 0.0) ``` So if any of those value sets exists then the Blender collada exporter will use the found data (the bindpose) to define the "inverse bind matrix of the bone" So far so well, now we have the opposite issue. We must preserve the bind pose data when a skeleton is imported into Blender. But currently Blender just takes the bindpose that comes with Collada and creates a restpose out of it. So it actually "applies the current pose as new restpose" and so all bindpose information goes away and can not be recoveres. **So my idea is:** Let the Collada Importer fill in the bindpose matrices into the custom properties. And make it so compatible with what we already have (use the custom properties restpose_scale_x/y/z etc as we have already for the exporter) I believe this addition can be easily implemented and it would make the Importer able to import bindpose information and keep it for later reuse (for whichever purpose, not only for later export). Implementing this would be straight forward. The bind pose data is available in the function where the restpose is calculated from the Collada data. At this point it is easy to also generate the customproperties. It should be a matter of a couple of hours to get this basically working. Well, ok maybe 2 days for me :). But maybe this can be made more general and useful, it even could be used to implement a true Bind Pose support in Blender (just like Maya has for example and just like Collada supports it). Please let me know how to proceed from here. cheers, Gaia
Author
Member

Changed status to: 'Open'

Changed status to: 'Open'
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary
Author
Member

Added subscribers: @JoshuaLeung, @Sergey, @mont29
Removed subscriber: @GaiaClary

Added subscribers: @JoshuaLeung, @Sergey, @mont29 Removed subscriber: @GaiaClary
Author
Member

Please can you comment on this and help me deciding how to proceed? thanks a lot !

Please can you comment on this and help me deciding how to proceed? thanks a lot !
Author
Member

Added subscriber: @jesterking

Added subscriber: @jesterking
Author
Member
No description provided.
Member

I suppose for now using Custom Properties during import would do fine, but @JoshuaLeung can probably tell more about tackling this in a better way.

I suppose for now using Custom Properties during import would do fine, but @JoshuaLeung can probably tell more about tackling this in a better way.

Well… Adding the different restpose/bindpose concept into Blender would be a really big project (would likely affect a lot of editing/posing armature tools), and, more importantly, I personally do not understand why this is needed at all? What are the benefits, the things you cannot do without that dichotomy?

Note that currently, in FBX, we are assuming that rest pose is same as bind pose (in other words, we use FBX's bindpose as restpose as well). Tbh, I would be reluctant diving into that nightmare again, we already have waaaayyyyyy to much things to handle in FBX’s transform & rigging system. ;)

But you are obviously free to support that in Collada IO! I think your current idea is the best way to do so, especially since it’s already hooked into exporting code.

Well… Adding the different restpose/bindpose concept into Blender would be a really big project (would likely affect a lot of editing/posing armature tools), and, more importantly, I personally do not understand why this is needed at all? What are the benefits, the things you cannot do without that dichotomy? Note that currently, in FBX, we are assuming that rest pose is same as bind pose (in other words, we use FBX's bindpose as restpose as well). Tbh, I would be reluctant diving into that nightmare again, we already have waaaayyyyyy to much things to handle in FBX’s transform & rigging system. ;) But you are obviously free to support that in Collada IO! I think your current idea is the best way to do so, especially since it’s already hooked into exporting code.
Author
Member

Thanks for feedback so far!

So i proceed as follows now:

  • I add the code for creating the custom properties to the Collada importer
  • I add an option to the importer to "import bind pose info"
  • I also add a new option to the exporter "use custom bind pose"

Optionally add 2 new operators for:

  • generate bind pose info from current pose
  • delete bind pose info from active armature

Those operators can be accessed from the SPACE menu.

Optionally (if that is possible):

  • add 2 buttons into the Custom Properties section of armatures to access the operators. This can either be made directly in Blender or i can put this into a small Addon if that is more convenient.
Thanks for feedback so far! So i proceed as follows now: - I add the code for creating the custom properties to the Collada importer - I add an option to the importer to "import bind pose info" - I also add a new option to the exporter "use custom bind pose" Optionally add 2 new operators for: - generate bind pose info from current pose - delete bind pose info from active armature Those operators can be accessed from the SPACE menu. Optionally (if that is possible): - add 2 buttons into the Custom Properties section of armatures to access the operators. This can either be made directly in Blender or i can put this into a small Addon if that is more convenient.
Author
Member

Added subscriber: @GaiaClary

Added subscriber: @GaiaClary

Added subscriber: @DanielKramer

Added subscriber: @DanielKramer

Added subscriber: @tobiashouston

Added subscriber: @tobiashouston
Author
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Gaia Clary self-assigned this 2017-06-25 15:03:40 +02:00
Author
Member

This has been implemented with commit 51d4743033

This has been implemented with commit 51d4743033a39a90e60cdad3dd30ffa834d999de
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
5 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#50412
No description provided.