vault backup: 2024-01-12 17:14:44
This commit is contained in:
parent
4ae093331c
commit
ca37fe4c24
@ -171,4 +171,32 @@ void FFbxExporter::CorrectAnimTrackInterpolation( TArray<FbxNode*>& BoneNodes, F
|
|||||||
```
|
```
|
||||||
|
|
||||||
## 导入Curve相关逻辑
|
## 导入Curve相关逻辑
|
||||||
UnFbx::FFbxImporter::ImportCurveToAnimSequence() => UnFbx::FFbxImporter::ImportCurve()
|
UnFbx::FFbxImporter::ImportCurveToAnimSequence() => UnFbx::FFbxImporter::ImportCurve()
|
||||||
|
|
||||||
|
## 异步机制改进
|
||||||
|
```c++
|
||||||
|
void URuntimeAudioImporterLibrary::ImportAudioFromFile(const FString& FilePath, ERuntimeAudioFormat AudioFormat)
|
||||||
|
{
|
||||||
|
AsyncTask(ENamedThreads::AnyBackgroundHiPriTask, [WeakThis = TWeakObjectPtr<URuntimeAudioImporterLibrary>(this), FilePath, AudioFormat]() mutable
|
||||||
|
{
|
||||||
|
if (!WeakThis.IsValid())
|
||||||
|
{ UE_LOG(LogRuntimeAudioImporter, Error, TEXT("Failed to import audio from file '%s' because the RuntimeAudioImporterLibrary object has been destroyed"), *FilePath);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
FGCObjectScopeGuard Guard(WeakThis.Get());
|
||||||
|
|
||||||
|
if (!FPaths::FileExists(FilePath))
|
||||||
|
{ WeakThis->OnResult_Internal(nullptr, ERuntimeImportStatus::AudioDoesNotExist);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
AudioFormat = AudioFormat == ERuntimeAudioFormat::Auto ? GetAudioFormat(FilePath) : AudioFormat;
|
||||||
|
AudioFormat = AudioFormat == ERuntimeAudioFormat::Invalid ? ERuntimeAudioFormat::Auto : AudioFormat;
|
||||||
|
|
||||||
|
TArray64<uint8> AudioBuffer;
|
||||||
|
if (!LoadAudioFileToArray(AudioBuffer, *FilePath))
|
||||||
|
{ WeakThis->OnResult_Internal(nullptr, ERuntimeImportStatus::LoadFileToArrayError);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
WeakThis->ImportAudioFromBuffer(MoveTemp(AudioBuffer), AudioFormat);
|
||||||
|
});}
|
||||||
|
```
|
Loading…
x
Reference in New Issue
Block a user