2025-03-29 19:29:29 -05:00
|
|
|
using Blitzkit;
|
2025-03-06 19:41:55 -06:00
|
|
|
using CUE4Parse_Conversion.Textures;
|
|
|
|
|
using CUE4Parse.UE4.Assets.Exports.Texture;
|
2025-03-29 19:29:29 -05:00
|
|
|
using CUE4Parse.UE4.Objects.Core.Math;
|
2025-04-02 16:00:18 -05:00
|
|
|
using SkiaSharp;
|
2025-03-06 19:41:55 -06:00
|
|
|
|
|
|
|
|
namespace BlitzKit.CLI.Utils
|
|
|
|
|
{
|
|
|
|
|
public static class BlitzKitExporter
|
|
|
|
|
{
|
2025-03-29 19:29:29 -05:00
|
|
|
private static readonly float SCALE = 0.01f;
|
|
|
|
|
|
2025-03-06 19:41:55 -06:00
|
|
|
public static byte[] Texture2D(UTexture2D texture)
|
|
|
|
|
{
|
|
|
|
|
return texture
|
|
|
|
|
.Decode(ETexturePlatform.DesktopMobile)!
|
2025-04-02 16:00:18 -05:00
|
|
|
.Encode(SKEncodedImageFormat.Webp, 100)
|
2025-03-06 19:41:55 -06:00
|
|
|
.ToArray();
|
|
|
|
|
}
|
2025-03-29 19:29:29 -05:00
|
|
|
|
|
|
|
|
public static Vector3 Vector3(FVector fVector)
|
|
|
|
|
{
|
|
|
|
|
return new()
|
|
|
|
|
{
|
|
|
|
|
X = SCALE * fVector.X,
|
|
|
|
|
Y = SCALE * fVector.Z,
|
|
|
|
|
Z = SCALE * fVector.Y,
|
|
|
|
|
};
|
|
|
|
|
}
|
2025-03-06 19:41:55 -06:00
|
|
|
}
|
|
|
|
|
}
|