Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crushed skeletal mesh on import #110

Open
CoreyHUN opened this issue Dec 17, 2024 · 14 comments
Open

Crushed skeletal mesh on import #110

CoreyHUN opened this issue Dec 17, 2024 · 14 comments
Labels
question Further information is requested UE 5.5-5.5.1 Issue - Awaiting Fix

Comments

@CoreyHUN
Copy link

Hi!

I ran into a problem with importing skeletal meshes to unreal. Upon import, all the skeletal meshes are crushed/distorted for some reason.

For representation, I just exported the default UEFN mannequin to blender.

image

When trying to import it back unreal with Pipeline/Export/Push the result is this

image

Any idea on this?

I'm using:
Blender 4.3.2
Unreal 5.5.1
send2ue 2.6.1

@CoreyHUN CoreyHUN added the question Further information is requested label Dec 17, 2024
@JoshQuake
Copy link
Collaborator

Hey there. Make sure you apply scale to the skeleton after importing to blender. Also it appears there's an issue with UE5.5's interchange that could also possibly be messing some things up. I hear 5.5.2 should fix the interchange issues.

@CoreyHUN
Copy link
Author

Hey Josh, yeah I applied the transforms, its gotta be the interchange then, guess I have to wait till .2, thanks!

@JoshQuake
Copy link
Collaborator

JoshQuake commented Dec 17, 2024

I can also take a quick look to see if the UEFN skele is different from manny. Can you please share the original UEFN character? I dont wanna install to get a copy heh.

@CoreyHUN
Copy link
Author

Hey, no worries, here is the UEFN exported, this is the one I tested with.

https://drive.google.com/file/d/1oiZAtWxsKHGtwtYL0UZ8NOhy0LKPgcHx/view?usp=drive_link

@JoshQuake
Copy link
Collaborator

thank you!

@JoshQuake
Copy link
Collaborator

JoshQuake commented Dec 18, 2024

Yup it's all good in 5.3 without doing anything. So this is almost definitely the interchange issue. Should work in 5.5.2 🤞

@CoreyHUN
Copy link
Author

Great! Thank you for checking!

@liuk997
Copy link

liuk997 commented Dec 27, 2024

I’ve also encountered the same problem and discovered that in my case it was due to the scene scale.
In Blender, I have the Unit Scale set to 0.01, and when I export with send2ue, the animations work fine, but the skeletal mesh appears collapsed, as described in the post.
I tried disabling the Apply Unit option and directly setting the Scale to 0.01, but it didn’t work.
However, if I disable the Apply Unit option and set the scale to 0.02, everything works fine (aside from the fact that the scale is, of course, not the desired one).
0.01 seems to be the threshold where this issue occurs.

I also tried exporting the model directly from Blender in FBX format, setting the scale to 0.01 in Blender's export dialog. In Unreal, the import works with the correct scale and without the collapsed mesh.
I also tried with other meshes, and the problem occurs as well.

I'm using:

Blender 4.4
Unreal 5.3.2
send2ue 2.6.1

@DanMcLaughlin
Copy link

I found its from applying scale. If you have a mesh parented to a skeleton and Apply Scale to the mesh, or Apply Armature Scale to the rig, Blender will go mess with the other part to maintain the same relative scale - this is what I think is happening at least. What I do is apply the armature scale first, then mesh scale, then double check that both have scale of 1,1,1

@liuk997
Copy link

liuk997 commented Dec 28, 2024

I tried several times to apply the scale to both the armature and the mesh, but nothing worked. Both are correctly set to 1 during the export phase. As I mentioned before, if I set the export scale to 0.02 or higher, everything works fine.
The problem occurs when I use an export scale of 0.01 (only with send2ue export; if I use Blender's classic export to then import the FBX, everything works).
Could it be caused by numerical precision? Some error propagating during the export that causes a mismatch in the scale of the mesh and the armature? I’m not sure.

@JoshQuake
Copy link
Collaborator

May I ask why you're changing the export scale at all?

As long as scene scale is correct (metric, 1.0 unit scale) and your objects scales are at 1, then you should get accurate scale in unreal.

@liuk997
Copy link

liuk997 commented Dec 29, 2024

I created the mesh and animations using Rigify with a larger scale for the meshes, so when I import them into Unreal, they are too big. I should rescale the animations, but every time I try, something breaks. However, scaling the entire scene during export works, except that the mesh collapses.
If it helps, I did some testing today and found out that by changing the Forward and Up settings in the export dialog under the Transform section, the issue doesn’t occur (though, of course, the mesh appears rotated in Unreal).

@jack-yao91
Copy link

Have you tried re-importing the animations from an FBX via the Import Asset operator? Its basically an FBX import plus the scale corrections to Skeletons and animations that comes from unreal.

Here is the call it uses to scale the actions

scale_object_actions(bpy.context.selected_objects, imported_actions, 1)

Could probably fix them in your scene with this; provided the right armature object is selected and the action name is changed.

from send2ue.core.utilities import scale_object_actions
scale_object_actions(
    bpy.context.selected_objects, 
    [bpy.data.actions['MyActionNameHere']], 
   1.0
)

Haven't tested that code, but I think that would work to re-scale your actions (maybe play with the last number 1.0)

@JoshQuake
Copy link
Collaborator

I created the mesh and animations using Rigify with a larger scale for the meshes, so when I import them into Unreal, they are too big. I should rescale the animations, but every time I try, something breaks. However, scaling the entire scene during export works, except that the mesh collapses. If it helps, I did some testing today and found out that by changing the Forward and Up settings in the export dialog under the Transform section, the issue doesn’t occur (though, of course, the mesh appears rotated in Unreal).

Something else to consider for ya; Blender's bone system uses different axis from Unreal, which is why the skeleton "fixes" when you change the forward/up axis. UE2Rigify was made to solve this issue to give you a Rigify rig that will bake animations correctly for UE.

It might be worth baking your animations to your skeleton, throw away your manual Rigify rig, and create a new template for your characters with UE2Rigify. You are then able to bake your animations back to the new rig automatically to continue modifying your animations with the new rig.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested UE 5.5-5.5.1 Issue - Awaiting Fix
Projects
None yet
Development

No branches or pull requests

5 participants