Hello!
We are investigating performance issues with Mutable, and one that has come up is when copying the DNA object inside URigLogicMutableExtension::OnSkeletalMeshCreated. For skeletal meshes that are created for runtime-only scenarios, this copy is resource-intensive. Is there a good way to avoid this or are there any dangers to trying to avoid it? Locally, we’re trying the below, and that seems to work in a pinch, but we’d like to know if there are any knock-on effects we should be aware of.
Thanks!
-Nathaniel
if (Data
&& Data->ComponentName == ComponentName
&& Data->GetDNAAsset() != nullptr)
{
#if WITH_EDITOR
UDNAAsset* NewDNA = CopyDNAAsset(Data->GetDNAAsset(), SkeletalMesh);
SkeletalMesh->AddAssetUserData(NewDNA);
#else
ensureMsgf(SkeletalMesh->GetAssetUserData<UDNAAsset>(), TEXT("SkeletalMesh %s does not already have a DNAAsset!"), *SkeletalMesh->GetName());
#endif // WITH_EDITOR
SkeletalMesh->AddAssetUserData(NewDNA);
// A mesh can only have one DNA at a time, so if the CO produced multiple DNA
// Assets, all but the first will be discarded.
break;
}
[Attachment Removed]