FBX exporter uses FullWeights for the wrong purpose #90382

Open
opened 2021-08-02 16:48:41 +02:00 by Samuli Raivio · 1 comment

In the process of writing tests for my FBX importer I found that the Blender FBX importer writes per-vertex FullWeights values. By inspecting FBX files from other exporters I have discovered that the FullWeights is used to control in between blend shapes that Blender does not support. For example you could specify a two-stage blend shape 0 -> A(0.5) -> B(1.0) which would be represented in FBX as two attached Shape objects and FullWeights: 0.5, 1.0. Blender uses the same field to store vertex group information and it is read on the import side as well, so fixing this is a bit tricky.

Ramifications: The FBX SDK importer seems to tolerate per-vertex FullWeights but I'd guess it'd break in other programs if the first value would be zero. I didn't test if other 3rd party importers fail but for mine I'll add a special-case for Blender's current behavior. Blender currently fails to import FBX files with in-between blend targets (failing due to bad amount of FullWeights, eg. [1]).

Fixes: I'd propose at least fixing importing files with in-between blend shapes by dropping the intermediate blend shapes and ignoring FullWeights in that case as that shouldn't break anything. Storing the vgroup data under a different key might make the exported files more robust in the future, but would lose the vgroup data in older Blender versions. On the other hand I'm not sure how well FBX importers handle unknown keys either.

I would be up for making a patch for this if any of these things are deemed worth fixing.

In the process of writing tests for my FBX importer I found that the Blender FBX importer writes per-vertex `FullWeights` values. By inspecting FBX files from other exporters I have discovered that the `FullWeights` is used to control *in between* blend shapes that Blender does not support. For example you could specify a two-stage blend shape `0 -> A(0.5) -> B(1.0)` which would be represented in FBX as two attached `Shape` objects and `FullWeights: 0.5, 1.0`. Blender uses the same field to store vertex group information and it is read on the import side as well, so fixing this is a bit tricky. **Ramifications:** The FBX SDK importer seems to tolerate per-vertex `FullWeights` but I'd guess it'd break in other programs if the first value would be zero. I didn't test if other 3rd party importers fail but for mine I'll add a special-case for Blender's current behavior. Blender currently fails to import FBX files with in-between blend targets (failing due to bad amount of `FullWeights`, eg. [1]). **Fixes:** I'd propose at least fixing importing files with in-between blend shapes by dropping the intermediate blend shapes and ignoring `FullWeights` in that case as that shouldn't break anything. Storing the vgroup data under a different key might make the exported files more robust in the future, but would lose the vgroup data in older Blender versions. On the other hand I'm not sure how well FBX importers handle unknown keys either. I would be up for making a patch for this if any of these things are deemed worth fixing. - [x] https://github.com/bqqbarbhg/ufbx/blob/a1f3bf426397ac7e1b408cf77013960980d3b2ae/data/maya_blend_inbetween_7500_binary.fbx
Author

Added subscriber: @bqqbarbhg

Added subscriber: @bqqbarbhg
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 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#90382
No description provided.