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

Different scale for skeletal meshes (armatures) and static meshes #100

Open
joric opened this issue Nov 12, 2024 · 7 comments
Open

Different scale for skeletal meshes (armatures) and static meshes #100

joric opened this issue Nov 12, 2024 · 7 comments
Assignees
Labels

Comments

@joric
Copy link

joric commented Nov 12, 2024

Basically every export that has both static meshes and skeletal (parented to armature) meshes ends up with different scale for meshes. Skeletal meshes are always 100x smaller. I guess it's somewhere around SCALE_FACTOR = 100 and armature handling code. Inconsistent scaling is inconvenient if you have many meshes in a single file and also affects physical models and vehicles.

How to reproduce:

  1. Create 2 default cubes (2x2x2m), drag them to Export collection.
  2. Push assets to UE (do not change any settings). Both cubes are 200x200x200 cm.
  3. Create empty armature, drag it to collection, parent any cube to the armature.
  4. Push assets to UE, skeletal mesh cube is 2x2x2, static mesh cube is 200x200x200.

Blender 4.2, Blender Tools 2.5.

Upd. It's not an easy fix, e.g. deleting this line fixes the cubes above but breaks nested hierarchy scale (e.g. wheelcaps).

         # Todo add to FBX addon
         if ob_obj.type == 'ARMATURE':
-            scale = Vector((scale[0] / SCALE_FACTOR, scale[1] / SCALE_FACTOR, scale[2] / SCALE_FACTOR))
             if bpy.context.scene.send2ue.use_object_origin:
                 loc = Vector((0, 0, 0))

A better file to test the hierarchy/armatures/size:

The easiest way to handle that without fixing the plugin code is to parent armatures to "empty" with scale 100, and check the "Apply Transform" option. I also use "Extensions - Combine assets - Child meshes" plugin setting to get wheels as bones for the car simulation.

Note the generated convex hull on the second picture is 100x smaller than the mesh. This also affects ragdolls because bones are not scaled properly. "Apply Transform" fixes convex hulls and other physics (except nested meshes).

With "Apply Transform" Without "Apply Transform"
image image

The only way to reliably keep hierarchy and get proper size is to rescale all skeletal meshes 100x in Blender before exporting. Also I had to rotate the mesh in Blender because it faces the wrong way, changing export axes to X Forward, Z Up doesn't work too. I also had to merge wheels and wheelcaps meshes because wheelcaps shrink (hierarchical scale doesn't seem to work).

@joric joric added the bug Something isn't working label Nov 12, 2024
@DanMcLaughlin
Copy link

Yeah I’ve noticed that too, but haven’t dug into it and pinned it on Send2UE. I separately apply transforms to the mesh, and there’s a different option to apply skeleton transforms.

I use CGDives Game Rig Tools and have halfway suspected that’s the culprit too btw.

@JoshQuake
Copy link
Collaborator

Hey guys apologies for delay in response, I've been stupid sick the past week. I will take a look at what's going on on Monday.

@JoshQuake JoshQuake self-assigned this Nov 16, 2024
@MalikuMane
Copy link

This seems to be an issue with the import in UE 5.5. I can still export to 5.4 just fine. It breaks if i reimport in 5.5 without send2ue as well.

@joric
Copy link
Author

joric commented Nov 25, 2024

I don't have 5.4. Yea I've noticed 5.5 is a little different, Also there's an issue with bone naming. In 5.4 I imported bone names with spaces and it replaced them with dashes, now 5.5 replaces spaces with underscores (e.g. Bip01-Head is Bip01_Head now) and new Mixamo animations no longer work. I'd have to reimport all models and animations, bone renaming doesn't help.

@MalikuMane
Copy link

So I disabled the Interchange Framework plugin and it seems to have fixed that scale issue. I diddn't check the issues with the bone naming though.

@joric
Copy link
Author

joric commented Nov 25, 2024

Disabling the "Interchange Framework" plugin does NOT fix the initial 2 cubes issue for me. I have static meshes and animations in the same blender file and animations are still 100x smaller than static meshes.

It, however, fixes the bones naming and export axes. With the Interchange Framework plugin enabled it didn't even add any animations listed in NLA tracks and collapsed the skeleton. I'm still not getting working animations in 5.5 though.

Upd. They write about Interchange Framework here and claim that it will be fixed in 5.5.2.

@MalikuMane
Copy link

Yeah for now it looks like the best option is stick to UE 5.4 or do imports in a seperate 5.4 project and migrate them until there is an actual fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants