Files
UnrealEngineUWP/Engine/Source/Editor/SparseVolumeTexture/Private/SparseVolumeTextureFactory.h
tim doerries 75da662566 Implemented automatic asset renaming when importing .vdb sequences as an animated SparseVolumeTexture. The resulting asset name will no longer have the number postfix of the original file used to import the entire sequence.
SVT assets now also have an additional property to show the number of frames in the editor UI.

#rb Sebastien.Hillaire
#rnx

[CL 26090823 by tim doerries in ue5-main branch]
2023-06-19 10:56:00 -04:00

60 lines
2.0 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#if WITH_EDITOR
#include "CoreMinimal.h"
#include "Factories/Factory.h"
#include "EditorReimportHandler.h"
#include "SparseVolumeTextureFactory.generated.h"
// Responsible for creating and importing Sparse Volume Texture objects
UCLASS(hidecategories = Object, MinimalAPI)
class USparseVolumeTextureFactory : public UFactory, public FReimportHandler
{
GENERATED_UCLASS_BODY()
public:
//~ Begin UFactory Interface
virtual bool ShouldShowInNewMenu() const override;
virtual FText GetDisplayName() const override;
virtual bool ConfigureProperties() override;
///////////////////////////////////////////////////////////////////////////////
// Create asset
virtual UObject* FactoryCreateNew(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, UObject* Context, FFeedbackContext* Warn) override;
virtual bool CanCreateNew() const override;
///////////////////////////////////////////////////////////////////////////////
// Import asset
virtual UObject* FactoryCreateFile(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename,
const TCHAR* Parms, FFeedbackContext* Warn, bool& bOutOperationCanceled) override;
virtual void CleanUp() override;
virtual bool FactoryCanImport(const FString& Filename) override;
virtual bool DoesSupportClass(UClass* Class) override;
virtual UClass* ResolveSupportedClass() override;
//~ End UFactory Interface
//~ Begin FReimportHandler Interface
virtual bool CanReimport(UObject* Obj, TArray<FString>& OutFilenames) override;
virtual void SetReimportPaths(UObject* Obj, const TArray<FString>& NewReimportPaths) override;
virtual EReimportResult::Type Reimport(UObject* Obj) override;
//~ End FReimportHandler Interface
protected:
private:
UObject* ImportInternal(UClass* InClass, UObject* InParent, FName InName, EObjectFlags Flags, const FString& Filename, const TCHAR* Parms, bool& bOutOperationCanceled, bool bIsReimport);
};
#endif // WITH_EDITOR