Rest Position silently prevents exporting .fbx and .glb animations #104974

Closed
opened 2023-10-24 03:03:33 +02:00 by Sami-Koskinen · 4 comments

System Information
Operating system: Windows-10-10.0.22621-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.45

Blender Version
Broken: version 3.6.5, 4.1.0
Worked: Don't know

Short description of error
While an armature is set to Rest Position, attempting to export animations as .fbx or .glb will result in the tracks being exported with no keyframes.
This happens even when exporting is done as NLA strips.
I tested it with both .glb and .fbx

Note: Moved from blender/blender#113973. There @Mysteryem pointed out that this happens because the exporters pose the models each frame to export them. So with the model being set to Rest Position it will just silently fail to pose it for the animations.

Exact steps for others to reproduce the error

  • Open attached .blend file
  • Set the cube in the file to Rest Position
  • Export to .glb or .fbx with animation.

The exported animation won't do anything.

  • Set it back to Pose Position
  • Export to .glb or .fbx with animation.

Anims just fine.

It would be nice to either get some kind of warning about it, or just make it automatically switch to Pose Position, export, then switch back to Rest Pos.

**System Information** Operating system: Windows-10-10.0.22621-SP0 64 Bits Graphics card: NVIDIA GeForce RTX 3070 Laptop GPU/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 536.45 **Blender Version** Broken: version 3.6.5, 4.1.0 Worked: Don't know **Short description of error** While an armature is set to Rest Position, attempting to export animations as .fbx or .glb will result in the tracks being exported with no keyframes. This happens even when exporting is done as NLA strips. I tested it with both .glb and .fbx Note: Moved from blender/blender#113973. There @Mysteryem pointed out that this happens because the exporters pose the models each frame to export them. So with the model being set to Rest Position it will just silently fail to pose it for the animations. **Exact steps for others to reproduce the error** - Open attached .blend file - Set the cube in the file to `Rest Position` - Export to .glb or .fbx with animation. The exported animation won't do anything. - Set it back to `Pose Position` - Export to .glb or .fbx with animation. Anims just fine. It would be nice to either get some kind of warning about it, or just make it automatically switch to Pose Position, export, then switch back to Rest Pos.
Sami-Koskinen added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2023-10-24 03:03:34 +02:00

Thanks for the report, @Sami-Koskinen. I can confirm the problem.
(It's possible that I made a mistake with the repository and the code to be fixed is in fact in the other repository, but here it seems more correct).

Note that this may not necessarily be a bug. If the exporter does not support "Rest Pose", it may still be convenient not to animate these objects.

This issue appears to be related to:
#85496: FBX export bug (restpose missing, wrong rotations)
#104937: FBX export of armature changes rest pose if without weighted mesh

Thanks for the report, @Sami-Koskinen. I can confirm the problem. (It's possible that I made a mistake with the repository and the code to be fixed is in fact in the other repository, but here it seems more correct). Note that this may not necessarily be a bug. If the exporter does not support "Rest Pose", it may still be convenient not to animate these objects. This issue appears to be related to: #85496: FBX export bug (restpose missing, wrong rotations) #104937: FBX export of armature changes rest pose if without weighted mesh
Germano Cavalcante added
Status
Confirmed
Module
Add-ons (BF-Blender)
and removed
Status
Needs Triage
labels 2023-10-24 14:45:34 +02:00
Member

I don't know anything about how gltf exports animation, so assume everything I say is only relevant to FBX IO.


Rather than using bpy.ops.nla.bake(), FBX IO manually goes through each frame and samples the values at each frame to animation.

FBX also exports Shape Key animation and camera focus distance/length animation which bpy.ops.nla.bake() does not support.

bpy.ops.nla.bake() also does not support sampling at subframes and I'm not sure how exporting the animation of instances could be supported when using bpy.ops.nla.bake().

So I can't imagine this changing from manually going through each frame any time soon.


My concern with temporarily changing armatures from Rest Position to Pose Position when exporting is if there are cases where users would want some armatures to remain in Rest Position or if there are any cases where Armature.pose_position itself would want to be animated.

I don't really export FBX animations as part of any of my workflows, so I'm not familiar with what is expected.


This issue appears to be related to:

Missing rest pose when exporting FBX without meshes isn't related to this.

I don't know anything about how gltf exports animation, so assume everything I say is only relevant to FBX IO. --- Rather than using `bpy.ops.nla.bake()`, FBX IO manually goes through each frame and samples the values at each frame to animation. FBX also exports Shape Key animation and camera focus distance/length animation which `bpy.ops.nla.bake()` does not support. `bpy.ops.nla.bake()` also does not support sampling at subframes and I'm not sure how exporting the animation of instances could be supported when using `bpy.ops.nla.bake()`. So I can't imagine this changing from manually going through each frame any time soon. --- My concern with temporarily changing armatures from `Rest Position` to `Pose Position` when exporting is if there are cases where users would want some armatures to remain in `Rest Position` or if there are any cases where `Armature.pose_position` itself would want to be animated. I don't really export FBX animations as part of any of my workflows, so I'm not familiar with what is expected. --- > This issue appears to be related to: Missing rest pose when exporting FBX without meshes isn't related to this.
Member

Rather than using bpy.ops.nla.bake(), FBX IO manually goes through each frame and samples the values at each frame to animation.

glTF Export works the same way.

glTF export try to export what can be seen in viewport, as close as possible. So, if user set Armature to Rest pose, the armature is not animated in viewport, so it seems ok for me that it won't be animated in export neither.

> Rather than using bpy.ops.nla.bake(), FBX IO manually goes through each frame and samples the values at each frame to animation. glTF Export works the same way. glTF export try to export what can be seen in viewport, as close as possible. So, if user set Armature to Rest pose, the armature is not animated in viewport, so it seems ok for me that it won't be animated in export neither.

Seems like this behavior needs discussion and isn't necessarily considered a bug.

This makes the issue reported here to be a request for modified/improved behavior instead of a bug in current behavior.
So closing as this bug tracker is only for bugs and errors.

For user requests and feedback, we have other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests

Once discussed, this report can be reopened.

(Se also: https://wiki.blender.org/wiki/Reference/Not_a_bug)

Seems like this behavior needs discussion and isn't necessarily considered a bug. This makes the issue reported here to be a request for modified/improved behavior instead of a bug in current behavior. So closing as this bug tracker is only for bugs and errors. For user requests and feedback, we have other channels: https://wiki.blender.org/wiki/Communication/Contact#User_Feedback_and_Requests Once discussed, this report can be reopened. (Se also: https://wiki.blender.org/wiki/Reference/Not_a_bug)
Blender Bot added
Status
Archived
and removed
Status
Confirmed
labels 2023-10-25 15:09:40 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
4 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#104974
No description provided.