Files
UnrealEngineUWP/Engine/Source/Programs/InterchangeWorker/Private/InterchangeWorkerImpl.h
Alexis Matte 5470f5098f Fix gimbal lock by avoiding euler angle when importing fbx bone animation, we instead bake the data like the legacy importer did.
To achieve this a new type of payload was added to the payload interface which allow the client asking for payload to describe the bake settings (Hz, start time, end time)
#jira UE-151896
#rb benoit.deschenes
#preflight 62869cdd153b5ae9cdcc92d1
#rnx

[CL 20286621 by Alexis Matte in ue5-main branch]
2022-05-19 16:07:20 -04:00

46 lines
1.8 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "HAL/CriticalSection.h"
#include "HAL/PlatformTime.h"
#include "HAL/Thread.h"
#include "InterchangeWorker.h"
#include "InterchangeCommands.h"
#include "InterchangeDispatcherNetworking.h"
#include "InterchangeFbxParser.h"
struct FFileStatData;
class FImportParameters;
class FInterchangeWorkerImpl
{
public:
FInterchangeWorkerImpl(int32 InServerPID, int32 InServerPort, FString& InResultFolder);
bool Run(const FString& WorkerVersionError);
private:
void InitiatePing();
void ProcessCommand(const UE::Interchange::FPingCommand& PingCommand);
void ProcessCommand(const UE::Interchange::FBackPingCommand& BackPingCommand);
void ProcessCommand(const TSharedPtr<UE::Interchange::ICommand> Command, const FString& ThreadName);
void ProcessCommand(const UE::Interchange::FQueryTaskProgressCommand& QueryTaskProgressCommand);
UE::Interchange::ETaskState LoadFbxFile(const UE::Interchange::FJsonLoadSourceCmd& LoadSourceCommand, FString& OutJSonResult, TArray<FString>& OutJSonMessages);
UE::Interchange::ETaskState FetchFbxPayload(const UE::Interchange::FJsonFetchPayloadCmd& FetchPayloadCommand, FString& OutJSonResult, TArray<FString>& OutJSonMessages);
UE::Interchange::ETaskState FetchFbxPayload(const UE::Interchange::FJsonFetchAnimationBakeTransformPayloadCmd& FetchAnimationBakeTransformPayloadCommand, FString& OutJSonResult, TArray<FString>& OutJSonMessages);
private:
UE::Interchange::FNetworkClientNode NetworkInterface;
UE::Interchange::FCommandQueue CommandIO;
int32 ServerPID;
int32 ServerPort;
uint64 PingStartCycle;
FString ResultFolder;
FCriticalSection TFinishThreadCriticalSection;
TArray<FString> CurrentFinishThreads;
TMap<FString, TFuture<bool> > ActiveThreads;
UE::Interchange::FInterchangeFbxParser FbxParser;
};