Fbx exporter: Shape keys animation export broken #66272

Open
opened 2019-06-30 12:51:57 +02:00 by lucas veber · 13 comments

System Information
Operating system: Windows-10-10.0.17134 64 Bits
Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86

Blender Version
Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-06-29 20:58, hash: blender/blender@be060c3990
Worked: 2.79b

Short description of error
Exporting animated shape keys with the Fbx exporter is broken.
After investigation, it seems this line is the cause in the export_fbx_bin.py file:

tmp_me = bpy.data.meshes.new_from_object(
                            ob_to_convert, preserve_all_data_layers=True, depsgraph=depsgraph)

ob_to_convert.data.shape keys is not None, but tmp_me.shape_keys is None.
So shape keys are lost here, and are not registered in the data_meshes dict.

Exact steps for others to reproduce the error

  • Open the blend file and export the Cube to Fbx:
    cube.blend
  • Import it back in Blender or Unity, the shape key is not animated.
**System Information** Operating system: Windows-10-10.0.17134 64 Bits Graphics card: GeForce GTX 1080/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 430.86 **Blender Version** Broken: version: 2.80 (sub 74), branch: master, commit date: 2019-06-29 20:58, hash: `blender/blender@be060c3990` Worked: 2.79b **Short description of error** Exporting animated shape keys with the Fbx exporter is broken. After investigation, it seems this line is the cause in the export_fbx_bin.py file: ``` tmp_me = bpy.data.meshes.new_from_object( ob_to_convert, preserve_all_data_layers=True, depsgraph=depsgraph) ``` **ob_to_convert.data.shape keys** is not None, but **tmp_me.shape_keys** is None. So shape keys are lost here, and are not registered in the **data_meshes** dict. **Exact steps for others to reproduce the error** - Open the blend file and export the Cube to Fbx: [cube.blend](https://archive.blender.org/developer/F7557096/cube.blend) - Import it back in Blender or Unity, the shape key is not animated.
Author

Added subscriber: @LucasVeber

Added subscriber: @LucasVeber
Member

Added subscribers: @mont29, @lichtwerk

Added subscribers: @mont29, @lichtwerk
Member

ob_to_convert.data.shape keys is not None, but tmp_me.shape_keys is None

Not sure this is is actually the reason...

  • for me here, shapekeys key_blocks are actually coming over correctly [just the animation is missing with default settings]
  • I can get the shapekey animation to export/import fine if I disable All Actions and NLA Strips under the FBX export Animation Settings
  • could you check if this works for you?

@mont29: I am a bit confused why the shapekey animation seems nowhere to be found after reimporting if All Actions and NLA Strips are enabledon export? (shouldnt these at least be selectable from the Dopesheet ShapeKey Editor Action dropdown?)

> ob_to_convert.data.shape keys is not None, but tmp_me.shape_keys is None Not sure this is is actually the reason... - for me here, shapekeys key_blocks are actually coming over correctly [just the animation is missing with default settings] - I can get the shapekey animation to export/import fine if I disable `All Actions` and `NLA Strips` under the FBX export Animation Settings - could you check if this works for you? @mont29: I am a bit confused why the shapekey animation seems nowhere to be found after reimporting if `All Actions` and `NLA Strips` are enabledon export? (shouldnt these at least be selectable from the Dopesheet ShapeKey Editor Action dropdown?)
Author

for me here, shapekeys key_blocks are actually coming over correctly [just the animation is missing with default settings]

I can't say i'm 100% sure of course, but i'm pretty sure the data_meshes dict should be filled with the shape keys data, while it's no more the case in the latest version.

To expose it better, a few lines below:

for me_key, me, _free in data_meshes.values():
        if not (me.shape_keys and len(me.shape_keys.key_blocks) > 1):
             continue

me.shape_keys being None, shape keys are skipped.
But this is a different case, in the given example the Cube object is "use_org_data". Sorry for the confusion.

I can get the shapekey animation to export/import fine if I disable All Actions and NLA Strips under the FBX export Animation Settings

Not working here (tested with the same blend file).

> for me here, shapekeys key_blocks are actually coming over correctly [just the animation is missing with default settings] I can't say i'm 100% sure of course, but i'm pretty sure the **data_meshes** dict should be filled with the shape keys data, while it's no more the case in the latest version. To expose it better, a few lines below: ``` for me_key, me, _free in data_meshes.values(): if not (me.shape_keys and len(me.shape_keys.key_blocks) > 1): continue ``` **me.shape_keys** being None, shape keys are skipped. But this is a different case, in the given example the Cube object is "use_org_data". Sorry for the confusion. > I can get the shapekey animation to export/import fine if I disable All Actions and NLA Strips under the FBX export Animation Settings Not working here (tested with the same blend file).
Author

Sorry, I inverted "All Actions" and "Baked Animations" buttons!
When disabling these two options, shape keys animation exports here as well, yes.

Sorry, I inverted "All Actions" and "Baked Animations" buttons! When disabling these two options, shape keys animation exports here as well, yes.
Bastien Montagne was assigned by Philipp Oeser 2019-07-02 14:54:10 +02:00
Member

OK, not exactly sure what to do then:

  • we have a working "workaround"
  • it still seems unclear why shapekey anims wont export if All Actions and NLA Strips are enabled

@mont29: will assign to you [even though this might really not be a bug] for making a decission...

OK, not exactly sure what to do then: - we have a working "workaround" - it still seems unclear why shapekey anims wont export if `All Actions` and `NLA Strips` are enabled @mont29: will assign to you [even though this might really not be a bug] for making a decission...

Added subscriber: @BleuRaven

Added subscriber: @BleuRaven
Bastien Montagne was unassigned by Dalai Felinto 2019-12-23 16:33:56 +01:00

Added subscriber: @Zoni

Added subscriber: @Zoni

This still seems to be an issue, I exported a cloth simulation to Unity with the newest official version and it only appeared when all actions and nla-tracks were disabled.

This still seems to be an issue, I exported a cloth simulation to Unity with the newest official version and it only appeared when all actions and nla-tracks were disabled.

Added subscriber: @Marksssss

Added subscriber: @Marksssss

The work-around works with the provided blend file, but I have one here that still doesn't work.animationString2.blend

If you try to export this as a fbx, even if you disable NLA strips and All Actions, the animation won't be exported.

The work-around works with the provided blend file, but I have one here that still doesn't work.[animationString2.blend](https://archive.blender.org/developer/F9008026/animationString2.blend) If you try to export this as a fbx, even if you disable NLA strips and All Actions, the animation won't be exported.

Added subscriber: @fynn.braren

Added subscriber: @fynn.braren
Contributor

Can confirm as for 3.6 workaround still works.

If someone will attempt to fix this note that there is also proglem that shape key animation is not exported if you don't have any action selected in action editor (example - #104759). Workaround works though.

Can confirm as for 3.6 workaround still works. If someone will attempt to fix this note that there is also proglem that shape key animation is not exported if you don't have any action selected in action editor (example - #104759). Workaround works though.
Sign in to join this conversation.
No Milestone
No project
No Assignees
7 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#66272
No description provided.