FBX: exported mesh/animation does not work properly in UE4 when exported using 1 metric unit scene scale #51704
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
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
10 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#51704
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Win8, GTX1070
Blender Version
Broken: e92f235283 along with newer (May 29) builds
Short description of error
This is the only thing I know of that's still an issue in the Blender - UE4 pipeline. The workaround was to set the scene unit scale to metric 0.01, but this causes a lot of issues in other parts of Blender as well as in addons. I think we should attempt to fix this issue once and for all.
I'm using the official UE4 fix for the extra root bone issue, by naming the rig object "armature" the extra bone gets removed on import.
What works (all exports and imports at 1 scale):
0.01 metric unit scene scale, mesh at 1 scale (dimensions about 2 meters) apply unit scale on or off either works (results in normal looking mesh, normal sized animation)
1 metric unit scene scale, rig/mesh scaled up 100 times, applied transforms so 1 scale on both rig and mesh (dimensions about 200 meters) apply unit scale off (results in normal looking mesh, normal sized animation)
What doesn't work:
1 metric unit scene scale, mesh scaled up 100 times, applied transforms so 1 scale (dimensions about 200 meters) apply unit scale on (results in 200m mesh in UE4, normal sized animation)
1 metric unit scene scale, mesh at 1 scale (dimensions about 2 meters) apply unit scale on (results in normal looking mesh, tiny animation)
1 metric unit scene scale, mesh at 1 scale (dimensions about 2 meters) apply unit scale off (results in tiny mesh, tiny animation)
When apply unit scale is on, in all cases but the 0.01 metric mesh, there's a warning on UE4 import saying "Imported bone transform is different from original. Please check Output log to see detail of error."
In the output log there's a bunch of messages saying
for every bone in the rig. When you check the skeleton in UE4 the root bone has 100 scale in XYZ. This means that every other bone inherited this scale, but the scale for the bones were reset to 1 in the animation. This is the reason you get a tiny animation in the case of the 1 metric unit scale 1 normal size mesh export.
With the same mesh/rig but with apply unit scale off you get a tiny mesh and a tiny animation, there's no warning on import and if you check the root it is at 1 scale in XYZ which is what you want. The mesh/skeleton are just too tiny to use, about 2cm.
So there are two options that work, 0.01 metric unit scene scale and a normal looking mesh. The disadvantage of this method is that lots of other parts in Blender (and addons) break when scene unit scale is not 1.
The other option is 1 metric unit scene scale with a character scaled up 100 times, so a huge mesh but it turns out normal in UE4. The disadvantage of this method is that it's just awkward to work with, the whole point of the metric units are that they should make sense to you, but with everything scaled up 100 times it gets very confusing.
I'm hoping this issue can be solved so the Blender - UE4 pipeline gets to a perfect state.
Exact steps for others to reproduce the error
Based on a (as simple as possible) attached .blend file with minimum amount of steps blender1scale.blend a blend with a UE4 tools rig and a simple animation.
In the .blend the scene unit scale is 1 metric.
Export the mesh and rig, only deform bones option ticked. Import into UE4 - this is broken (see above).
Resize the rig and mesh 100 times and apply transforms. Export with only deform bones option ticked and apply unit scale not ticked. Import into UE4 - this should work (see above). Note that the animation will look wrong because of not scaling the animation, but if the animation was redone it would look okay again
Open the original .blend again and change the scene units to metric 0.01 scale and resize the mesh so it looks normal again, then apply transforms. Export with only deform bones option ticked. Import into UE4 - this should work (see above).
Changed status to: 'Open'
Added subscriber: @cyaoeu
#57932 was marked as duplicate of this issue
Added subscriber: @mont29
I would say this is an UE4 issue - for some reason, it wants to convert bones transformations such that scale ends up being unitary - but it cannot do that with animation it seems… Also probably related with #50159.
I think the main issue here is that there’s not two applications handling the 'general scale' settings of FBX the same way. So far I have been storing unit scaling factor as global FBX scaling (which should makes sense, since it allows to detect unit back when importing FBX in Blender)… think I'll add an option to systematically apply all scaling (the one set in FBX exporter and the one from units) directly to object transforms, and set file scaling to always 1.0, and we'll see if that works (together probably with an option to set all scalings in global FBX scaling, and non applied to object transforms). Then people can try the different options and pick the one working for their pipeline.
But really, that scaling issue is a pain :(
Yeah, it may be a UE4 issue for sure. In that case a fix may be made on the UE4 side like before with the extra root bone thing, however this is still a Blender-UE4 specific issue.
I made a forum thread on the UE4 forums as well (feedback section), no idea if the developers will respond but they will at least see the problem. The thread is here: https://forums.unrealengine.com/showthread.php?146940-Animations-from-Blender-using-default-settings-don-t-work-in-UE4-help-fix-the-Blender-FBX-exporter . You may need an account to see it.
It should also be possible to see exactly what's going on in the UE4 .fbx import process because the code is on github. Maybe some clues can be found there. https://github.com/EpicGames/Signup
So, can you please download
be617f7a2c
.tar.gz and replace your current FBX addon directory content by what's in that archive? it's an attempt to rework (yet again :/ ) scaling handling in the exporter, you know have fours choices to apply custom and unit scaling either fully locally, fully as an FBX scale, or mixes of both.Let me know if any of those four options work as you'd expect.
I tested the new version. None of them gave the perfect result of normal looking mesh and normal looking animation. AllLocal and FBXCustomScale gave the result of a scaled mesh but tiny animation. The root bone has 100 scale in the skeleton but 1 scale in the animations. FBXAll and FBXUnitsScale gave the result of a tiny mesh and tiny animation. Basically what you would expect if you exported meters as centimeters, it seems like it wasn't scaled at all.
I did find out some interesting things however.
When importing a 0.01 metric (working) scale mesh into UE4 and in the UE4 import settings selecting 10 import scale, the mesh is 10 times bigger than usual but animations still work. Checking the skeleton, the root bone is scaled 10/10/10. In the animation it's still 10/10/10. This means that scaling the root bone but not any other bones is the UE4 way of scaling a character.
This means that when importing a character with AllLocal or FBXCustomScale the root scaling is 100/100/100, which is what you would expect in UE4 terms. However when you get the error "Imported bone transform is different from original. Please check Output log to see detail of error." from other bones having a scale other than 1 (in these cases all bones have 100 scale at import time), all bones in the animation have their scale reset to 1, including the root bone.
This should mean that if the root bone scale wasn't reset to 1 in the animation the animation would look like you would expect. This seems like a UE4 bug for now.
It seems like the physics asset is created without taking scaling into account which seems like another UE4 bug.
I will report these bugs for now. I think that if you could scale only the root bone and leave the rest of the bones at 1 scale in the FBX export things would work fine.
Added subscriber: @SteffenD
UE4 bug reports are here, you'll need an account to view them though I think:
https://answers.unrealengine.com/questions/617946/skeleton-root-bone-scale-incorrectly-set-to-1-in-a.html
https://answers.unrealengine.com/questions/617954/physics-asset-has-faulty-behavior-after-scaling-sk.html
Committed to master addons as
8b2a241bac
, will keep the report open for a bit in case there’s some news here.Added subscribers: @Dimega, @lichtwerk
The problem with exporting to FBX for UE4 is still observed. I would like to see a bug fix on the release.
Added subscriber: @Max500
Added subscriber: @item412
Added subscriber: @jackdaw
Added subscriber: @drfail