How to Use the Async System (Only ACC 3.x)
Only available since ACC 3.x
This feature is only compatible with ACC version 3.0 and above.
To load an UACCCreationComponent
asynchronously, here’s what you need to do:
- Implement soft path resolution in your handlers (
UACCItemParamHandler
andUACCParamHandler
). - If you're working from Blueprints, it's a bit trickier due to limitations around handling references to non-UObject types (e.g., structs).
- Call the async version of the load method instead of the regular
LoadCreation
.
Quick Diagram :
Blueprint Side
Preparing Asset Path Resolution
In Blueprints, you need to enable the soft asset path resolution by ticking the appropriate checkbox in your handler:
Then implement the resolution logic, for example to gather asset paths for a head mesh:
Calling LoadCreationAsync
Once the setup is complete, you can call the async load node:
C++ Side
Preparing Asset Path Resolution
In C++, it’s much more straightforward. Just implement the method and gather the asset paths.
Example with the HairStyle
handler:
void UACCParamHandler_HairStyle::GetSoftAssetPathsFromParam(UACCCreationComponent* CreationComponent,
const FInstancedStruct& Param, TArray<FSoftObjectPath>& OutPaths)
{
Super::GetSoftAssetPathsFromParam(CreationComponent, Param, OutPaths);
if (Param.GetScriptStruct() == TBaseStructure<FACCIntParam>::Get())
{
const FACCIntParam& IntParam = Param.Get<FACCIntParam>();
if (!IntParam.IsValid()) return;
FACCMeshData MeshData;
if (!CreationComponent->GetValidMeshData("Hair", IntParam.Value, MeshData))
{
return;
}
MeshData.AddToSoftPaths(OutPaths);
}
}
Calling LoadCreationAsync
Here’s how you can trigger the async load in C++:
UACCEngineSubsystem* ACCEngineSubsystem = GEngine->GetEngineSubsystem<UACCEngineSubsystem>();
auto AsyncCreationLibrary = ACCEngineSubsystem->GetAsyncCreationLibrary();
if (AsyncCreationLibrary)
{
// Without callback
AsyncCreationLibrary->LoadCreationAsync(Params);
// With callback
AsyncCreationLibrary->LoadCreationAsync(Params, FACCCreationAsyncCompleted::CreateLambda([](bool bSuccess)
{
// Handle completion
}));
}