UE自带有两个函数,可以导入导出纹理图片,不过支持格式不过,也能将就用,蓝图也可以直接用。
/** * Exports a Texture2D as a HDR image onto the disk. */ UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (Keywords = "ExportTexture2D", WorldContext = "WorldContextObject")) static ENGINE_API void ExportTexture2D(UObject* WorldContextObject, UTexture2D* Texture, const FString& FilePath, const FString& FileName); /** * Imports a texture file from disk and creates Texture2D from it. */ UFUNCTION(BlueprintCallable, Category = "Rendering", meta = (WorldContext = "WorldContextObject")) static ENGINE_API UTexture2D* ImportFileAsTexture2D(UObject* WorldContextObject, const FString& Filename);