2020-01-22 17:58:55 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
|
|
#include "AsyncAnimCompressionUI.h"
|
|
|
|
|
#include "GlobalEditorNotification.h"
|
|
|
|
|
#include "Widgets/Notifications/SNotificationList.h"
|
|
|
|
|
#include "Animation/AnimCompressionDerivedDataPublic.h"
|
|
|
|
|
#include "Animation/AnimSequence.h"
|
|
|
|
|
|
|
|
|
|
/** Global notification object. */
|
|
|
|
|
|
2021-03-24 16:26:43 -04:00
|
|
|
/** Notification class for asynchronous shader compiling. */
|
|
|
|
|
class FAnimCompressionNotificationImpl : public FGlobalEditorProgressNotification
|
2020-01-22 17:58:55 -05:00
|
|
|
{
|
2021-03-24 16:26:43 -04:00
|
|
|
public:
|
|
|
|
|
FAnimCompressionNotificationImpl()
|
|
|
|
|
: FGlobalEditorProgressNotification(NSLOCTEXT("AsyncAnimCompression", "AnimCompressionInProgress", "Compressing Animations"))
|
|
|
|
|
{}
|
|
|
|
|
protected:
|
|
|
|
|
/** FGlobalEditorProgressNotification interface */
|
|
|
|
|
virtual int32 UpdateProgress()
|
2020-01-22 17:58:55 -05:00
|
|
|
{
|
2021-03-24 16:26:43 -04:00
|
|
|
const int32 RemainingJobs = GAsyncCompressedAnimationsTracker ? GAsyncCompressedAnimationsTracker->GetNumRemainingJobs() : 0;
|
2020-01-22 17:58:55 -05:00
|
|
|
if (RemainingJobs > 0)
|
|
|
|
|
{
|
|
|
|
|
FFormatNamedArguments Args;
|
|
|
|
|
Args.Add(TEXT("AnimsToCompress"), FText::AsNumber(RemainingJobs));
|
2021-03-24 16:26:43 -04:00
|
|
|
UpdateProgressMessage(FText::Format(NSLOCTEXT("AsyncAnimCompression", "AnimCompressionInProgressFormat", "Compressing Animations ({AnimsToCompress})"), Args));
|
2020-01-22 17:58:55 -05:00
|
|
|
|
|
|
|
|
}
|
2021-03-24 16:26:43 -04:00
|
|
|
|
|
|
|
|
return RemainingJobs;
|
2020-01-22 17:58:55 -05:00
|
|
|
}
|
2021-03-24 16:26:43 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
FAnimCompressionNotificationImpl GAnimCompressionNotification;
|