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

UE to Rigify - Incorrect rig setup leads to importing issues in UE5 #23

Open
Alfier opened this issue Jun 24, 2024 · 13 comments
Open

UE to Rigify - Incorrect rig setup leads to importing issues in UE5 #23

Alfier opened this issue Jun 24, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@Alfier
Copy link

Alfier commented Jun 24, 2024

Addon: UE to Rigify

Steps to Reproduce the Problem: import UE5 male mannequin FBX skeletal mesh, select root source from 3D view, use "Male Mannequin Ue5" template, click convert. Try to export the result in Unreal Engine.
Error Log: no error logs
OS: Windows 10
Addon Version: UE2Rigify 1.6.4
Blender Version: Blender 3.6 / 4.1
Unreal Version: Unreal 5.4.2

The default mannequin templates are straight up incompatible with Unreal Engine.
Trying to import in UE the pic's first setup results in error "Multiple roots are found in the bone hierarchy. We only support single root bone." since the root bone is not correctly exported from the Unreal Engine skeletal mesh and, therefore, all the bones under it are placed at the same level. The import completely fails this way.

This issue could be solved adding a new root bone and reparenting everything else to it, like in the pic's second setup.
This way, though, the rig doesn't match the mannequin template, since it consider the "pelvis" bone as the root, unlike Unreal's mannequin that has the root bone set to the... root bone. Therefore the UE to Rigify conversion fails. No log error is shown, the convert button simply does nothing.

Unfortunately blender imports the root bone as the armature root, that is not an actual bone from its point of view, leading to this chain of issues.

UE2Rigify_IncorrectSetup

@Alfier Alfier added the bug Something isn't working label Jun 24, 2024
@jack-yao91
Copy link

@Alfier
Copy link
Author

Alfier commented Jun 24, 2024

Have you tried with this option on and off? https://poly-hammer.github.io/BlenderTools/send-to-unreal/settings/export/#export-object-name-as-root-bone

Yep, it's checked by default but either way, on or off, exporting to unreal still returns that error

@JoshQuake
Copy link
Collaborator

JoshQuake commented Jun 24, 2024

Is this with the use of Send2UE to export to unreal? Based on previous comments, yes.

I cant replicate this issue 🤔. However I did run into a different issue on Blender's side when trying to send assets while in ue2rigify's Control mode. I'll create a different issue to track that though.

@Alfier
Copy link
Author

Alfier commented Jun 25, 2024

Yes, I used Send2UE during this test. Obviously the same result happens when I just export the skeletal mesh as a .fbx file and import it manually in the project, since this way there's no way to tell the exporter that the root must be a bone.

@Alfier
Copy link
Author

Alfier commented Jun 25, 2024

Also, trying to bake a simple animation to the source rig and then exporting with Send2UE, this error is returned along with the usual error log in UE

Python: Traceback (most recent call last):
  File "F:\script_addon_cust\addons\send2ue\dependencies\rpc\factory.py", line 221, in run_function_remotely
    return remote_function(*args)
  File "C:\Blender Foundation\Blender 3.6\3.6\python\lib\xmlrpc\client.py", line 1122, in __call__
    return self.__send(self.__name, args)
  File "C:\Blender Foundation\Blender 3.6\3.6\python\lib\xmlrpc\client.py", line 1464, in __request
    response = self.__transport.request(
  File "C:\Blender Foundation\Blender 3.6\3.6\python\lib\xmlrpc\client.py", line 1166, in request
    return self.single_request(host, handler, request_body, verbose)
  File "C:\Blender Foundation\Blender 3.6\3.6\python\lib\xmlrpc\client.py", line 1182, in single_request
    return self.parse_response(resp)
  File "C:\Blender Foundation\Blender 3.6\3.6\python\lib\xmlrpc\client.py", line 1354, in parse_response
    return u.close()
  File "F:\script_addon_cust\addons\send2ue\dependencies\rpc\client.py", line 63, in close
    raise exception(exception_message)
RuntimeError: The /Game/untitled_category/untitled_asset/SKM_Manny_LOD0_Skeleton does not exist in the project!

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "F:\script_addon_cust\addons\send2ue\operators.py", line 71, in modal
    raise error
  File "F:\script_addon_cust\addons\send2ue\operators.py", line 61, in modal
    function(*args, **kwargs)
  File "F:\script_addon_cust\addons\send2ue\core\ingest.py", line 26, in import_asset
    UnrealRemoteCalls.import_asset(file_path, asset_data, property_data)
  File "F:\script_addon_cust\addons\send2ue\dependencies\rpc\factory.py", line 248, in wrapper
    return rpc_factory.run_function_remotely(function, args)
  File "F:\script_addon_cust\addons\send2ue\dependencies\rpc\factory.py", line 226, in run_function_remotely
    raise exception.__class__(stack_trace).with_traceback(call_traceback)
  File "F:\script_addon_cust\addons\send2ue\core\ingest.py", line 26, in import_asset
    UnrealRemoteCalls.import_asset(file_path, asset_data, property_data)
RuntimeError: The /Game/untitled_category/untitled_asset/SKM_Manny_LOD0_Skeleton does not exist in the project!  File "F:\script_addon_cust\addons\send2ue\dependencies\unreal.py", line 1244

MultipleRoots

@JoshQuake
Copy link
Collaborator

I'm installing 5.4 and seeing if for some reason something changed with the mannequins because I'm unable to replicate this with a default 5.2 ue5 manny. I will update when I have time to take a look.

@JoshQuake
Copy link
Collaborator

Can you please send the blend file and your send2UE settings? You can save a template and upload here.

I've reconfirmed no issue with unreal 5.4 mannequin and resolved #24 to export while in Control mode and still no issue.

image

@Alfier
Copy link
Author

Alfier commented Jun 25, 2024

You can find both files here.
However the template is the default one, minus the "Check scene scale" checkbox.

@JoshQuake
Copy link
Collaborator

I still didn't get those errors lol, but there is definitely something wrong with your mannequin.
image

Issue could be a mismatch in your path settings? I think there probably would've been an error about permissions but maybe permission issue with unreal directory? Also try deleting previous broken assets in unreal before pushing again.

Here's the default ue5.4 mannequin exported from a fresh install
SKM_Manny.zip

and my typical process of sending a ue2rigify rig. I switch back to Source only to avoid a separate issue now fixed for next release #24.

Desktop.2024.06.25.-.13.24.00.03.mp4

@Alfier
Copy link
Author

Alfier commented Jun 26, 2024

The results are the same even with your manny.fbx
I don't think it can't be anything other than a weird Send2UE bug, since if I rearrange the armature hierarchy this way
UE2Rigify_CorrectSetup
the export succeed (even if the mesh is broken as in your pic).

Edit: just tried again with 4.1, since 3.6 is my working environment I mostly use this, and the export now works, so it's most likely something in 3.6 that goes wrong.

I still get these errors though
Immagine 2024-06-26 093834
Immagine 2024-06-26 093848

This is the console log in 3.6, when the export fails

FBX export starting... 'C:\\Users\\RedDot\\AppData\\Local\\Temp\\blender\\send2ue\\data\\SkeletalMesh\\SKM_Manny_LOD0.fbx'
(bpy.data.armatures['root'], 'POSE')
export finished in 0.4531 sec.

while this is the same in both 3.6 with fixed bones hierarchy and 4.1, when the export succeed


FBX export starting... 'C:\\Users\\RedDot\\AppData\\Local\\Temp\\blender\\send2ue\\data\\SkeletalMesh\\SKM_Manny_LOD0.fbx'
(bpy.data.armatures['root'], 'POSE')
export finished in 0.3906 sec.
Warning: add-on missing 'bl_info', this can cause poor performance!: 'F:\\script_addon_cust\\addons\\sumArea.py'

FBX export starting... 'C:\\Users\\RedDot\\AppData\\Local\\Temp\\blender\\send2ue\\data\\SkeletalMesh\\SKM_Manny_LOD0.fbx'
(bpy.data.armatures['root'], 'POSE')
export finished in 0.3906 sec.
Fetch rig.
Clear rig animation data.
Create widgets collection: 0.002
Duplicate rig: 0.007
Instantiate rigs: 0.001
Initialize rigs: 0.000
Prepare bones: 0.001
Generate bones: 0.018
Parent bones: 0.011
Configure bones: 0.011
Preapply bones: 0.004
Apply bones: 0.001
Rig bones: 0.019
Generate widgets: 0.019
Assign layers: 0.020
Finalize: 0.030
The rest: 0.021
Info: Successfully generated: "rig"
constraining
root
rig
Warning: add-on missing 'bl_info', this can cause poor performance!: 'F:\\script_addon_cust\\addons\\sumArea.py'

FBX export starting... 'C:\\Users\\RedDot\\AppData\\Local\\Temp\\blender\\send2ue\\data\\SkeletalMesh\\SKM_Manny_LOD0.fbx'
(bpy.data.armatures['root'], 'POSE')
export finished in 0.3906 sec.
Warning: add-on missing 'bl_info', this can cause poor performance!: 'F:\\script_addon_cust\\addons\\sumArea.py'

FBX export starting... 'C:\\Users\\RedDot\\AppData\\Local\\Temp\\blender\\send2ue\\data\\AnimSequence\\Action.fbx'
export finished in 0.1562 sec.

@Alfier
Copy link
Author

Alfier commented Jun 26, 2024

Seems that the weird deformed skeletal mesh happens due to the blender units.
Usually I set metric 0.01 unit scale working with unreal. When I switched to the following settings the exported mesh was fine
Units
Immagine 2024-06-26 185014

I can't understand why though. And unfortunately I can't fully work with Blender 4.1 due to various not compatible addons

@JoshQuake
Copy link
Collaborator

Thanks for the updated info. I shall keep looking for possible causes.

@jack-yao91
Copy link

Kinda wierd this happened. At least with default settings, there is a validation that runs to check that your scene scale is set to 1.
https://poly-hammer.github.io/BlenderTools/send2ue/settings/validations/#check-scene-scale

Unless that validation was turned off, it shouldve given a error pop up. @JoshQuake @Alfier looks like scene scale 1 is the resolution, can this be closed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants