Imprting Skeletal mesh fails to create Skeleton - Python

Importing skeletal mesh (from FBX) into Unreal doesn’t create skeleton. Importing is done strictly through python script.

It is not the issue with fbx, since it was previously working properly and manual import creates the skeleton just fine.

Wondering is there a way to create the skeleton with python after the import just like you would do with right click → asset actions → skeleton → create skeleton?

1 Like

I’m experiencing the same issue. I’m setting import_as_skeletal to True in the script and only the mesh is imported. The skeleton is imported when I use the UI.
Any suggestions for a solution are appreciated.

image
@marianne.gorczyc Have you tried setting automated_import_should_detect_type to false?

My issue got resolved after doing this and i just had to make sure once the skeleton was created to save it properly.

Thank you for your quick reply! Unfortunately, I’m still not seeing the skeleton when I import from my script. Option settings shown below.

Wondering…what did you need to do to save the skeleton properly?

Hi, @marianne.gorczyc have you made sure that your import task is set to be automated?
Like this:
image

And that save = True wasn’t saving my skeleton asset. And that is why i used:
unreal.EditorAssetLibrary().save_loaded_asset(path_to_skeleton_asset, True) after the import job finished.

Hi @impostekno thank you so much for the suggestions. I was able to try this again today. I did have the import task set to automated. It looks like the problem was that my skeleton asset, like yours, was not being saved.
When using save_loaded_asset, I needed to get a skeleton object. Like this:

loaded_skel = unreal.find_asset(r'/Game/3D/Character/Test_Asset/Rig/test_assetsksh_Skeleton')
unreal.EditorAssetLibrary().save_loaded_asset(loaded_skel, True)

Were you able to supply the path and didn’t need the object?

Do you happen to know if there is a similar issue when creating the physics asset?

Hi @marianne.gorczyc, yes I only used the path that you can get by right clicking the object in content browser and choosing copy reference:

Skeleton’/Game/folderWhereSkeletonExists/rig_Skeleton.rig_Skeleton’

I removed the prefix since that only represents type of the asset. So you can simply use:

‘/Game/folderWhereSkeletonExists/rig_Skeleton.rig_Skeleton’

In case you are having problem where the asset needs to be loaded first than you can use:
save_directory(directory_path, only_if_is_dirty=True, recursive=True )
since it will load the assets first then save everything in that directory.

As for the physics asset I am not sure but I think it could be same as for the skeleton.