A `UCustomizableObject` is causing a ~4s freeze when loading all its subobjects.

I have a `TSoftObjectPtr<UCustomizableObject>`. In my player character’s `BeginPlay`. I load it with

`FStreamableManager::RequestAsyncLoad`. Then, `UCustomizableObject::PostLoad` is called and it loads all its subobjects in the main thread. This makes the editor freeze for a few seconds.

Why do I have to load this `UCustomizableObject` instead of just having a `UCustomizableObjectInstance`?

Because my character changes appearance on runtime based on clothes and equipment. I can’t just set `UCustomizableSkeletalComponent::CustomizableObjectInstance` in the editor. I need to create a new `UCustomizableObjectInstance` on runtime, so I need a reference to the `UCustomizableObject` to call `UCustomizableObjectInstance::SetObject` with it.

I have discovered this freeze doesn’t happen if I convert the `TSoftObjectPtr<UCustomizableObject>` to a `TObjectPtr<UCustomizableObject>`. But that would make the editor take longer to load.

Is it normal that loading a `UCUstomizableObject` causes a editor freeze like this? Is there something that could be wrongly set up?

Steps to Reproduce

  1. Make a bunch of `UCustomizableObject`s with a complex, big hierarchy for different body parts.
  2. Have a `TSoftObjectPtr` pointing to the root `UCustomizableObject`.
  3. Load it with `FStreamableManager::RequestAsyncLoad`.
  4. After loading, the editor will hang for some seconds, because the root object is loading all its chilcren in the main thread.

Hi Julen,

UCustomizableObjectInstance is a container of parameters. The virtual machine that uses those parameters to generate meshes and textures is stored in the UCustomizableObject (CO).

The hitch you mentioned (IsCompilationOutOfDate -> GetParticipatingObjects) has been fixed and will not occur starting with release 5.6.

Keep in mind that even after the fix above, hitching may still happen to some degree when compiling COs. Mutable must load all child COs to compile the graph, and when that happens, the meshes in those COs are cached, which may block the game thread. We’re working on removing this and other hitches, so expect further improvements in future releases.

Regards,

Pere

Many thanks, Pere.