poly-hammer / BlenderTools

Blender addons that improve the game development workflow between Blender and Unreal.
https://poly-hammer.github.io/BlenderTools/
MIT License
187 stars 13 forks source link

Send to Unreal wrong scaling. #48

Closed AndrewAlexArt closed 2 months ago

AndrewAlexArt commented 2 months ago

When send assets to disk and then import them to UE assets has a wrong scale, looks like x100 of original size. Changing pugin export settings not change the scale at all.

Regular Blender export with the same settings don't have such problem and export perfectly.

On this screenshot two models with the same export setting one exported manually and second exported with the plugin: 23

EDIT2: When import asset to Unity it has the same wrong scale (x100) 24

EDIT3: Looks like I found the bug. If UseObjectOrigin is active the scale goes x100 Yep, tested on the fresh project. Very strange place for a bug... Funny thing: even if UseObjectOrigin is not active, objects still use their origin.

JoshQuake commented 2 months ago

Thanks for the report! Can you please attach your blend for me? My testing results in no issues.

EDIT: The issue could be your Apply Scalings setting. These are the defaults: image

If I export with the same setting you have, the object imports to Unreal as really small.

Cube2 is the correct sizing from default settings. 2m in blender units = 200 in unreal units. If you use the FBX scaling option, it will improperly import as 2 unreal units. image

AndrewAlexArt commented 2 months ago

To have the correct scale in Unity, you need to check the Experimental!ApplyTransform option. However, if the UseObjectOrigin option is active, the scale becomes incorrect again in UE and Unity.

Here is an example of the same mesh with these settings with UseObjectOrigin ENABLED: image image image image

And UseObjectOrigin DISABLED: In UE and Unity the scale became normal. image

image image _Small notice to picture above: if UseObjectOrigin disabled, the origin in Unity not the same as in UE. But it might be Unity feature to always use origin of the object

So I don't know how the plugin works under the hood but UseObjectOrigin option influences on scale of the object

Blender scene file: ScaleTestScene.zip

JoshQuake commented 2 months ago

Thank you, this should resolve the issue. Not sure why I saw no difference in scale on my first test. The mesh shifted tho. Odd. Anyway, I tested again and you were right.

I will put together a PR for a new release tomorrow as there has been a decent amount of fixes.

AndrewAlexArt commented 2 months ago

Thank you for supporting this amazing addon!