FBX export scale is incorrect when animations are included #41605
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#41605
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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
Windows 8.1 Pro, GTX 780
Blender Version
Broken: 2.71
Worked: No version worked as far as I know.
The FBX exporter provides a scale function, to accommodate software which uses different units. For example, when exporting to Unreal, it is normally necessary to scale up by 100, to convert metres to centimetres.
This scaling doesn't work properly if animations are included in the FBX file. Objects tend to end up unscaled, so extremely small in most software packages.
To reproduce:
Load the attached .blend file. fbx_export_bug.blend
Export FBX with the following settings:
Load the FBX into the Autodesk FBX converter/viewer. No object is visible because it is 100x too small.
Import the FBX into Unreal as a skeletal mesh. The mesh is visible but 100x too small. (If you find it difficult to see, it may help if you set the skeletal mesh editor to wireframe.)
Export the FBX again without animations, using these settings:
Import the FBX into Unreal as a static mesh. Notice that the scale is now correct.
I hope this makes sense, please ask if you need any more information. And thanks for all your work on Blender!
Changed status to: 'Open'
Added subscriber: @PeteX-2
blender/blender#44045 was marked as duplicate of this issue
#44424 was marked as duplicate of this issue
Added subscriber: @Sergey
Could you please check and confirm whether the issue still exists with fresh Blender 2.72?
There is no improvement with 2.72 I'm afraid.
Changed once more time handling of scale… :/ Can you please try (tomorrow) with this night's builds from our buildbot?
Still no joy I'm afraid. I wasn't sure which build you wanted me to try with. The Official build still showed the bug. The Testbuild Branch build crashed when I tried to do an FBX export, giving the following error:
I'm not sure if this is new or if I just never noticed it before, but the mesh seems to get exported at the correct scale. The problem is that, in the animation, the bones are at the original scale. This seems to cause the mesh to revert to the original scale when you run an animation.
In the Autodesk viewer, you can't really see this, because it always runs the animation. In Unreal, you may be able to see this. If you open the Skeletal Mesh object, you will see it at the correct scale. If you then switch to the Animation panel and preview the animation, the scale will suddenly change to 100x too small.
Yeah, was referring to test builds. That bug I fixed one or two days ago (only lived ~24 hours, guess it was just bad timing ;) ).
Will check again that scaling mess with armatures, then :/
Added subscriber: @S_Wilke
Hi there,
I just wanted to post strange scalation-errors in blender since the experimental merge but found this ticket, so im posting my tests here (please note it was tested with the nightly build 2.72-f7957e2 )
I used my old blend-file from #42110 as a starting point (set to metric 0.01):
Blend: Mesh-RotationErrorAnim.blend
FBX: Export_Scale_OldScale.fbx
With this, now the mesh in UE4 comes out as a giant:
but the animation is "correctly" scaled, while now hovering above the ground:
From the same view as above:
zoomed in, revealing it is still same sized and now flying:
So the next thing i tried was to scale the mesh down to 1/100 of its size and changed the metric scale in blender from 0.01 to 1.000 (file: Mesh-RotationErrorAnim_Scaled.blend )
Export_Scale_NewScale.fbx
Now the results are funny, because now the mesh and the animation are super tiny but the same size:
Mesh:
Animation:
So i think that the export for the mesh-size and the animation-size are somehow differently hooked. So now i took the original file (the upper one, not scalled) and only changed the metric scale of blender from 0.01 to 1.00 and now the resulted FBX has the correct size:
So from my point of view it looks like the exporter takes the mesh, devides it by the scale (170 units / 0.01 = 17000 unit mesh) and then the animation size is multiplicated by the scale, resulting in its original size.
I also took the file and changed the metric to 2.0, now the base mesh is half the size but the animation is, again, correctly scaled only this time not flying but clipping through the floor which the preview player automaticly tries to correct (so its not really visible in the screenshot but you can see it in the browser window of unreal engine i added):
Mesh:
Anim:
Browser:
Added subscriber: @DanielCoy
running into the same issue
I have a model imported from make human and shows up at 1.67 meters
I have units set to metric and scale set 0.01
I am exporting as fbx from blender trunk updated from git yesterday (17th Feb 2015).
On Kubuntu 14.04
I am importing the FBX into Unreal Editor 4 from trunk (17th Feb 2015).
Static models and armatures are coming in correctly scaled, as soon as I apply an animation the whole setup shrinks to 1/100th of it's size. My conclusion is that the animation export is ignoring the global scale setting (or the export scale setting).
adding the scaling factor to fbx_animations_do seemed did seem to sort out the scaling issue but I am left with another issue I am not sure how to deal with.
From what I can tell the vertices are being bound to the bones about 100 times closer than they should be
It seems something else needs to be scaled but not sure what.
example of secondary issue
sorry actual link to screenshot of issue
Added subscriber: @DBAGibbz
I have noticed that the "Forward" and "Up" settings also do not work with the armature, only the mesh, so the animations are coming in facing the wrong direction...
Ok, ive included some test file for this issue, and im happy to help out with 3ds max files etc if need be.
First this bug is for the scale issue, so ive done a sample file.
In the zip i have some files:
TestFile.blend
TestFile.fbx
TestPreScaled.blend
TestPreScaled.fbx
scale difference.jpeg
This shows the different files in unreal engine 4. The thumbnail shows the scale difference. The one on the right is the correct scale which is the pre scaled file. The one on the left is the testfile, clearly showing the scale setting not working.
Best to test in unreal engine 4(which is free), as ive found some of the fbx viewers you cant tell scale...
FBXScale.zip
Ok, ive done some more experimenting with 3ds max. Ive put together the same scene in 3ds max to see if it will help you.
So this all works great in ue4. But ive noticed with the blender files, when viewing them in the free autodesk fbx viewer that the scale of the blender versions are much bigger. But in unreal one matches, and one is to small (as per the bug).
Ill include another file, which has a 3ds max version
FBXScale.zip
Ok ive also just noticed a difference in the behavior between the way 3ds max imports fbx and blender if its any help:
blender imports the object, then applies what looks like the scale value from the exporter to each object.
when 3ds max imports the object, it has only the default scale applied
so re-importing the exported object comes back in the right size
the max importer gives these statistics:
File Name: MaxDirections.FBX
File Directory: C:\Users\Bronson\Desktop\FBXScale
File Version: 7.4.0
File Creator: FBX SDK/FBX Plugins version 2015.0
File Custom Writer: No
File Creation Time: 2015/3/19 12:13:15
File Axis Direction: Z-up
File Units: Centimeters
System Axis Direction: Z-up
System Units: Inches
System frame rate: 30.0
File frame rate: 30.0
File content: 4 Elements
And for the blender version:
File Name: Directions.fbx
File Directory: C:\Users\Bronson\Desktop\FBXScale
File Version: 7.4.0
File Creator: Blender (stable FBX IO) - 2.74 (sub 0)
File Custom Writer: No
File Creation Time: 2015/3/19 12:7:36
File Axis Direction: Z-up
File Units: Meters
System Axis Direction: Z-up
System Units: Inches
System frame rate: 30.0 Warning: Frame rates do not match
File frame rate: 24.0
File content: 4 Elements
So i think its realizing what units the fbx format is in and adjusting it to the scene.
So exposing a way to set what units we are working in may also be useful (unreal engine is in cm)...
Added subscriber: @72u34h23d8f
Added subscriber: @Cancer-2
I wanted to leave a note for the Developers on this subject.
Currently, it doesn't seem as if Blender's .FBX Importer and Exporters are following the individual version standards of the .FBX format.
Basically, the FBX format changes with each iteration. It isn't just bug fixes and new features tacked on, the format itself is different from release to release. For example, Unreal Engine 4 specifically is using the 2014.2.1 version of the .FBX standard. In many other 3D Packages, there is an option inside of the .fbx importers and exporters to select which version of the standard you want to use to handle the file.
UE4's official Documentation specifically states "The UE4 FBX import pipeline uses FBX 2014. Using a different version during export may result in incompatibilities." And I read a comment on their forums from their devs that specifically mentioned it's the 2014.2.1 release, though feel free to triple check that.
This is important because in the future if changes are made to make Blender's .FBX format more compatible with the newest .FBX 2015+, etc., you will possibly break some compatibility with 2014 .FBX files which is it's own separate standard, albeit I'm sure very similar. Aka, fixing something for Unreal 4 users might break something for Unity users, etc..
I think once this distinction between .FBX versions is part of the options of Blender's importers/exporters, that a version/preset that properly targets 2014.2.1 successfully will resolve most of the issues UE4 users are having.
Blender to (and from) UE4 is far from perfect at this moment, but I've found a myriad of work-arounds and tricks to get most things working well enough for now so I am happy, but I hope the concern, time, availability and funding is there to continue on this. Please let me know if there is anything at all that I can do. I will be making a donation to the foundation shortly, thank you for the great work, this is all very amazing, even as is, ty.
Added subscriber: @rimau
@Cancer-2 this is BS from UE4, FBX format did not (really) change that much since 7.3 at least (FBX 2013), afaik. And anyway, they are using official SDK, which key feature is to be able to read/convert any FBX version…
Aside from that, @rimau found a very nice piece of info in #41719:
I could confirm that, and this behavior makes absolutely no sense to me… Would be nice though if you could check your problematic files and see whether, ensuring all your bones are slightly rotated compared to rest pose (even 0.1° is enough), issue get 'fixed' with UE4?
Hey guys, I forced a new build on our buildbot, which shall have the fix for #41719, please check your problematic files and report here the results (dreaming that it solves everything would be insane, but since FBX itself is insane…).
This still isn't working, I'm afraid, but the behaviour is slightly different. I have a hierarchy where the armature is the parent of the mesh (obviously). I start with a situation where the armature has a scale of 0.01 and that makes it the normal size for Blender. If I export this as FBX with scale 100, everything works.
If I apply the scale on the armature, and do the same export, Unreal ends up with a very small mesh that appears to be floating a long way above the ground. If I play an animation, the mesh is thrown around all over the place, perhaps because the scale of the animation would be correct if the mesh were the correct size.
Applying the scale on the mesh doesn't change anything.
Added subscriber: @mont29
It's all good Mont. The exporter as is has me 95+% of the way there after learning some tricks and quirks and it's getting better every day, it gets me where I need to go in the end. Just for leanings sake, I might try to compile the official .FBX SDK as a separate plug-in for Blender in the next few months. (I'm sure it's a lot harder than it sounds, and it sounds difficult, but I think I'd learn a ton) Either way, I wait patiently for your regular updates to the fully FOSS version of .FBX compatibility, I can't thank you enough. Cheers good sir.
Here's a sample of the same problem originally posted as a bug here, it's still an active issue. Tried using the newest official release as well as the most recent nightly build as of this posting.
(The only solution, that I can find, is to re-build the scene completely from scratch and at the correct scale from the beginning - that means I can export FBX setting scale 1, then there are no problems) Trying to export items that have a non-1 scale value in blender, AND / OR using the FBX exporters scale functionality, lead to the same/similar problems > the Item looks fine when first imported to UE4 and put into a level so long as animation isn't playing, but once you try to play it's accompanying animation, it is scaled HUGE.
Again, I stress, that the only solution I can currently find, is to re-build the scene from scratch, and I mean, from scratch, as trying to scale up in Blender, and using apply transforms function in advance (on the armature and object and animations), just leads to other seemingly un-workable problems.... So, make sure the object is scale 1 in blender, and the armature is scale 1 in blender BEFORE rigging/animation, because apply transform techniques on the armature and or object after rigging/animating lead to other problems upon export (for me).
(again the current work-around is to not work in blender at scales that are not 1, and do not use the exporters scale funcationality, as both lead to problems) of coarse, these limitations, further bottleneck the already extremely rigid pipe-line between UE4 and Blender. Do not use, apply transform on armatures/bones, instead build them at the correct scale, before export, and set the exporter scale at 1:1 (do your measurements 1st or face re-doing all of your rigging/animation work in the current state of things)
sorry to repeat myself 50x but the post is very confusing if I don't
this file was built to be exported at FBX 100 scale. it doesn't work. I also have no luck scaling up the object/armature to 100 in blender and applying transforms and exporting at FBX 1 scale. You can try both and see if there is a fix.
REDO.blend
Please load that into Blender, export it as .FBX (setting scale 100), load it into Unreal, drop the object in the level (it's tiny scrap of paper that would fit into a characters hand, but that is the desired size), with the object still selected, open the level blueprint, right click the graph, create a link to the selected object from the menu, add/link a play animation node, select the imported animation, link that node up to event begin play and set the animation to loop if you like. Compile and play test the level, and you will see that a very small object has become 100 to 1000x it's original size when animation is attached and playing.
I'm beginning to think, that because UE4's source code is open to modify/add to, that it might be more effective to write a plug-in for UE4 that allows importing/exporting .blend files or something along those lines.
Added subscriber: @ucupumar
Added subscribers: @Rays-Lv, @JoshuaLeung
Those are the same issues actually…
I spent whole day using file from #44424 (FBX_scale_bug.blend and maya_scale_10.fbx). With latest code Blender's FBX export (nearly) the same thing as maya, and yet, that scaling bug remain… makes no sense, as usual…
Can someone confirm me that this bug does not happen with Unity? Or does it?
Also, this example file remain rather heavy to investigate, could someone make similar one, but with only a cube and a single bone? I need the .blend file, and its equivalent exported from latest Maya (or Max), with some FBX export scaling…
I can see why you need that file, but unfortunately I don't have access to Maya or Max so I can't make it for you. Is there anyone here who has access to one of those products in addition to Blender?
My file above (found here https://developer.blender.org/F152978)
Should have everything you need, a simple case.
If theres anything else specific you need changed, let me know.
Cheers
This issue was referenced by
f30fc86ab5
Changed status from 'Open' to: 'Resolved'
Added subscriber: @SiTmOsNoED
I have the same thing happen in my project. It only happens after I cycles render materials. Prior to that my fbx is made just fine.
Here is error: Traceback (most recent call last):
IndexError: list index out of range
location: :-1
I was using Cycles render to texture because I'm new and can't figure out how under blender render to get my textures to show up(no matter how many times I unwrap or what view I'm in). Prob cause I'm new to this. I thought at first it would be because my array wasn't applied but no I found this error only occurred when exporting fbx AFTER I had cycle rendered materials.
@SiTmOsNoED this sounds like totally different issue, please make new report (with file and steps to reproduce the bug).