engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
IToolsContextAssetAPI类 参考abstract

Users of the Tools Framework need to provide an IToolsContextAssetAPI implementation that allows Packages and Assets to be created/saved. 更多...

#include <ToolContextInterfaces.h>

Public 成员函数

virtual void AutoSaveGeneratedAsset (UObject *Asset, UPackage *AssetPackage)=0
 Autosave asset to persistent storage
 
virtual AActor * GenerateStaticMeshActor (UWorld *TargetWorld, FTransform Transform, FString ObjectBaseName, FGeneratedStaticMeshAssetConfig &&AssetConfig)=0
 Create a new UStaticMeshAsset for the provided mesh, then a new UStaticMeshComponent and AStaticMeshActor in the TargetWorld 更多...
 
virtual FString GetActiveAssetFolderPath ()=0
 Get a "currently-visible/selected" location to save assets in. 更多...
 
virtual FString GetWorldRelativeAssetRootPath (const UWorld *World)=0
 Get a path to save assets in that is relative to the given UWorld.
 
virtual void InteractiveSaveGeneratedAsset (UObject *Asset, UPackage *AssetPackage)=0
 Request saving of asset to persistent storage via something like an interactive popup dialog
 
virtual FString InteractiveSelectAssetPath (const FString &DefaultAssetName, const FText &DialogTitleMessage)=0
 Allow the user to select a path and filename for an asset using a modal dialog
 
virtual UPackage * MakeNewAssetPackage (const FString &FolderPath, const FString &AssetBaseName, FString &UniqueAssetNameOut)=0
 Creates a new package for an asset 更多...
 
virtual void NotifyGeneratedAssetModified (UObject *Asset, UPackage *AssetPackage)=0
 Notify that asset has been created and is dirty
 
virtual bool SaveGeneratedTexture2D (UTexture2D *GeneratedTexture, FString ObjectBaseName, const UObject *RelativeToAsset)
 Save a generated UTexture2D as an Asset. 更多...
 

详细描述

Users of the Tools Framework need to provide an IToolsContextAssetAPI implementation that allows Packages and Assets to be created/saved.

Note that this is not strictly necessary, for example a trivial implementation could just store things in the Transient package and not do any saving.

成员函数说明

◆ GenerateStaticMeshActor()

virtual AActor * IToolsContextAssetAPI::GenerateStaticMeshActor ( UWorld *  TargetWorld,
FTransform  Transform,
FString  ObjectBaseName,
FGeneratedStaticMeshAssetConfig &&  AssetConfig 
)
pure virtual

Create a new UStaticMeshAsset for the provided mesh, then a new UStaticMeshComponent and AStaticMeshActor in the TargetWorld

参数
TargetWorldworld to create new Actor in
Transformtransform to set on Actor
ObjectBaseNamea base name for the Asset and Actor. Unique name will be generated by appending a number, if a name collision occurs.
AssetConfigconfiguration information for the new Asset
返回
new AStaticMeshActor with new Asset assigned to it's UStaticMeshComponent
警告
this function may return null. In this case the asset creation failed and/or the user cancelled during the process, if it was interactive.

◆ GetActiveAssetFolderPath()

virtual FString IToolsContextAssetAPI::GetActiveAssetFolderPath ( )
pure virtual

Get a "currently-visible/selected" location to save assets in.

For example the currently-visible path in the Editor Content Browser.

◆ MakeNewAssetPackage()

virtual UPackage * IToolsContextAssetAPI::MakeNewAssetPackage ( const FString &  FolderPath,
const FString &  AssetBaseName,
FString &  UniqueAssetNameOut 
)
pure virtual

Creates a new package for an asset

参数
FolderPathpath for new package
AssetBaseNamebase name for asset
UniqueAssetNameOutunique name in form of AssetBaseName##, where ## is a unqiue index
返回
new package

◆ SaveGeneratedTexture2D()

virtual bool IToolsContextAssetAPI::SaveGeneratedTexture2D ( UTexture2D *  GeneratedTexture,
FString  ObjectBaseName,
const UObject *  RelativeToAsset 
)
inlinevirtual

Save a generated UTexture2D as an Asset.

Assumption is that the texture was generated in code and is in the Transient package.

参数
GeneratedTextureTexture2D to save
ObjectBaseNamea base name for the Asset. Unique name will be generated by appending a number, if a name collision occurs.
RelativeToAssetNew texture will be saved at the same path as the UPackage for this UObject, which we assume to be an Asset (eg like a UStaticMesh)

该类的文档由以下文件生成: